Bug 909050 - Prevent about:networking from returning PB data. r=mcmanus

This commit is contained in:
Valentin Gosu
2013-08-31 12:06:14 -04:00
parent a7ecc7bdc3
commit c909a300cb
5 changed files with 26 additions and 6 deletions

View File

@@ -952,6 +952,7 @@ WebSocketChannel::WebSocketChannel() :
mCompressor(nullptr),
mDynamicOutputSize(0),
mDynamicOutput(nullptr),
mPrivateBrowsing(false),
mConnectionLogService(nullptr)
{
NS_ABORT_IF_FALSE(NS_IsMainThread(), "not main thread");
@@ -1328,7 +1329,7 @@ WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count)
NS_DispatchToMainThread(new CallOnMessageAvailable(this, utf8Data, -1));
nsresult rv;
if (mConnectionLogService) {
if (mConnectionLogService && !mPrivateBrowsing) {
nsAutoCString host;
rv = mURI->GetHostPort(host);
if (NS_SUCCEEDED(rv)) {
@@ -1419,7 +1420,7 @@ WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count)
payloadLength));
// To add the header to 'Networking Dashboard' log
nsresult rv;
if (mConnectionLogService) {
if (mConnectionLogService && !mPrivateBrowsing) {
nsAutoCString host;
rv = mURI->GetHostPort(host);
if (NS_SUCCEEDED(rv)) {
@@ -1844,7 +1845,7 @@ WebSocketChannel::CleanupConnection()
}
nsresult rv;
if (mConnectionLogService) {
if (mConnectionLogService && !mPrivateBrowsing) {
nsAutoCString host;
rv = mURI->GetHostPort(host);
if (NS_SUCCEEDED(rv))
@@ -2678,7 +2679,9 @@ WebSocketChannel::AsyncOpen(nsIURI *aURI,
if (NS_FAILED(rv))
return rv;
if (mConnectionLogService) {
mPrivateBrowsing = NS_UsePrivateBrowsing(localChannel);
if (mConnectionLogService && !mPrivateBrowsing) {
nsAutoCString host;
rv = mURI->GetHostPort(host);
if (NS_SUCCEEDED(rv)) {
@@ -2783,7 +2786,7 @@ WebSocketChannel::SendMsgCommon(const nsACString *aMsg, bool aIsBinary,
}
nsresult rv;
if (mConnectionLogService) {
if (mConnectionLogService && !mPrivateBrowsing) {
nsAutoCString host;
rv = mURI->GetHostPort(host);
if (NS_SUCCEEDED(rv)) {