mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 891218 (part 1) - avoid using a DOM document in updateProvider - r=mixedpuppy
This commit is contained in:
parent
c5d7f1b1d8
commit
ad8fb74446
@ -651,13 +651,14 @@ this.SocialService = {
|
||||
* have knowledge of the currently selected provider here, we will notify
|
||||
* the front end to deal with any reload.
|
||||
*/
|
||||
updateProvider: function(aDOMDocument, aManifest, aCallback) {
|
||||
let installOrigin = aDOMDocument.nodePrincipal.origin;
|
||||
let installType = this.getOriginActivationType(installOrigin);
|
||||
updateProvider: function(aUpdateOrigin, aManifest, aCallback) {
|
||||
let originUri = Services.io.newURI(aUpdateOrigin, null, null);
|
||||
let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(originUri);
|
||||
let installType = this.getOriginActivationType(aUpdateOrigin);
|
||||
// if we get data, we MUST have a valid manifest generated from the data
|
||||
let manifest = this._manifestFromData(installType, aManifest, aDOMDocument.nodePrincipal);
|
||||
let manifest = this._manifestFromData(installType, aManifest, principal);
|
||||
if (!manifest)
|
||||
throw new Error("SocialService.installProvider: service configuration is invalid from " + installOrigin);
|
||||
throw new Error("SocialService.installProvider: service configuration is invalid from " + aUpdateOrigin);
|
||||
|
||||
// overwrite the preference
|
||||
let string = Cc["@mozilla.org/supports-string;1"].
|
||||
|
@ -56,8 +56,8 @@ WorkerAPI.prototype = {
|
||||
"social.manifest-set": function(data) {
|
||||
// the provider will get reloaded as a result of this call
|
||||
let SocialService = Cu.import("resource://gre/modules/SocialService.jsm", {}).SocialService;
|
||||
let document = this._port._window.document;
|
||||
SocialService.updateProvider(document, data);
|
||||
let origin = this._provider.origin;
|
||||
SocialService.updateProvider(origin, data);
|
||||
},
|
||||
"social.reload-worker": function(data) {
|
||||
getFrameWorkerHandle(this._provider.workerURL, null)._worker.reload();
|
||||
|
Loading…
Reference in New Issue
Block a user