1 # HG changeset patch |
|
2 # Parent 8da41a2cee774ce4d00b9ac1032a495b8bc560a0 |
|
3 Revert investigation patch for bmo#621446; as it is useless on desktop and breaks the build for certain compilers |
|
4 |
|
5 diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp |
|
6 --- a/netwerk/protocol/http/HttpChannelParent.cpp |
|
7 +++ b/netwerk/protocol/http/HttpChannelParent.cpp |
|
8 @@ -52,29 +52,25 @@ |
|
9 #include "nsIBadCertListener2.h" |
|
10 #include "nsICacheEntryDescriptor.h" |
|
11 #include "nsSerializationHelper.h" |
|
12 #include "nsISerializable.h" |
|
13 #include "nsIAssociatedContentSecurity.h" |
|
14 #include "nsIApplicationCacheService.h" |
|
15 #include "nsIOfflineCacheUpdate.h" |
|
16 #include "nsIRedirectChannelRegistrar.h" |
|
17 -#include "prinit.h" |
|
18 |
|
19 namespace mozilla { |
|
20 namespace net { |
|
21 |
|
22 HttpChannelParent::HttpChannelParent(PBrowserParent* iframeEmbedding) |
|
23 : mIPCClosed(false) |
|
24 , mStoredStatus(0) |
|
25 , mStoredProgress(0) |
|
26 , mStoredProgressMax(0) |
|
27 - , mSentRedirect1Begin(false) |
|
28 - , mSentRedirect1BeginFailed(false) |
|
29 - , mReceivedRedirect2Verify(false) |
|
30 { |
|
31 // Ensure gHttpHandler is initialized: we need the atom table up and running. |
|
32 nsIHttpProtocolHandler* handler; |
|
33 CallGetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &handler); |
|
34 NS_ASSERTION(handler, "no http handler"); |
|
35 |
|
36 mTabParent = do_QueryObject(static_cast<TabParent*>(iframeEmbedding)); |
|
37 } |
|
38 @@ -326,21 +322,16 @@ HttpChannelParent::RecvUpdateAssociatedC |
|
39 mAssociatedContentSecurity->SetCountSubRequestsHighSecurity(high); |
|
40 mAssociatedContentSecurity->SetCountSubRequestsLowSecurity(low); |
|
41 mAssociatedContentSecurity->SetCountSubRequestsBrokenSecurity(broken); |
|
42 mAssociatedContentSecurity->SetCountSubRequestsNoSecurity(no); |
|
43 } |
|
44 return true; |
|
45 } |
|
46 |
|
47 -// Bug 621446 investigation, we don't want conditional PR_Aborts bellow to be |
|
48 -// merged to a single address. |
|
49 -#pragma warning(disable : 4068) |
|
50 -#pragma GCC optimize ("O0") |
|
51 - |
|
52 bool |
|
53 HttpChannelParent::RecvRedirect2Verify(const nsresult& result, |
|
54 const RequestHeaderTuples& changedHeaders) |
|
55 { |
|
56 if (NS_SUCCEEDED(result)) { |
|
57 nsCOMPtr<nsIHttpChannel> newHttpChannel = |
|
58 do_QueryInterface(mRedirectChannel); |
|
59 |
|
60 @@ -348,40 +339,21 @@ HttpChannelParent::RecvRedirect2Verify(c |
|
61 for (PRUint32 i = 0; i < changedHeaders.Length(); i++) { |
|
62 newHttpChannel->SetRequestHeader(changedHeaders[i].mHeader, |
|
63 changedHeaders[i].mValue, |
|
64 changedHeaders[i].mMerge); |
|
65 } |
|
66 } |
|
67 } |
|
68 |
|
69 - if (!mRedirectCallback) { |
|
70 - // Bug 621446 investigation (optimization turned off above) |
|
71 - if (mReceivedRedirect2Verify) |
|
72 - NS_RUNTIMEABORT("Duplicate fire"); |
|
73 - if (mSentRedirect1BeginFailed) |
|
74 - NS_RUNTIMEABORT("Send to child failed"); |
|
75 - if (mSentRedirect1Begin && NS_FAILED(result)) |
|
76 - NS_RUNTIMEABORT("Redirect failed"); |
|
77 - if (mSentRedirect1Begin && NS_SUCCEEDED(result)) |
|
78 - NS_RUNTIMEABORT("Redirect succeeded"); |
|
79 - if (!mRedirectChannel) |
|
80 - NS_RUNTIMEABORT("Missing redirect channel"); |
|
81 - } |
|
82 - |
|
83 - mReceivedRedirect2Verify = true; |
|
84 - |
|
85 mRedirectCallback->OnRedirectVerifyCallback(result); |
|
86 mRedirectCallback = nsnull; |
|
87 return true; |
|
88 } |
|
89 |
|
90 -// Bug 621446 investigation |
|
91 -#pragma GCC reset_options |
|
92 - |
|
93 bool |
|
94 HttpChannelParent::RecvDocumentChannelCleanup() |
|
95 { |
|
96 // From now on only using mAssociatedContentSecurity. Free everything else. |
|
97 mChannel = 0; // Reclaim some memory sooner. |
|
98 mCacheDescriptor = 0; // Else we'll block other channels reading same URI |
|
99 return true; |
|
100 } |
|
101 @@ -583,24 +555,18 @@ HttpChannelParent::StartRedirect(PRUint3 |
|
102 |
|
103 nsHttpChannel *httpChan = static_cast<nsHttpChannel *>(mChannel.get()); |
|
104 nsHttpResponseHead *responseHead = httpChan->GetResponseHead(); |
|
105 bool result = SendRedirect1Begin(newChannelId, |
|
106 IPC::URI(newURI), |
|
107 redirectFlags, |
|
108 responseHead ? *responseHead |
|
109 : nsHttpResponseHead()); |
|
110 - if (!result) { |
|
111 - // Bug 621446 investigation |
|
112 - mSentRedirect1BeginFailed = true; |
|
113 + if (!result) |
|
114 return NS_BINDING_ABORTED; |
|
115 - } |
|
116 - |
|
117 - // Bug 621446 investigation |
|
118 - mSentRedirect1Begin = true; |
|
119 |
|
120 // Result is handled in RecvRedirect2Verify above |
|
121 |
|
122 mRedirectChannel = newChannel; |
|
123 mRedirectCallback = callback; |
|
124 return NS_OK; |
|
125 } |
|
126 |
|
127 diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h |
|
128 --- a/netwerk/protocol/http/HttpChannelParent.h |
|
129 +++ b/netwerk/protocol/http/HttpChannelParent.h |
|
130 @@ -128,18 +128,14 @@ private: |
|
131 nsCOMPtr<nsIChannel> mRedirectChannel; |
|
132 nsCOMPtr<nsIAsyncVerifyRedirectCallback> mRedirectCallback; |
|
133 |
|
134 // state for combining OnStatus/OnProgress with OnDataAvailable |
|
135 // into one IPDL call to child. |
|
136 nsresult mStoredStatus; |
|
137 PRUint64 mStoredProgress; |
|
138 PRUint64 mStoredProgressMax; |
|
139 - |
|
140 - bool mSentRedirect1Begin : 1; |
|
141 - bool mSentRedirect1BeginFailed : 1; |
|
142 - bool mReceivedRedirect2Verify : 1; |
|
143 }; |
|
144 |
|
145 } // namespace net |
|
146 } // namespace mozilla |
|
147 |
|
148 #endif // mozilla_net_HttpChannelParent_h |
|