toolkit/components/url-classifier/nsUrlClassifierListManager.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 # This Source Code Form is subject to the terms of the Mozilla Public
     2 # License, v. 2.0. If a copy of the MPL was not distributed with this
     3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 const Cc = Components.classes;
     6 const Ci = Components.interfaces;
     8 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
    10 #include ./content/listmanager.js
    12 var modScope = this;
    13 function Init() {
    14   // Pull the library in.
    15   var jslib = Cc["@mozilla.org/url-classifier/jslib;1"]
    16               .getService().wrappedJSObject;
    17   Function.prototype.inherits = jslib.Function.prototype.inherits;
    18   modScope.G_Preferences = jslib.G_Preferences;
    19   modScope.G_PreferenceObserver = jslib.G_PreferenceObserver;
    20   modScope.G_ObserverServiceObserver = jslib.G_ObserverServiceObserver;
    21   modScope.G_Debug = jslib.G_Debug;
    22   modScope.G_Assert = jslib.G_Assert;
    23   modScope.G_debugService = jslib.G_debugService;
    24   modScope.G_Alarm = jslib.G_Alarm;
    25   modScope.BindToObject = jslib.BindToObject;
    26   modScope.PROT_XMLFetcher = jslib.PROT_XMLFetcher;
    27   modScope.RequestBackoff = jslib.RequestBackoff;
    29   // We only need to call Init once.
    30   modScope.Init = function() {};
    31 }
    33 function RegistrationData()
    34 {
    35 }
    36 RegistrationData.prototype = {
    37     classID: Components.ID("{ca168834-cc00-48f9-b83c-fd018e58cae3}"),
    38     _xpcom_factory: {
    39         createInstance: function(outer, iid) {
    40             if (outer != null)
    41                 throw Components.results.NS_ERROR_NO_AGGREGATION;
    42             Init();
    43             return (new PROT_ListManager()).QueryInterface(iid);
    44         }
    45     },
    46 };
    48 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]);

mercurial