Closed Bug 910924 Opened 11 years ago Closed 11 years ago

Give workers an nsIGlobalObject

Categories

(Core :: DOM: Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: khuey, Assigned: khuey)

References

Details

Attachments

(1 file)

No description provided.
Attached patch Patch (deleted) — Splinter Review
This breaks the inheritance chain since you can't do much useful with a principal on a worker thread anyways. If you want a principal you really need to get the WorkerPrivate and do specialized stuff.
Attachment #797522 - Flags: review?(bent.mozilla)
Attachment #797522 - Flags: review?(bobbyholley+bmo)
Comment on attachment 797522 [details] [diff] [review] Patch Review of attachment 797522 [details] [diff] [review]: ----------------------------------------------------------------- Looks great. I'm surprised it was so easy. ::: content/events/src/nsDOMDataTransfer.cpp @@ +492,5 @@ > nsresult rv = NS_OK; > nsIScriptContext* c = pt->GetContextForEventHandlers(&rv); > NS_ENSURE_TRUE(c && NS_SUCCEEDED(rv), NS_ERROR_DOM_SECURITY_ERR); > + nsIGlobalObject* go = c->GetGlobalObject(); > + NS_ENSURE_TRUE(go, NS_ERROR_DOM_SECURITY_ERR); I don't think this should be NS_ERROR_DOM_SECURITY_ERR. ::: dom/base/nsIScriptGlobalObject.h @@ +9,5 @@ > > #include "nsISupports.h" > #include "nsEvent.h" > #include "nsIGlobalObject.h" > +#include "nsIScriptObjectPrincipal.h" As noted on IRC, I don't think we need this.
Attachment #797522 - Flags: review?(bobbyholley+bmo) → review+
Comment on attachment 797522 [details] [diff] [review] Patch Review of attachment 797522 [details] [diff] [review]: ----------------------------------------------------------------- r=me on dom/workers changes
Attachment #797522 - Flags: review?(bent.mozilla) → review+
(In reply to Bobby Holley (:bholley) from comment #2) > Comment on attachment 797522 [details] [diff] [review] > Patch > > Review of attachment 797522 [details] [diff] [review]: > ----------------------------------------------------------------- > > Looks great. I'm surprised it was so easy. > > ::: content/events/src/nsDOMDataTransfer.cpp > @@ +492,5 @@ > > nsresult rv = NS_OK; > > nsIScriptContext* c = pt->GetContextForEventHandlers(&rv); > > NS_ENSURE_TRUE(c && NS_SUCCEEDED(rv), NS_ERROR_DOM_SECURITY_ERR); > > + nsIGlobalObject* go = c->GetGlobalObject(); > > + NS_ENSURE_TRUE(go, NS_ERROR_DOM_SECURITY_ERR); > > I don't think this should be NS_ERROR_DOM_SECURITY_ERR. Everything else in that methods returns NS_ERROR_DOM_SECURITY_ERR, so I left it. > ::: dom/base/nsIScriptGlobalObject.h > @@ +9,5 @@ > > > > #include "nsISupports.h" > > #include "nsEvent.h" > > #include "nsIGlobalObject.h" > > +#include "nsIScriptObjectPrincipal.h" > > As noted on IRC, I don't think we need this. Fixed.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: