Closed
Bug 1251697
Opened 9 years ago
Closed 9 years ago
Change worker XHR sync runnables to propagate exceptions via an ErrorResult, not JSContext
Categories
(Core :: DOM: Workers, defect)
Core
DOM: Workers
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
(Whiteboard: btpp-active)
Attachments
(3 files, 1 obsolete file)
18.11 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
2.53 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
11.71 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
We need this so we can report exceptions between WorkerRun and PostRun in WorkerRunnable::Run.
![]() |
Assignee | |
Comment 1•9 years ago
|
||
Attachment #8724161 -
Flags: review?(khuey)
![]() |
Assignee | |
Comment 2•9 years ago
|
||
Attachment #8724162 -
Flags: review?(khuey)
![]() |
Assignee | |
Comment 3•9 years ago
|
||
Attachment #8724163 -
Flags: review?(khuey)
Updated•9 years ago
|
Whiteboard: btpp-active
Comment on attachment 8724161 [details] [diff] [review]
part 1. Thread an ErrorResult reference through the worker XHR WorkerThreadProxySyncRunnable implementations
Review of attachment 8724161 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/workers/XMLHttpRequest.cpp
@@ +182,5 @@
> RefPtr<Proxy> mProxy;
> nsCOMPtr<nsIEventTarget> mSyncLoopTarget;
> + // mRv is set on the worker thread by the constructor. Must not be touched on
> + // the main thread, except for copying the reference to the ResponseRunnable.
> + ErrorResult& mRv;
private, please. Having a reference to stack memory of another thread is a bit disconcerting, best to keep it as locked down as possible.
Attachment #8724161 -
Flags: review?(khuey) → review+
![]() |
Assignee | |
Comment 5•9 years ago
|
||
Attachment #8724240 -
Flags: review?(khuey)
![]() |
Assignee | |
Updated•9 years ago
|
Attachment #8724162 -
Attachment is obsolete: true
Attachment #8724162 -
Flags: review?(khuey)
Comment on attachment 8724240 [details] [diff] [review]
Part 2 adjusted to eliminate issues with the exception on the ErrorResult being clobbered
Review of attachment 8724240 [details] [diff] [review]:
-----------------------------------------------------------------
Your commit message is missing some words.
::: dom/workers/XMLHttpRequest.cpp
@@ +240,5 @@
> mSyncLoopTarget = syncLoop.EventTarget();
>
> if (NS_FAILED(NS_DispatchToMainThread(this))) {
> + mRv.Throw(NS_ERROR_FAILURE);
> + return;
Honestly I'd rather just MOZ_CRASH here.
Attachment #8724240 -
Flags: review?(khuey) → review+
Attachment #8724163 -
Flags: review?(khuey) → review+
![]() |
Assignee | |
Comment 7•9 years ago
|
||
> private, please.
Done, as part of part 2 to avoid compiler warnings about unused private members.
> Honestly I'd rather just MOZ_CRASH here.
Done.
![]() |
Assignee | |
Comment 8•9 years ago
|
||
> Your commit message is missing some words.
Added "::Dispatch".
Comment 10•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/97ce9810ffe6
https://hg.mozilla.org/mozilla-central/rev/f94ad4babe1d
https://hg.mozilla.org/mozilla-central/rev/e2d9ecda1acf
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•