Bug 658876 - nsHttpChannel.mAsyncOpenTime should be set after mLoadGroup->AddRequest, r=cbiesinger

This commit is contained in:
Honza Bambas 2011-05-23 16:38:24 +02:00
parent c4d414dff8
commit 44b47c4de7

View File

@ -3651,9 +3651,6 @@ nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
if (mCanceled)
return mStatus;
if (mTimingEnabled)
mAsyncOpenTime = mozilla::TimeStamp::Now();
rv = NS_CheckPortSafety(mURI);
if (NS_FAILED(rv))
return rv;
@ -3700,6 +3697,12 @@ nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
if (mLoadGroup)
mLoadGroup->AddRequest(this, nsnull);
// Collect mAsyncOpenTime after we have called all obsrevers like
// "http-on-modify-request" and load group observers that may set
// mTimingEnabled flag.
if (mTimingEnabled)
mAsyncOpenTime = mozilla::TimeStamp::Now();
// We may have been cancelled already, either by on-modify-request
// listeners or by load group observers; in that case, we should
// not send the request to the server