[Pkg-mozext-commits] [personasplus] 06/76: Remove Cookie-Changed Observer (#37)

David Prévot taffit at moszumanska.debian.org
Fri Aug 4 21:45:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository personasplus.

commit 2661b2f622e0b1ecb9f82ff939850bfeffce726d
Author: derinb <baris at barisderin.com>
Date:   Thu Jul 14 12:07:36 2016 +0300

    Remove Cookie-Changed Observer (#37)
    
    Remove Cookie-Changed Observer
---
 extension/modules/service.js | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/extension/modules/service.js b/extension/modules/service.js
index 835cbe9..8b5857d 100644
--- a/extension/modules/service.js
+++ b/extension/modules/service.js
@@ -137,12 +137,6 @@ var PersonaService = {
 
         // Observe quit so we can destroy ourselves.
         Observers.add("quit-application", this.onQuitApplication, this);
-        // Observe the "cookie-changed" topic to load the favorite personas when
-        // the user signs in.
-        if (false)
-        // Skip this for now, since AMO session cookies are not currently
-        // cooperative
-            Observers.add("cookie-changed", this.onCookieChanged, this);
         // Observe the "lightweight-theme-changed" to sync the add-on with the
         // lightweight theme manager.
         Observers.add("lightweight-theme-changed",
@@ -254,7 +248,6 @@ var PersonaService = {
     },
 
     _destroy: function() {
-        Observers.remove("cookie-changed", this.onCookieChanged, this);
         Observers.remove("lightweight-theme-changed",
             this.onLightweightThemeChanged, this);
         Observers.remove("http-on-examine-response", this.onHTTPResponse, this);
@@ -1332,27 +1325,6 @@ var PersonaService = {
     },
 
     /**
-     * Monitors changes in cookies. If the modified cookie is the Personas session
-     * cookie, then the favorites are refreshed (if the user is signed in).
-     * @param aCookie The cookie that has been added, changed or removed.
-     */
-    onCookieChanged: function(aCookie, aChange) {
-        if (aCookie instanceof Ci.nsICookie) {
-            if (aCookie.name == "sessionid" && (aCookie.host == this.addonsHost ||
-                    aCookie.host == "." + this.addonsHost)) {
-                if (aCookie.value == this._cookieValue)
-                    return;
-                this._cookieValue = aCookie.value;
-                this.refreshFavorites();
-            }
-        } else if (aCookie instanceof Ci.nsIArray) {
-            for (let enum_ = aCookie.enumerate(); enum_.hasMoreElements();)
-                this.onCookieChanged(enum_.getNext());
-        }
-    },
-    _cookieValue: null,
-
-    /**
      * Monitors HTTP responses so that we can heuristically detect logins
      * and logouts.
      * @param aRequest The HTTP request

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/personasplus.git



More information about the Pkg-mozext-commits mailing list