Closed Bug 1485427 Opened 6 years ago Closed 6 years ago

Add two assertions ensuring that http-on-*request observers are (not) fired at the right times

Categories

(Core :: Networking: HTTP, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

Details

(Whiteboard: [necko-triaged])

Attachments

(2 files)

      No description provided.
Component: Networking → Networking: HTTP
Priority: -- → P3
Summary: Add two assertions ensuring that request observers are (not) fired at the right times → Add two assertions ensuring that http-on-*request observers are (not) fired at the right times
Whiteboard: [necko-triaged]
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Comment on attachment 9003220 [details] [diff] [review]
Add two assertions ensuring that request observers are (not) fired at the right times

Review of attachment 9003220 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/protocol/http/nsHttpChannel.cpp
@@ +6042,5 @@
>      // Note that running these observers can itself result in the channel
>      // being canceled.  In that case, we accept that cancelation code as
>      // the cause of the cancelation, as if the classification of the channel
>      // would have occurred past this point!
> +    MOZ_ASSERT(!mRequestObserversCalled);

please put this inside CallOnModifyRequestObservers()
Attachment #9003220 - Flags: review?(honzab.moz) → review-
and note that needs a full try run before landing.
Comment on attachment 9003239 [details] [diff] [review]
Add two assertions ensuring that request observers are (not) fired at the right times

Review of attachment 9003239 [details] [diff] [review]:
-----------------------------------------------------------------

thanks!
Attachment #9003239 - Flags: review?(honzab.moz) → review+
This assertion fires all over the place <https://treeherder.mozilla.org/#/jobs?repo=try&revision=4547cfaf9bcdd3acfa18ff306aefc5531072d9a6> from this call site:

https://searchfox.org/mozilla-central/rev/f2ac80ab7dbde5400a3400d463e07331194dec94/netwerk/protocol/http/nsHttpChannel.cpp#8174

Do you suggest resetting mRequestObserversCalled to false before calling CallOnModifyRequestObservers() there, given that we're effectively retrying there?
Flags: needinfo?(honzab.moz)
(In reply to :Ehsan Akhgari from comment #6)
> This assertion fires all over the place
> <https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=4547cfaf9bcdd3acfa18ff306aefc5531072d9a6> from this
> call site:
> 
> https://searchfox.org/mozilla-central/rev/
> f2ac80ab7dbde5400a3400d463e07331194dec94/netwerk/protocol/http/nsHttpChannel.
> cpp#8174
> 
> Do you suggest resetting mRequestObserversCalled to false before calling
> CallOnModifyRequestObservers() there, given that we're effectively retrying
> there?

Yes!  Thanks.
Flags: needinfo?(honzab.moz)
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5d6bf0312e08
Add two assertions ensuring that request observers are (not) fired at the right times; r=mayhemer
https://hg.mozilla.org/mozilla-central/rev/5d6bf0312e08
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: