Closed Bug 1252565 Opened 9 years ago Closed 9 years ago

Make dom::WarningOnlyErrorReporter handle workers

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

(Whiteboard: btpp-active)

Attachments

(2 files, 1 obsolete file)

Now that we've done bug 1072144 we can do that.
Attached patch Make dom::WarningOnlyErrorReporter handle workers (obsolete) (deleted) β€” β€” Splinter Review
Attachment #8725361 - Flags: review?(bobbyholley)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8725361 [details] [diff] [review]
Make dom::WarningOnlyErrorReporter handle workers

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

::: dom/workers/RuntimeService.cpp
@@ +802,5 @@
>      NS_WARNING("Could not create new context!");
>      return nullptr;
>    }
>  
> +  JS_SetErrorReporter(aRuntime, WarningOnlyErrorReporter);

Per IRC discussion, I think we should let ScriptSettings take care of this.
Attachment #8725361 - Flags: review?(bobbyholley) → review-
Whiteboard: btpp-active
Attachment #8725386 - Flags: review?(bobbyholley)
Attachment #8725361 - Attachment is obsolete: true
Comment on attachment 8725386 [details] [diff] [review]
Make dom::WarningOnlyErrorReporter handle workers

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

::: xpcom/base/CycleCollectedJSRuntime.cpp
@@ +502,5 @@
>                                          LargeAllocationFailureCallback, this);
>    JS_SetContextCallback(mJSRuntime, ContextCallback, this);
>    JS_SetDestroyZoneCallback(mJSRuntime, XPCStringConvert::FreeZoneCache);
>    JS_SetSweepZoneCallback(mJSRuntime, XPCStringConvert::ClearZoneCache);
> +  JS_SetErrorReporter(mJSRuntime, MozCrashErrorReporter);

Add a comment here saying that XPCJSRuntime currently override this because we don't TakeOwnership everwhere on the main thread yet.
Attachment #8725386 - Flags: review?(bobbyholley) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/96580db9b356
Backed out along with the other things in the push for these failures in test_recusion.html: https://treeherder.mozilla.org/logviewer.html#?job_id=22804630&repo=mozilla-inbound

https://hg.mozilla.org/integration/mozilla-inbound/rev/9716b46f3b60
Flags: needinfo?(bzbarsky)
I also see this failure: https://treeherder.mozilla.org/logviewer.html#?job_id=22807509&repo=mozilla-inbound
Yep, the test_ctypes.xul fail is from this bug.  Will look into it.
That failure happens because we have a test for using ctypes from a worker.  And ctypes uses js::PrepareScriptEnvironmentAndInvoke, which will report exceptions itself if there is no script environment preparer.  And right now we only set up an environment preparer for XPCJSRuntime.

I'm going to push that up to CycleCollectedJSRuntime, I think.
Flags: needinfo?(bzbarsky)
Note that I made some changes to the EnvironmentPreparer::invoke() impl to support running it on non-main threads.  So it's not just a cut/paste job there...
Attachment #8725522 - Flags: review?(bobbyholley)
Attachment #8725522 - Flags: review?(bobbyholley) → review+
Out again in https://hg.mozilla.org/integration/mozilla-inbound/rev/d7608e766470 for windows build bustage:
https://treeherder.mozilla.org/logviewer.html#?job_id=22861702&repo=mozilla-inbound
Flags: needinfo?(bzbarsky)
Ugh, I suck.  I left in some debugging code...  Will reland with that taken out once the tree is reopened.
Flags: needinfo?(bzbarsky)
https://hg.mozilla.org/mozilla-central/rev/e0a06595b43c
https://hg.mozilla.org/mozilla-central/rev/a74dae924b1f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: