Open
Bug 890364
Opened 11 years ago
Updated 2 years ago
Allow defining WebIDL constructor objects on non-global objects
Categories
(Core :: DOM: Core & HTML, defect, P5)
Core
DOM: Core & HTML
Tracking
()
NEW
People
(Reporter: Ms2ger, Unassigned)
References
(Blocks 1 open bug)
Details
IndexedDatabaseManager::InitWindowless needs this.
Comment 1•11 years ago
|
||
Both GetProtoObject and GetConstructorObject need to be changed here.
Comment 2•11 years ago
|
||
So, I tried to take a stab at it. The problem is that CreateInterfaceObjects also uses the iface/proto cache and I have a very hard time understanding the codegen parts enough to be able to change it with any level of confidence...
I guess we need bz/peterv's help here.
Flags: needinfo?(peterv)
Flags: needinfo?(bzbarsky)
Comment 3•11 years ago
|
||
Why do we want to define these on non-global objects? AFAICT IndexedDatabaseManager::InitWindowless is usually called on global objects right now. Eventually we should just expose all DOM interface objects on the global object of components anyway.
Flags: needinfo?(peterv)
Comment 4•11 years ago
|
||
(In reply to comment #3)
> Why do we want to define these on non-global objects? AFAICT
> IndexedDatabaseManager::InitWindowless is usually called on global objects
> right now. Eventually we should just expose all DOM interface objects on the
> global object of components anyway.
I think the summary for this bug is misleading. We're talking about non-window/worker globals, presumbaly things like the globals in jsm's, etc.
Comment 5•11 years ago
|
||
Worker globals already work. JSM globals should just work given that they're using XPCONNECT_GLOBAL_FLAGS. What's the exact problem that we're trying to solve?
Comment 6•11 years ago
|
||
Well, in that case, initWindowless() should not be needed at all, right?
Flags: needinfo?(bent.mozilla)
Comment 7•11 years ago
|
||
In particular, if you add this interface to the list at the end of nsXPConnect::InitClassesWithNewWrappedGlobal that will expose the constructor on all xpconnect globals; then the constructor can check whether the global it's given is a Window.
Flags: needinfo?(bzbarsky)
Comment 8•11 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #4)
> I think the summary for this bug is misleading. We're talking about
> non-window/worker globals, presumbaly things like the globals in jsm's, etc.
What is the difference between this bug and bug 859901?
Reporter | ||
Comment 9•11 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #4)
> (In reply to comment #3)
> > Why do we want to define these on non-global objects? AFAICT
> > IndexedDatabaseManager::InitWindowless is usually called on global objects
> > right now. Eventually we should just expose all DOM interface objects on the
> > global object of components anyway.
>
> I think the summary for this bug is misleading. We're talking about
> non-window/worker globals, presumbaly things like the globals in jsm's, etc.
That's not what I'm talking about. The API we have now allows passing any object to IndexedDatabaseManager::InitWindowless. If we want to break that, fine; otherwise we need to allow that.
I don't know if we want to keep this behavior or not. It's modeled after Components.utils.import, allowing you to define the IDB stuff on a temporary object that then gets throw away or something. I imagine most consumers still pass the global anyway so it might not matter. Let's not worry about this for now, we can always swing back around and do this later.
Flags: needinfo?(bent.mozilla)
Comment 11•11 years ago
|
||
(In reply to comment #10)
> I don't know if we want to keep this behavior or not. It's modeled after
> Components.utils.import, allowing you to define the IDB stuff on a temporary
> object that then gets throw away or something. I imagine most consumers still
> pass the global anyway so it might not matter. Let's not worry about this for
> now, we can always swing back around and do this later.
If we expose the necessary IDB interfaces on the global object, breaking that behavior sounds like a feature to me!
Reporter | ||
Comment 12•11 years ago
|
||
Turns out that B2G feels like it needs this: https://tbpl.mozilla.org/php/getParsedLog.php?id=26040134&tree=Try
Comment 13•11 years ago
|
||
(In reply to comment #12)
> Turns out that B2G feels like it needs this:
> https://tbpl.mozilla.org/php/getParsedLog.php?id=26040134&tree=Try
Well, that's just this code: http://mxr.mozilla.org/mozilla-central/source/dom/activities/src/ActivitiesService.jsm#42
Can't we just remove that?
Comment 14•11 years ago
|
||
Indeed, that's passing a global object to initWindowless. So as long as that global has the relevant bits already, there should be no problem.
Comment 15•11 years ago
|
||
What's the status and next steps here now?
Comment 16•11 years ago
|
||
Renaming the bug summary to something like "Kill IndexedDatabaseManager::InitWindowless()"?
Comment 17•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046
Move all DOM bugs that haven't been updated in more than 3 years and has no one currently assigned to P5.
If you have questions, please contact :mdaly.
Priority: -- → P5
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•