Closed
Bug 1065452
Opened 11 years ago
Closed 11 years ago
Redirect errors that reach addon scope globals to their appropriate DOM window (if any)
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(2 files, 2 obsolete files)
|
1.93 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
|
3.74 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
This is causing orange when we try to flip the switch in bug 1030420. Thanks to the recent refactoring work I've done, this fix should be pretty straightforward, if a bit hacky. The hackiness will go away in bug 981187.
| Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8487274 -
Flags: review?(bzbarsky)
Comment 2•11 years ago
|
||
Comment on attachment 8487274 [details] [diff] [review]
Re-route exceptions directed at addon globals to their associated DOMWindow. v1
>+ // Note that they way we do this right now is sloppy. Error reporters can
s/they/the/
>+ if (!JS_GetPrototype(cx, global, &proto)) {
Could we have this "get window from addon global" code somewhere nearer the code that sets up the relationship?
r=me modulo that.
Attachment #8487274 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8488022 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8487274 -
Attachment is obsolete: true
Attachment #8488025 -
Flags: review+
| Assignee | ||
Updated•11 years ago
|
Attachment #8488022 -
Attachment description: Add an API to access the associated window of addon scopes. v1 → Part 1 - Add an API to access the associated window of addon scopes. v1
| Assignee | ||
Comment 5•11 years ago
|
||
Comment on attachment 8488022 [details] [diff] [review]
Part 1 - Add an API to access the associated window of addon scopes. v1
Valgrind found something wrong with this. Investigating.
Attachment #8488022 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 6•11 years ago
|
||
| Assignee | ||
Comment 7•11 years ago
|
||
| Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8488022 -
Attachment is obsolete: true
Attachment #8489122 -
Flags: review?(wmccloskey)
Comment on attachment 8489122 [details] [diff] [review]
Part 1 - Add an API to access the associated window of addon scopes. v3
Review of attachment 8489122 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/xpconnect/src/XPCJSRuntime.cpp
@@ +588,5 @@
> + // we pretty much just want to crash if that happens so that we find out
> + // about it and get them to change their code.
> + MOZ_RELEASE_ASSERT(js::IsCrossCompartmentWrapper(proto));
> + JSObject *mainGlobal = js::UncheckedUnwrap(proto, /* stopAtOuter = */ false);
> + MOZ_RELEASE_ASSERT(JS_IsGlobalObject(mainGlobal));
I guess it's too much trouble to iterate over mAddonScopes. That seems fine to me.
Perhaps eventually we could change mAddonScopes to a lazily created hashtable rather than a list.
Attachment #8489122 -
Flags: review?(wmccloskey) → review+
| Assignee | ||
Comment 10•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e32c121d2bb3
https://hg.mozilla.org/mozilla-central/rev/e934ae44e2a7
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Depends on: 1068164
You need to log in
before you can comment on or make changes to this bug.
Description
•