Closed Bug 763704 Opened 12 years ago Closed 6 years ago

DOMRequest callbacks should fire for launched mozApp

Categories

(Core Graveyard :: DOM: Apps, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mdas, Unassigned)

Details

In Gaia, we call launch() on the App, and get back a DOMRequest, but it doesn't fire the callbacks. For example, running something like this in the content space:

window.wrappedJSObject.appscreen.getAppByOrigin('http://calculator.gaiamobile.org').launch();

returns a DOMRequest object, but if I do:


window.wrappedJSObject.appscreen.getAppByOrigin('http://calculator.gaiamobile.org').launch(.onsuccess = function(){alert('App is launched!');};

The callback will never fire.
erm, weird typo:

window.wrappedJSObject.appscreen.getAppByOrigin('http://calculator.gaiamobile.org').launch().onsuccess = function(){alert('App is launched!');};
Does launch() return a new object?

Can that object get GCed?
(In reply to Boris Zbarsky (:bz) from comment #2)
> Does launch() return a new object?
> 
> Can that object get GCed?

Yes, it returns a DOMRequest.
That doesn't answer my second question.  Can you point me to the launch() implementation, please?
It's there:
http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.js#238 which uses http://mxr.mozilla.org/mozilla-central/source/dom/base/DOMRequestHelper.jsm#94 to create the DOMRequest using the DOMRequestService.

The cause for the problem reported is known, we return the request object but never fire .onsuccess or .onerror on it.
Looking through that code, it looks at first glance like nothing holds on to the request, so can never fire an event on it, yeah....
We hold on to the request when calling getRequestId(). But even if we can fire events, we don't.
Blocks: 746465
No longer blocks: 746465
Component: DOM: Mozilla Extensions → DOM: Apps
Product: Core → Core Graveyard
Core Graveyard / DOM: Apps is inactive. Closing all bugs in this component.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.