Closed
Bug 786303
Opened 12 years ago
Closed 11 years ago
Use the manifestURL in WebApps notifications instead of the origin
Categories
(Core Graveyard :: DOM: Apps, defect)
Core Graveyard
DOM: Apps
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla25
People
(Reporter: mounir, Assigned: fabrice)
References
Details
Attachments
(1 file, 4 obsolete files)
7.67 KB,
patch
|
fabrice
:
review+
|
Details | Diff | Splinter Review |
We should use manifestURL instead of origin and update getAppFromObserverMessage in nsIAppsService. If needed, we could even remove that method and have callers call getAppByManifestURL.
Comment 1•11 years ago
|
||
Attachment #778174 -
Flags: review?(fabrice)
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 778174 [details] [diff] [review]
Patch
Review of attachment 778174 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/push/src/PushService.jsm
@@ +344,5 @@
> }
> break;
> case "webapps-uninstall":
> debug("webapps-uninstall");
> + let manifestURL = aData.manifestURL;
aData is a string, so this will not work. You need to parse it as JSON first.
@@ +349,3 @@
> let appsService = Cc["@mozilla.org/AppsService;1"]
> .getService(Ci.nsIAppsService);
> + var app = appsService.getAppByManifestURL(manifestURL);
I know this is not your fault, but s/var/let.
Attachment #778174 -
Flags: review?(fabrice) → review-
Comment 4•11 years ago
|
||
(In reply to Fabrice Desré [:fabrice] from comment #3)
> aData is a string, so this will not work. You need to parse it as JSON first.
Oh, I didn't notice that because two lines after there was "aData.origin".
Attachment #778174 -
Attachment is obsolete: true
Attachment #778989 -
Flags: review?(fabrice)
Updated•11 years ago
|
Attachment #778989 -
Attachment is patch: true
Assignee | ||
Comment 5•11 years ago
|
||
Comment on attachment 778989 [details] [diff] [review]
Patch v2
Review of attachment 778989 [details] [diff] [review]:
-----------------------------------------------------------------
We're almost there!
::: dom/push/src/PushService.jsm
@@ +344,5 @@
> }
> break;
> case "webapps-uninstall":
> debug("webapps-uninstall");
> + let data = JSON.parse(aData);
that can throw.
@@ +350,3 @@
> let appsService = Cc["@mozilla.org/AppsService;1"]
> .getService(Ci.nsIAppsService);
> + if (!appsService.getAppByManifestURL(manifestURL)) {
Since you don't use the app afterward, use getAppLocalIdByManifestURL to not create a useless app object.
Attachment #778989 -
Flags: review?(fabrice) → review-
Comment 6•11 years ago
|
||
Attachment #778989 -
Attachment is obsolete: true
Attachment #779277 -
Flags: review?(fabrice)
Updated•11 years ago
|
Attachment #778175 -
Attachment is obsolete: true
Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 779277 [details] [diff] [review]
Patch v3
Review of attachment 779277 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/push/src/PushService.jsm
@@ +350,5 @@
> + data = JSON.parse(aData);
> + } catch (ex) {
> + debug("webapps-uninstall: JSON parsing error: " + aData);
> + return;
> + }
Nit: blank line after }
@@ +356,3 @@
> let appsService = Cc["@mozilla.org/AppsService;1"]
> .getService(Ci.nsIAppsService);
> + if (!appsService.getAppLocalIdByManifestURL(manifestURL)) {
getAppLocalIdByManifestURL will return Ci.nsIScriptSecurityManager.NO_APP_ID when failing, not null (see https://mxr.mozilla.org/mozilla-central/source/dom/apps/src/AppsUtils.jsm#121)
Attachment #779277 -
Flags: review?(fabrice) → review-
Comment 8•11 years ago
|
||
Attachment #779277 -
Attachment is obsolete: true
Attachment #779490 -
Flags: review?(fabrice)
Assignee | ||
Updated•11 years ago
|
Attachment #779490 -
Flags: review?(fabrice) → review+
Updated•11 years ago
|
Keywords: checkin-needed
Comment 9•11 years ago
|
||
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Updated•7 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•