Closed
Bug 850247
Opened 12 years ago
Closed 12 years ago
Remove Off-Main-Thread XPCWrappedJS refcounting from nsRequestObserverProxy
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(3 files)
|
6.24 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
|
13.92 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
|
4.71 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•12 years ago
|
||
I'm doing this so that I can safely make this class use nsMainThreadPtr{Handle,Holder}.
There's no theoretical reason why we couldn't support other threads here, but it
would mean implementing that functionality in the PtrHolders, renaming them, and
weakening their assertions/invariants. AFAICT the consumers here don't actually have
a reason to proxy events anywhere but the main thread, so I'm just going to do this
rather than writing code to support something that we don't do (and thus can't test).
Attachment #723985 -
Flags: review?(mcmanus)
| Assignee | ||
Comment 2•12 years ago
|
||
Both the consumers just do this manually. The context here is sometimes an
XPCWrappedJS, so passing it around with nsCOMPtrs off-main-thread can't
happen anymore.
We add assertions in OnStartRequest/OnStopRequest to catch any consumers
that might try to change contexts midstream.
Attachment #723986 -
Flags: review?(mcmanus)
| Assignee | ||
Comment 3•12 years ago
|
||
Attachment #723987 -
Flags: review?(mcmanus)
Comment 4•12 years ago
|
||
Comment on attachment 723985 [details] [diff] [review]
Part 1 - Make nsRequestObserverProxy proxy events to the main thread only. v1
Review of attachment 723985 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/base/public/nsIRequestObserverProxy.idl
@@ -21,5 @@
> /**
> * Initializes an nsIRequestObserverProxy.
> *
> * @param observer - receives observer notifications on the other thread
> - * @param target - may be NULL indicating the calling thread's event target
I think you need a uuid change?
update the documentation in the idl to indicate that this happens on main thread rather than "another thread" as it says now
r+ with that
Attachment #723985 -
Flags: review?(mcmanus) → review+
Comment 5•12 years ago
|
||
Comment on attachment 723986 [details] [diff] [review]
Part 2 - Make nsRequestObserverProxy hold onto its context. v1
Review of attachment 723986 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/base/public/nsIRequestObserverProxy.idl
@@ +17,2 @@
> */
> [scriptable, uuid(7df8845f-938a-4437-9ea4-b11b850048f1)]
uuid bump
Attachment #723986 -
Flags: review?(mcmanus) → review+
Comment 6•12 years ago
|
||
Comment on attachment 723987 [details] [diff] [review]
Part 3 - Move nsRequestObserverProxy to nsMainThreadPtr{Holder,Handle}. v1
Review of attachment 723987 [details] [diff] [review]:
-----------------------------------------------------------------
::: netwerk/base/src/nsRequestObserverProxy.cpp
@@ -118,5 @@
> -
> -nsRequestObserverProxy::~nsRequestObserverProxy()
> -{
> - if (mObserver) {
> - // order is crucial here... we must be careful to clear mObserver
deleting code like that just makes ya feel good :)
Attachment #723987 -
Flags: review?(mcmanus) → review+
| Assignee | ||
Comment 7•12 years ago
|
||
| Assignee | ||
Comment 8•12 years ago
|
||
Comment 9•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/0e02cd1e8d6f
https://hg.mozilla.org/mozilla-central/rev/02f9c504991c
https://hg.mozilla.org/mozilla-central/rev/5eb8548b4582
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in
before you can comment on or make changes to this bug.
Description
•