Bug 621446 - investigation bug for crash at RecvRedirect2Verify, r=jduell

This commit is contained in:
Honza Bambas 2012-01-13 16:36:03 +01:00
Родитель 12e87967a3
Коммит 347fadfbde
2 изменённых файлов: 39 добавлений и 1 удалений

Просмотреть файл

@ -57,6 +57,7 @@
#include "nsIApplicationCacheService.h" #include "nsIApplicationCacheService.h"
#include "nsIOfflineCacheUpdate.h" #include "nsIOfflineCacheUpdate.h"
#include "nsIRedirectChannelRegistrar.h" #include "nsIRedirectChannelRegistrar.h"
#include "prinit.h"
namespace mozilla { namespace mozilla {
namespace net { namespace net {
@ -67,6 +68,9 @@ HttpChannelParent::HttpChannelParent(PBrowserParent* iframeEmbedding)
, mStoredProgress(0) , mStoredProgress(0)
, mStoredProgressMax(0) , mStoredProgressMax(0)
, mHeadersToSyncToChild(nsnull) , mHeadersToSyncToChild(nsnull)
, mSentRedirect1Begin(false)
, mSentRedirect1BeginFailed(false)
, mReceviedRedirect2Verify(false)
{ {
// Ensure gHttpHandler is initialized: we need the atom table up and running. // Ensure gHttpHandler is initialized: we need the atom table up and running.
nsIHttpProtocolHandler* handler; nsIHttpProtocolHandler* handler;
@ -329,6 +333,11 @@ HttpChannelParent::RecvUpdateAssociatedContentSecurity(const PRInt32& high,
return true; return true;
} }
// Bug 621446 investigation, we don't want conditional PR_Aborts bellow to be
// merged to a single address.
#pragma warning(disable : 4068)
#pragma GCC optimize ("O0")
bool bool
HttpChannelParent::RecvRedirect2Verify(const nsresult& result, HttpChannelParent::RecvRedirect2Verify(const nsresult& result,
const RequestHeaderTuples& changedHeaders) const RequestHeaderTuples& changedHeaders)
@ -346,11 +355,30 @@ HttpChannelParent::RecvRedirect2Verify(const nsresult& result,
} }
} }
if (!mRedirectCallback) {
// Bug 621446 investigation (optimization turned off above)
if (mReceviedRedirect2Verify)
::PR_Abort();
if (mSentRedirect1BeginFailed)
::PR_Abort();
if (mSentRedirect1Begin && NS_FAILED(result))
::PR_Abort();
if (mSentRedirect1Begin && NS_SUCCEEDED(result))
::PR_Abort();
if (!mRedirectChannel)
::PR_Abort();
}
mReceviedRedirect2Verify = true;
mRedirectCallback->OnRedirectVerifyCallback(result); mRedirectCallback->OnRedirectVerifyCallback(result);
mRedirectCallback = nsnull; mRedirectCallback = nsnull;
return true; return true;
} }
// Bug 621446 investigation
#pragma GCC reset_options
bool bool
HttpChannelParent::RecvDocumentChannelCleanup() HttpChannelParent::RecvDocumentChannelCleanup()
{ {
@ -568,8 +596,14 @@ HttpChannelParent::StartRedirect(PRUint32 newChannelId,
redirectFlags, redirectFlags,
responseHead ? *responseHead responseHead ? *responseHead
: nsHttpResponseHead()); : nsHttpResponseHead());
if (!result) if (!result) {
// Bug 621446 investigation
mSentRedirect1BeginFailed = true;
return NS_BINDING_ABORTED; return NS_BINDING_ABORTED;
}
// Bug 621446 investigation
mSentRedirect1Begin = true;
// Result is handled in RecvRedirect2Verify above // Result is handled in RecvRedirect2Verify above

Просмотреть файл

@ -138,6 +138,10 @@ private:
// used while visiting headers, to send them to child: else null // used while visiting headers, to send them to child: else null
RequestHeaderTuples *mHeadersToSyncToChild; RequestHeaderTuples *mHeadersToSyncToChild;
bool mSentRedirect1Begin : 1;
bool mSentRedirect1BeginFailed : 1;
bool mReceivedRedirect2Verify : 1;
}; };
} // namespace net } // namespace net