Closed Bug 1276400 Opened 3 years ago Closed 3 years ago

Eliminate Gecko consumers of the dontReportUncaught JSContext option

Categories

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

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

(Whiteboard: btpp-active)

Attachments

(4 files)

This option is only checked in one place: ~AutoLastFrameCheck().  This also checks autoJSAPIOwnsErrorReporting.  Since AutoJSAPI/AutoEntryScript always set this latter option, there is no point setting dontReportUncaught anywhere we're using AutoJSAPI/AutoEntryScript... which should be everywhere.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Whiteboard: btpp-active
Attachment #8757554 - Flags: review?(bkelly) → review+
Attachment #8757555 - Flags: review?(bkelly) → review+
Comment on attachment 8757556 [details] [diff] [review]
part 3.  Stop setting the dontReportUncaught option in IPC code, since we're working with an AutoJSAPI there

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

::: js/ipc/WrapperAnswer.cpp
@@ -410,5 @@
>  
>      RootedValue rval(cx);
>      {
> -        AutoSaveContextOptions asco(cx);
> -        ContextOptionsRef(cx).setDontReportUncaught(true);

Should this assert that its an AutoJSAPI like we did in Promise.cpp?  Or is there a test for this? I know that the context is defined in the same method here, but someone might not realize that we're depending on the AutoJSAPI to avoid error reporting.
Attachment #8757556 - Flags: review?(bkelly) → review+
Attachment #8757557 - Flags: review?(bkelly) → review+
> but someone might not realize that we're depending on the AutoJSAPI to avoid error reporting.

Really, we're working on removing this "owns error reporting" flag, because it's about to become the only possible behavior.  I can add an assert, but it wouldn't hang out for very long...
I did add the assert.
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5ae227cd2b5d
part 1.  Get rid of AutoDontReportUncaught and its one consumer.  r=bkelly
https://hg.mozilla.org/integration/mozilla-inbound/rev/2c74e35ddd1e
part 2.  Stop setting the dontReportUncaught option on the worker JSContext, since workers should be using AutoJSAPI/AutoEntryScript for everything.  r=bkelly
https://hg.mozilla.org/integration/mozilla-inbound/rev/2abd1b50f673
part 3.  Stop setting the dontReportUncaught option in IPC code, since we're working with an AutoJSAPI there.  r=bkelly
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d46836853cd
part 4.  Stop setting dontReportUncaught in XPConnect code, since all consumers got their JSContext from an AutoEntryScript or AutoJSAPI.  r=bkelly
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.