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.
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 #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+
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+
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: