From 11d9c1df041821dabe7d97cef73bde90abe2e8c3 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 22 Nov 2012 16:35:18 -0500 Subject: [PATCH] Fix issue reported by Aurimas at http://forums.zotero.org/discussion/25058/?Focus=140039#Comment_140039 (broken by https://bugzilla.mozilla.org/show_bug.cgi?id=761620) --- chrome/content/zotero/xpcom/cookieSandbox.js | 24 ++++++++++++++++---- chrome/content/zotero/xpcom/http.js | 6 ++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/xpcom/cookieSandbox.js b/chrome/content/zotero/xpcom/cookieSandbox.js index e17a7423f..20d0f7e89 100755 --- a/chrome/content/zotero/xpcom/cookieSandbox.js +++ b/chrome/content/zotero/xpcom/cookieSandbox.js @@ -102,7 +102,8 @@ Zotero.CookieSandbox.prototype = { * @param {nsIInterfaceRequestor} ir */ "attachToInterfaceRequestor": function(ir) { - Zotero.CookieSandbox.Observer.trackedInterfaceRequestors.set(ir.QueryInterface(Components.interfaces.nsIInterfaceRequestor), this); + Zotero.CookieSandbox.Observer.trackedInterfaceRequestors.push(Components.utils.getWeakReference(ir.QueryInterface(Components.interfaces.nsIInterfaceRequestor))); + Zotero.CookieSandbox.Observer.trackedInterfaceRequestorSandboxes.push(this); } } @@ -125,7 +126,8 @@ Zotero.CookieSandbox.Observer = new function() { */ this.register = function(CookieSandbox) { this.trackedBrowsers = new WeakMap(); - this.trackedInterfaceRequestors = new WeakMap(); + this.trackedInterfaceRequestors = []; + this.trackedInterfaceRequestorSandboxes = []; if(!observing) { Zotero.debug("CookieSandbox: Registering observers"); @@ -145,8 +147,22 @@ Zotero.CookieSandbox.Observer = new function() { // try the notification callbacks if(notificationCallbacks) { - trackedBy = this.trackedInterfaceRequestors.get(notificationCallbacks); - if(trackedBy) { + for(var i=0; i