Skip to content

Commit

Permalink
Backed out changeset e1f3ed984607 (bug 1261585) for causing bug 12925…
Browse files Browse the repository at this point in the history
…86 a=backout
  • Loading branch information
KWierso committed Aug 22, 2016
1 parent d440b1a commit ae94313
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 484 deletions.
2 changes: 0 additions & 2 deletions netwerk/protocol/http/HttpBaseChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ HttpBaseChannel::HttpBaseChannel()
, mPriority(PRIORITY_NORMAL)
, mRedirectionLimit(gHttpHandler->RedirectionLimit())
, mApplyConversion(true)
, mHaveListenerForTraceableChannel(false)
, mCanceled(false)
, mIsPending(false)
, mWasOpened(false)
Expand Down Expand Up @@ -2662,7 +2661,6 @@ HttpBaseChannel::SetNewListener(nsIStreamListener *aListener, nsIStreamListener

wrapper.forget(_retval);
mListener = aListener;
mHaveListenerForTraceableChannel = true;
return NS_OK;
}

Expand Down
43 changes: 20 additions & 23 deletions netwerk/protocol/http/HttpBaseChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ class HttpBaseChannel : public nsHashPropertyBag
// the new mUploadStream.
void EnsureUploadStreamIsCloneableComplete(nsresult aStatus);

bool HaveListenerForTraceableChannel() { return mHaveListenerForTraceableChannel; }

protected:
nsCOMArray<nsISecurityConsoleMessage> mSecurityConsoleMessages;

Expand Down Expand Up @@ -417,30 +415,29 @@ class HttpBaseChannel : public nsHashPropertyBag
int16_t mPriority;
uint8_t mRedirectionLimit;

uint32_t mApplyConversion : 1;
uint32_t mHaveListenerForTraceableChannel : 1;
uint32_t mCanceled : 1;
uint32_t mIsPending : 1;
uint32_t mWasOpened : 1;
uint32_t mApplyConversion : 1;
uint32_t mCanceled : 1;
uint32_t mIsPending : 1;
uint32_t mWasOpened : 1;
// if 1 all "http-on-{opening|modify|etc}-request" observers have been called
uint32_t mRequestObserversCalled : 1;
uint32_t mResponseHeadersModified : 1;
uint32_t mAllowPipelining : 1;
uint32_t mAllowSTS : 1;
uint32_t mThirdPartyFlags : 3;
uint32_t mUploadStreamHasHeaders : 1;
uint32_t mInheritApplicationCache : 1;
uint32_t mChooseApplicationCache : 1;
uint32_t mLoadedFromApplicationCache : 1;
uint32_t mChannelIsForDownload : 1;
uint32_t mTracingEnabled : 1;
uint32_t mRequestObserversCalled : 1;
uint32_t mResponseHeadersModified : 1;
uint32_t mAllowPipelining : 1;
uint32_t mAllowSTS : 1;
uint32_t mThirdPartyFlags : 3;
uint32_t mUploadStreamHasHeaders : 1;
uint32_t mInheritApplicationCache : 1;
uint32_t mChooseApplicationCache : 1;
uint32_t mLoadedFromApplicationCache : 1;
uint32_t mChannelIsForDownload : 1;
uint32_t mTracingEnabled : 1;
// True if timing collection is enabled
uint32_t mTimingEnabled : 1;
uint32_t mAllowSpdy : 1;
uint32_t mAllowAltSvc : 1;
uint32_t mResponseTimeoutEnabled : 1;
uint32_t mTimingEnabled : 1;
uint32_t mAllowSpdy : 1;
uint32_t mAllowAltSvc : 1;
uint32_t mResponseTimeoutEnabled : 1;
// A flag that should be false only if a cross-domain redirect occurred
uint32_t mAllRedirectsSameOrigin : 1;
uint32_t mAllRedirectsSameOrigin : 1;

// Is 1 if no redirects have occured or if all redirects
// pass the Resource Timing timing-allow-check
Expand Down
7 changes: 1 addition & 6 deletions netwerk/protocol/http/HttpChannelChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ HttpChannelChild::RecvOnStartRequest(const nsresult& channelStatus,
const NetAddr& selfAddr,
const NetAddr& peerAddr,
const int16_t& redirectCount,
const uint32_t& cacheKey,
const bool& contentDecodingWillBeCalledOnParent)
const uint32_t& cacheKey)
{
LOG(("HttpChannelChild::RecvOnStartRequest [this=%p]\n", this));
// mFlushedForDiversion and mDivertingToParent should NEVER be set at this
Expand All @@ -382,10 +381,6 @@ HttpChannelChild::RecvOnStartRequest(const nsresult& channelStatus,

mRedirectCount = redirectCount;

if (contentDecodingWillBeCalledOnParent) {
SetApplyConversion(false);
}

mEventQ->RunOrEnqueue(new StartRequestEvent(this, channelStatus, responseHead,
useResponseHead, requestHeaders,
isFromCache, cacheEntryAvailable,
Expand Down
3 changes: 1 addition & 2 deletions netwerk/protocol/http/HttpChannelChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ class HttpChannelChild final : public PHttpChannelChild
const NetAddr& selfAddr,
const NetAddr& peerAddr,
const int16_t& redirectCount,
const uint32_t& cacheKey,
const bool& contentDecodingWillBeCalledOnParent) override;
const uint32_t& cacheKey) override;
bool RecvOnTransportAndData(const nsresult& channelStatus,
const nsresult& status,
const uint64_t& progress,
Expand Down
60 changes: 8 additions & 52 deletions netwerk/protocol/http/HttpChannelParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "nsIWindowWatcher.h"
#include "nsIDocument.h"
#include "nsStringStream.h"
#include "nsIExternalHelperAppService.h"

using mozilla::BasePrincipal;
using namespace mozilla::dom;
Expand Down Expand Up @@ -1030,47 +1029,8 @@ HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
}

nsCOMPtr<nsIEncodedChannel> encodedChannel = do_QueryInterface(aRequest);
if (encodedChannel) {
if (!mChannel->HaveListenerForTraceableChannel()) {
encodedChannel->SetApplyConversion(false);
} else {
// We have a traceableChannel listener so we need to do a conversion on
// the parent. But first we need to check with
// external-helper-app-service, e.g. we do not ungzip if url has a gz
// extention.
// This code is a copy of
// nsExternalAppHandler::MaybeApplyDecodingForExtension and should be
// kept in sync with it.
nsCOMPtr<nsIURI> uri;
chan->GetURI(getter_AddRefs(uri));
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
if (url) {
nsAutoCString extension;
url->GetFileExtension(extension);
if (!extension.IsEmpty()) {
nsCOMPtr<nsIUTF8StringEnumerator> encEnum;
encodedChannel->GetContentEncodings(getter_AddRefs(encEnum));
if (encEnum) {
bool hasMore;
nsresult rv = encEnum->HasMore(&hasMore);
if (NS_SUCCEEDED(rv) && hasMore) {
nsAutoCString encType;
rv = encEnum->GetNext(encType);
if (NS_SUCCEEDED(rv) && !encType.IsEmpty()) {
nsCOMPtr<nsIExternalHelperAppService> helperAppService =
do_GetService("@mozilla.org/uriloader/external-helper-app-service;1");
MOZ_ASSERT(helperAppService);
bool applyConversion;
helperAppService->ApplyDecodingForExtension(extension, encType,
&applyConversion);
encodedChannel->SetApplyConversion(applyConversion);
}
}
}
}
}
}
}
if (encodedChannel)
encodedChannel->SetApplyConversion(false);

// Keep the cache entry for future use in RecvSetCacheTokenCachedCharset().
// It could be already released by nsHttpChannel at that time.
Expand Down Expand Up @@ -1115,8 +1075,7 @@ HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
expirationTime, cachedCharset, secInfoSerialization,
mChannel->GetSelfAddr(), mChannel->GetPeerAddr(),
redirectCount,
cacheKeyValue,
mChannel->HaveListenerForTraceableChannel()))
cacheKeyValue))
{
rv = NS_ERROR_UNEXPECTED;
}
Expand Down Expand Up @@ -1531,14 +1490,11 @@ HttpChannelParent::StartDiversion()
//
// Create a content conversion chain based on mDivertListener and update
// mDivertListener.
// If nsITraceableChannel is added the conversion will be already done.
if (!mChannel->HaveListenerForTraceableChannel()) {
nsCOMPtr<nsIStreamListener> converterListener;
mChannel->DoApplyContentConversions(mDivertListener,
getter_AddRefs(converterListener));
if (converterListener) {
mDivertListener = converterListener.forget();
}
nsCOMPtr<nsIStreamListener> converterListener;
mChannel->DoApplyContentConversions(mDivertListener,
getter_AddRefs(converterListener));
if (converterListener) {
mDivertListener = converterListener.forget();
}

// Now mParentListener can be diverted to mDivertListener.
Expand Down
3 changes: 1 addition & 2 deletions netwerk/protocol/http/PHttpChannel.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ child:
NetAddr selfAddr,
NetAddr peerAddr,
int16_t redirectCount,
uint32_t cacheKey,
bool contentDecodingWillBeCalledOnParent);
uint32_t cacheKey);

// Combines a single OnDataAvailable and its associated OnProgress &
// OnStatus calls into one IPDL message
Expand Down
36 changes: 0 additions & 36 deletions netwerk/test/unit_ipc/child_tracable_listener.js

This file was deleted.

Loading

0 comments on commit ae94313

Please sign in to comment.