Backed out 3 changesets (bug 1267910) for reports of it breaking session restore a=backout
authorWes Kocher <wkocher@mozilla.com>
Fri, 20 May 2016 21:15:17 -0700
changeset 337203 f1f2644d34440fe38c098e323bf570e09197e51a
parent 337202 45709b7b6466abcd984d5736c0e64eb12b0044cc
child 337204 ff787bd4fbfa8ebad2570ba0908957f130b527c2
child 337217 b7e3b5d4789622d10bd7a0689c9479fe6c5c7ccf
child 337335 7aea47a3405e404c0c7b6ad9218d5f482d558477
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1267910
milestone49.0a1
backs out5962f8e6d030e37a5f3c883180a2f35efe010b11
f8afc5cf9e0e90b6320e7436cbf6647b05cf1f1d
cc202e0ac0dd3401d340d1a8516a247a250c64b7
first release with
nightly linux32
f1f2644d3444 / 49.0a1 / 20160521030227 / files
nightly linux64
f1f2644d3444 / 49.0a1 / 20160521030227 / files
nightly mac
f1f2644d3444 / 49.0a1 / 20160521030227 / files
nightly win32
f1f2644d3444 / 49.0a1 / 20160521030227 / files
nightly win64
f1f2644d3444 / 49.0a1 / 20160521030227 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 3 changesets (bug 1267910) for reports of it breaking session restore a=backout Backed out changeset 5962f8e6d030 (bug 1267910) Backed out changeset f8afc5cf9e0e (bug 1267910) Backed out changeset cc202e0ac0dd (bug 1267910)
browser/components/migration/ChromeProfileMigrator.js
browser/components/migration/MSMigrationUtils.jsm
browser/components/migration/tests/unit/test_Chrome_cookies.js
browser/components/migration/tests/unit/test_IE_cookies.js
browser/components/sessionstore/SessionCookies.jsm
browser/extensions/pocket/content/pktApi.jsm
devtools/server/actors/storage.js
devtools/shared/gcli/commands/cookie.js
extensions/cookie/test/file_testloadflags_chromescript.js
extensions/cookie/test/unit/test_bug526789.js
extensions/cookie/test/unit/test_bug650522.js
extensions/cookie/test/unit/test_bug667087.js
extensions/cookie/test/unit/test_cookies_async_failure.js
extensions/cookie/test/unit/test_cookies_profile_close.js
extensions/cookie/test/unit/test_domain_eviction.js
extensions/cookie/test/unit/test_eviction.js
extensions/cookie/test/unit/test_schema_2_migration.js
extensions/cookie/test/unit/test_schema_3_migration.js
netwerk/cookie/nsCookieService.cpp
netwerk/cookie/nsICookieManager2.idl
netwerk/cookie/test/unit/test_bug1267910.js
netwerk/cookie/test/unit/xpcshell.ini
netwerk/locales/en-US/necko.properties
netwerk/test/TestCookie.cpp
netwerk/test/unit/test_bug411952.js
testing/marionette/driver.js
toolkit/components/extensions/ext-cookies.js
toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
toolkit/forgetaboutsite/ForgetAboutSite.jsm
toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
--- a/browser/components/migration/ChromeProfileMigrator.js
+++ b/browser/components/migration/ChromeProfileMigrator.js
@@ -373,18 +373,17 @@ function GetCookiesResource(aProfileFold
                 chromeTimeToDate(row.getResultByName("expires_utc")) / 1000;
               Services.cookies.add(host_key,
                                    row.getResultByName("path"),
                                    row.getResultByName("name"),
                                    row.getResultByName("value"),
                                    row.getResultByName("secure"),
                                    row.getResultByName("httponly"),
                                    false,
-                                   parseInt(expiresUtc),
-                                   {});
+                                   parseInt(expiresUtc));
             } catch (e) {
               Cu.reportError(e);
             }
           }
         },
 
         handleError : function(aError) {
           Cu.reportError("Async statement execution returned with '" +
--- a/browser/components/migration/MSMigrationUtils.jsm
+++ b/browser/components/migration/MSMigrationUtils.jsm
@@ -641,18 +641,17 @@ Cookies.prototype = {
 
       Services.cookies.add(host,
                            path,
                            name,
                            value,
                            Number(flags) & 0x1, // secure
                            false, // httpOnly
                            false, // session
-                           expireTime,
-                           {});
+                           expireTime);
     }
   }
 };
 
 function getTypedURLs(registryKeyPath) {
   // The list of typed URLs is a sort of annotation stored in the registry.
   // The number of entries stored is not UI-configurable, but has changed
   // between different Windows versions. We just keep reading up to the first
--- a/browser/components/migration/tests/unit/test_Chrome_cookies.js
+++ b/browser/components/migration/tests/unit/test_Chrome_cookies.js
@@ -29,17 +29,17 @@ add_task(function* () {
   yield promiseMigration(migrator, MigrationUtils.resourceTypes.COOKIES, PROFILE);
 
   Assert.equal(Services.cookies.countCookiesFromHost(COOKIE.host), 1,
                "Migrated the expected number of unencrypted cookies");
   Assert.equal(Services.cookies.countCookiesFromHost("encryptedcookie.invalid"), 0,
                "Migrated the expected number of encrypted cookies");
 
   // Now check the cookie details.
-  let enumerator = Services.cookies.getCookiesFromHost(COOKIE.host, {});
+  let enumerator = Services.cookies.getCookiesFromHost(COOKIE.host);
   Assert.ok(enumerator.hasMoreElements(), "Cookies available");
   let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
 
   for (let prop of Object.keys(COOKIE)) {
     Assert.equal(foundCookie[prop], COOKIE[prop], "Check cookie " + prop);
   }
 
   // Cleanup.
--- a/browser/components/migration/tests/unit/test_IE_cookies.js
+++ b/browser/components/migration/tests/unit/test_IE_cookies.js
@@ -93,17 +93,17 @@ add_task(function* () {
 
   // Migrate cookies.
   yield promiseMigration(migrator, MigrationUtils.resourceTypes.COOKIES);
 
   Assert.equal(Services.cookies.countCookiesFromHost(COOKIE.host), 1,
                "Migrated the expected number of cookies");
 
   // Now check the cookie details.
-  let enumerator = Services.cookies.getCookiesFromHost(COOKIE.host, {});
+  let enumerator = Services.cookies.getCookiesFromHost(COOKIE.host);
   Assert.ok(enumerator.hasMoreElements());
   let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
 
   Assert.equal(foundCookie.name, COOKIE.name);
   Assert.equal(foundCookie.value, COOKIE.value);
   Assert.equal(foundCookie.host, "." + COOKIE.host);
   Assert.equal(foundCookie.expiry, Math.floor(COOKIE.expiry / 1000));
 });
--- a/browser/components/sessionstore/SessionCookies.jsm
+++ b/browser/components/sessionstore/SessionCookies.jsm
@@ -120,17 +120,17 @@ var SessionCookiesInternal = {
       let cookieObj = {
         host: cookie.host,
         path: cookie.path || "",
         name: cookie.name || ""
       };
       if (!Services.cookies.cookieExists(cookieObj)) {
         Services.cookies.add(cookie.host, cookie.path || "", cookie.name || "",
                              cookie.value, !!cookie.secure, !!cookie.httponly,
-                             /* isSession = */ true, expiry, cookie.originAttributes);
+                             /* isSession = */ true, expiry);
       }
     }
   },
 
   /**
    * Handles observers notifications that are sent whenever cookies are added,
    * changed, or removed. Ensures that the storage is updated accordingly.
    */
@@ -412,20 +412,16 @@ var CookieStore = {
     if (cookie.isHttpOnly) {
       jscookie.httponly = true;
     }
 
     if (cookie.expiry < MAX_EXPIRY) {
       jscookie.expiry = cookie.expiry;
     }
 
-    if (cookie.originAttributes) {
-      jscookie.originAttributes = cookie.originAttributes;
-    }
-
     this._ensureMap(cookie).set(cookie.name, jscookie);
   },
 
   /**
    * Removes a given cookie.
    *
    * @param cookie
    *        The nsICookie2 object to be removed from storage.
--- a/browser/extensions/pocket/content/pktApi.jsm
+++ b/browser/extensions/pocket/content/pktApi.jsm
@@ -156,17 +156,17 @@ var pktApi = (function() {
 
     /*
      *  All cookies from the Pocket domain
      *  The return format: { cookieName:cookieValue, cookieName:cookieValue, ... }
     */
     function getCookiesFromPocket() {
 
         var cookieManager = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
-        var pocketCookies = cookieManager.getCookiesFromHost(pocketSiteHost, {});
+        var pocketCookies = cookieManager.getCookiesFromHost(pocketSiteHost);
         var cookies = {};
         while (pocketCookies.hasMoreElements()) {
             var cookie = pocketCookies.getNext().QueryInterface(Ci.nsICookie2);
             cookies[cookie.name] = cookie.value;
         }
         return cookies;
     }
 
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -460,20 +460,18 @@ StorageActors.createActor({
       isDomain: cookie.isDomain,
       isSecure: cookie.isSecure,
       isHttpOnly: cookie.isHttpOnly
     };
   },
 
   populateStoresForHost(host) {
     this.hostVsStores.set(host, new Map());
-    let doc = this.storageActor.document;
 
-    let cookies = this.getCookiesFromHost(host, doc.nodePrincipal
-                                                   .originAttributes);
+    let cookies = this.getCookiesFromHost(host);
 
     for (let cookie of cookies) {
       if (this.isCookieAtHost(cookie, host)) {
         this.hostVsStores.get(host).set(cookie.name, cookie);
       }
     }
   },
 
@@ -567,32 +565,25 @@ StorageActors.createActor({
 
   /**
    * Pass the editItem command from the content to the chrome process.
    *
    * @param {Object} data
    *        See editCookie() for format details.
    */
   editItem: Task.async(function* (data) {
-    let doc = this.storageActor.document;
-    data.originAttributes = doc.nodePrincipal
-                               .originAttributes;
     this.editCookie(data);
   }),
 
   removeItem: Task.async(function* (host, name) {
-    let doc = this.storageActor.document;
-    this.removeCookie(host, name, doc.nodePrincipal
-                                     .originAttributes);
+    this.removeCookie(host, name);
   }),
 
   removeAll: Task.async(function* (host, domain) {
-    let doc = this.storageActor.document;
-    this.removeAllCookies(host, domain, doc.nodePrincipal
-                                           .originAttributes);
+    this.removeAllCookies(host, domain);
   }),
 
   maybeSetupChildProcess() {
     cookieHelpers.onCookieChanged = this.onCookieChanged.bind(this);
 
     if (!DebuggerServer.isInChildProcess) {
       this.getCookiesFromHost =
         cookieHelpers.getCookiesFromHost.bind(cookieHelpers);
@@ -652,23 +643,23 @@ StorageActors.createActor({
       }
 
       return result;
     }
   },
 });
 
 var cookieHelpers = {
-  getCookiesFromHost(host, originAttributes) {
+  getCookiesFromHost(host) {
     // Local files have no host.
     if (host.startsWith("file:///")) {
       host = "";
     }
 
-    let cookies = Services.cookies.getCookiesFromHost(host, originAttributes);
+    let cookies = Services.cookies.getCookiesFromHost(host);
     let store = [];
 
     while (cookies.hasMoreElements()) {
       let cookie = cookies.getNext().QueryInterface(Ci.nsICookie2);
 
       store.push(cookie);
     }
 
@@ -702,17 +693,17 @@ var cookieHelpers = {
    */
   editCookie(data) {
     let {field, oldValue, newValue} = data;
     let origName = field === "name" ? oldValue : data.items.name;
     let origHost = field === "host" ? oldValue : data.items.host;
     let origPath = field === "path" ? oldValue : data.items.path;
     let cookie = null;
 
-    let enumerator = Services.cookies.getCookiesFromHost(origHost, data.originAttributes || {});
+    let enumerator = Services.cookies.getCookiesFromHost(origHost);
     while (enumerator.hasMoreElements()) {
       let nsiCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
       if (nsiCookie.name === origName && nsiCookie.host === origHost) {
         cookie = {
           host: nsiCookie.host,
           path: nsiCookie.path,
           name: nsiCookie.name,
           value: nsiCookie.value,
@@ -773,57 +764,56 @@ var cookieHelpers = {
     Services.cookies.add(
       cookie.host,
       cookie.path,
       cookie.name,
       cookie.value,
       cookie.isSecure,
       cookie.isHttpOnly,
       cookie.isSession,
-      cookie.isSession ? MAX_COOKIE_EXPIRY : cookie.expires,
-      cookie.originAttributes
+      cookie.isSession ? MAX_COOKIE_EXPIRY : cookie.expires
     );
   },
 
   _removeCookies(host, opts = {}) {
     function hostMatches(cookieHost, matchHost) {
       if (cookieHost == null) {
         return matchHost == null;
       }
       if (cookieHost.startsWith(".")) {
         return ("." + matchHost).endsWith(cookieHost);
       }
       return cookieHost == host;
     }
 
-    let enumerator = Services.cookies.getCookiesFromHost(host, opts.originAttributes || {});
+    let enumerator = Services.cookies.getCookiesFromHost(host);
     while (enumerator.hasMoreElements()) {
       let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
       if (hostMatches(cookie.host, host) &&
           (!opts.name || cookie.name === opts.name) &&
           (!opts.domain || cookie.host === opts.domain)) {
         Services.cookies.remove(
           cookie.host,
           cookie.name,
           cookie.path,
           false,
           cookie.originAttributes
         );
       }
     }
   },
 
-  removeCookie(host, name, originAttributes) {
+  removeCookie(host, name) {
     if (name !== undefined) {
-      this._removeCookies(host, { name, originAttributes });
+      this._removeCookies(host, { name });
     }
   },
 
-  removeAllCookies(host, domain, originAttributes) {
-    this._removeCookies(host, { domain, originAttributes });
+  removeAllCookies(host, domain) {
+    this._removeCookies(host, { domain });
   },
 
   addCookieObservers() {
     Services.obs.addObserver(cookieHelpers, "cookie-changed", false);
     return null;
   },
 
   removeCookieObservers() {
@@ -866,41 +856,38 @@ var cookieHelpers = {
         break;
     }
   },
 
   handleChildRequest(msg) {
     switch (msg.json.method) {
       case "getCookiesFromHost": {
         let host = msg.data.args[0];
-        let originAttributes = msg.data.args[1];
-        let cookies = cookieHelpers.getCookiesFromHost(host, originAttributes);
+        let cookies = cookieHelpers.getCookiesFromHost(host);
         return JSON.stringify(cookies);
       }
       case "addCookieObservers": {
         return cookieHelpers.addCookieObservers();
       }
       case "removeCookieObservers": {
         return cookieHelpers.removeCookieObservers();
       }
       case "editCookie": {
         let rowdata = msg.data.args[0];
         return cookieHelpers.editCookie(rowdata);
       }
       case "removeCookie": {
         let host = msg.data.args[0];
         let name = msg.data.args[1];
-        let originAttributes = msg.data.args[2];
-        return cookieHelpers.removeCookie(host, name, originAttributes);
+        return cookieHelpers.removeCookie(host, name);
       }
       case "removeAllCookies": {
         let host = msg.data.args[0];
         let domain = msg.data.args[1];
-        let originAttributes = msg.data.args[2];
-        return cookieHelpers.removeAllCookies(host, domain, originAttributes);
+        return cookieHelpers.removeAllCookies(host, domain);
       }
       default:
         console.error("ERR_DIRECTOR_PARENT_UNKNOWN_METHOD", msg.json.method);
         throw new Error("ERR_DIRECTOR_PARENT_UNKNOWN_METHOD");
     }
   },
 };
 
--- a/devtools/shared/gcli/commands/cookie.js
+++ b/devtools/shared/gcli/commands/cookie.js
@@ -81,21 +81,18 @@ exports.items = [
     manual: l10n.lookup("cookieListManual"),
     returnType: "cookies",
     exec: function(args, context) {
       if (context.environment.target.isRemote) {
         throw new Error("The cookie gcli commands only work in a local tab, " +
                         "see bug 1221488");
       }
       let host = new URL(context.environment.target.url).host;
-      let contentWindow  = context.environment.window;
       host = sanitizeHost(host);
-      let enm = cookieMgr.getCookiesFromHost(host, contentWindow.document.
-                                                   nodePrincipal.
-                                                   originAttributes);
+      let enm = cookieMgr.getCookiesFromHost(host);
 
       let cookies = [];
       while (enm.hasMoreElements()) {
         let cookie = enm.getNext().QueryInterface(Ci.nsICookie);
         if (isCookieAtHost(cookie, host)) {
           cookies.push({
             host: cookie.host,
             name: cookie.name,
@@ -126,21 +123,18 @@ exports.items = [
       }
     ],
     exec: function(args, context) {
       if (context.environment.target.isRemote) {
         throw new Error("The cookie gcli commands only work in a local tab, " +
                         "see bug 1221488");
       }
       let host = new URL(context.environment.target.url).host;
-      let contentWindow  = context.environment.window;
       host = sanitizeHost(host);
-      let enm = cookieMgr.getCookiesFromHost(host, contentWindow.document.
-                                                   nodePrincipal.
-                                                   originAttributes);
+      let enm = cookieMgr.getCookiesFromHost(host);
 
       while (enm.hasMoreElements()) {
         let cookie = enm.getNext().QueryInterface(Ci.nsICookie);
         if (isCookieAtHost(cookie, host)) {
           if (cookie.name == args.name) {
             cookieMgr.remove(cookie.host, cookie.name, cookie.path,
                              false, cookie.originAttributes);
           }
@@ -272,23 +266,20 @@ exports.items = [
     exec: function(args, context) {
       if (context.environment.target.isRemote) {
         throw new Error("The cookie gcli commands only work in a local tab, " +
                         "see bug 1221488");
       }
       let host = new URL(context.environment.target.url).host;
       host = sanitizeHost(host);
       let time = Date.parse(args.expires) / 1000;
-      let contentWindow  = context.environment.window;
+
       cookieMgr.add(args.domain ? "." + args.domain : host,
                     args.path ? args.path : "/",
                     args.name,
                     args.value,
                     args.secure,
                     args.httpOnly,
                     args.session,
-                    time,
-                    contentWindow.document.
-                                  nodePrincipal.
-                                  originAttributes);
+                    time);
     }
   }
 ];
--- a/extensions/cookie/test/file_testloadflags_chromescript.js
+++ b/extensions/cookie/test/file_testloadflags_chromescript.js
@@ -81,17 +81,17 @@ addMessageListener("init", ({ domain }) 
              .getService(Ci.nsICookieManager2);
 
   info("we are going to remove these cookies");
 
   let count = getCookieCount(cs);
   info(count + " cookies");
 
   cs.removeAll();
-  cs.add(domain, "", "oh", "hai", false, false, true, Math.pow(2, 62), {});
+  cs.add(domain, "", "oh", "hai", false, false, true, Math.pow(2, 62));
   is(cs.countCookiesFromHost(domain), 1, "number of cookies for domain " + domain);
 
   gObs = new obs();
   sendAsyncMessage("init:return");
 });
 
 addMessageListener("getCookieCount", () => {
   let cs = Cc["@mozilla.org/cookiemanager;1"]
--- a/extensions/cookie/test/unit/test_bug526789.js
+++ b/extensions/cookie/test/unit/test_bug526789.js
@@ -8,17 +8,17 @@ function run_test() {
 
   cm.removeAll();
 
   // Allow all cookies.
   Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
 
   // test that variants of 'baz.com' get normalized appropriately, but that
   // malformed hosts are rejected
-  cm.add("baz.com", "/", "foo", "bar", false, false, true, expiry, {});
+  cm.add("baz.com", "/", "foo", "bar", false, false, true, expiry);
   do_check_eq(cm.countCookiesFromHost("baz.com"), 1);
   do_check_eq(cm.countCookiesFromHost("BAZ.com"), 1);
   do_check_eq(cm.countCookiesFromHost(".baz.com"), 1);
   do_check_eq(cm.countCookiesFromHost("baz.com."), 0);
   do_check_eq(cm.countCookiesFromHost(".baz.com."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost("baz.com..");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
@@ -29,50 +29,50 @@ function run_test() {
     cm.countCookiesFromHost("..baz.com");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   cm.remove("BAZ.com.", "foo", "/", false, {});
   do_check_eq(cm.countCookiesFromHost("baz.com"), 1);
   cm.remove("baz.com", "foo", "/", false, {});
   do_check_eq(cm.countCookiesFromHost("baz.com"), 0);
 
   // Test that 'baz.com' and 'baz.com.' are treated differently
-  cm.add("baz.com.", "/", "foo", "bar", false, false, true, expiry, {});
+  cm.add("baz.com.", "/", "foo", "bar", false, false, true, expiry);
   do_check_eq(cm.countCookiesFromHost("baz.com"), 0);
   do_check_eq(cm.countCookiesFromHost("BAZ.com"), 0);
   do_check_eq(cm.countCookiesFromHost(".baz.com"), 0);
   do_check_eq(cm.countCookiesFromHost("baz.com."), 1);
   do_check_eq(cm.countCookiesFromHost(".baz.com."), 1);
   cm.remove("baz.com", "foo", "/", false, {});
   do_check_eq(cm.countCookiesFromHost("baz.com."), 1);
   cm.remove("baz.com.", "foo", "/", false, {});
   do_check_eq(cm.countCookiesFromHost("baz.com."), 0);
 
   // test that domain cookies are illegal for IP addresses, aliases such as
   // 'localhost', and eTLD's such as 'co.uk'
-  cm.add("192.168.0.1", "/", "foo", "bar", false, false, true, expiry, {});
+  cm.add("192.168.0.1", "/", "foo", "bar", false, false, true, expiry);
   do_check_eq(cm.countCookiesFromHost("192.168.0.1"), 1);
   do_check_eq(cm.countCookiesFromHost("192.168.0.1."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost(".192.168.0.1");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost(".192.168.0.1.");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
-  cm.add("localhost", "/", "foo", "bar", false, false, true, expiry, {});
+  cm.add("localhost", "/", "foo", "bar", false, false, true, expiry);
   do_check_eq(cm.countCookiesFromHost("localhost"), 1);
   do_check_eq(cm.countCookiesFromHost("localhost."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost(".localhost");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost(".localhost.");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
-  cm.add("co.uk", "/", "foo", "bar", false, false, true, expiry, {});
+  cm.add("co.uk", "/", "foo", "bar", false, false, true, expiry);
   do_check_eq(cm.countCookiesFromHost("co.uk"), 1);
   do_check_eq(cm.countCookiesFromHost("co.uk."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost(".co.uk");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost(".co.uk.");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
@@ -100,36 +100,36 @@ function run_test() {
   do_check_eq(cm.countCookiesFromHost(""), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost(".");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost("..");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
-  var e = cm.getCookiesFromHost("", {});
+  var e = cm.getCookiesFromHost("");
   do_check_false(e.hasMoreElements());
   do_check_throws(function() {
-    cm.getCookiesFromHost(".", {});
+    cm.getCookiesFromHost(".");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
-    cm.getCookiesFromHost("..", {});
+    cm.getCookiesFromHost("..");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
-  e = cm.getCookiesFromHost("baz.com", {});
+  e = cm.getCookiesFromHost("baz.com");
   do_check_true(e.hasMoreElements());
   do_check_eq(e.getNext().QueryInterface(Ci.nsICookie2).name, "foo");
   do_check_false(e.hasMoreElements());
-  e = cm.getCookiesFromHost("", {});
+  e = cm.getCookiesFromHost("");
   do_check_false(e.hasMoreElements());
   do_check_throws(function() {
-    cm.getCookiesFromHost(".", {});
+    cm.getCookiesFromHost(".");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
-    cm.getCookiesFromHost("..", {});
+    cm.getCookiesFromHost("..");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
   cm.removeAll();
 
   // test that an empty file:// host works
   emptyuri = NetUtil.newURI("file:///");
   do_check_eq(emptyuri.asciiHost, "");
   do_check_eq(NetUtil.newURI("file://./").asciiHost, "");
@@ -146,36 +146,36 @@ function run_test() {
   do_check_eq(cs.getCookieString(emptyuri, null), "foo2=bar; foo3=bar");
 
   do_check_eq(cm.countCookiesFromHost("baz.com"), 0);
   do_check_eq(cm.countCookiesFromHost(""), 2);
   do_check_throws(function() {
     cm.countCookiesFromHost(".");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
-  e = cm.getCookiesFromHost("baz.com", {});
+  e = cm.getCookiesFromHost("baz.com");
   do_check_false(e.hasMoreElements());
-  e = cm.getCookiesFromHost("", {});
+  e = cm.getCookiesFromHost("");
   do_check_true(e.hasMoreElements());
   e.getNext();
   do_check_true(e.hasMoreElements());
   e.getNext();
   do_check_false(e.hasMoreElements());
   do_check_throws(function() {
-    cm.getCookiesFromHost(".", {});
+    cm.getCookiesFromHost(".");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
   cm.removeAll();
 
   // test that an empty host to add() or remove() works,
   // but a host of '.' doesn't
-  cm.add("", "/", "foo2", "bar", false, false, true, expiry, {});
+  cm.add("", "/", "foo2", "bar", false, false, true, expiry);
   do_check_eq(getCookieCount(), 1);
   do_check_throws(function() {
-    cm.add(".", "/", "foo3", "bar", false, false, true, expiry, {});
+    cm.add(".", "/", "foo3", "bar", false, false, true, expiry);
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_eq(getCookieCount(), 1);
 
   cm.remove("", "foo2", "/", false, {});
   do_check_eq(getCookieCount(), 0);
   do_check_throws(function() {
     cm.remove(".", "foo3", "/", false, {});
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
@@ -211,23 +211,23 @@ function getCookieCount() {
 function testDomainCookie(uriString, domain) {
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
 
   cm.removeAll();
 
   var uri = NetUtil.newURI(uriString);
   cs.setCookieString(uri, null, "foo=bar; domain=" + domain, null);
-  var e = cm.getCookiesFromHost(domain, {});
+  var e = cm.getCookiesFromHost(domain);
   do_check_true(e.hasMoreElements());
   do_check_eq(e.getNext().QueryInterface(Ci.nsICookie2).host, domain);
   cm.removeAll();
 
   cs.setCookieString(uri, null, "foo=bar; domain=." + domain, null);
-  e = cm.getCookiesFromHost(domain, {});
+  e = cm.getCookiesFromHost(domain);
   do_check_true(e.hasMoreElements());
   do_check_eq(e.getNext().QueryInterface(Ci.nsICookie2).host, domain);
   cm.removeAll();
 }
 
 function testTrailingDotCookie(uriString, domain) {
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
--- a/extensions/cookie/test/unit/test_bug650522.js
+++ b/extensions/cookie/test/unit/test_bug650522.js
@@ -5,12 +5,12 @@ Components.utils.import("resource://gre/
 
 function run_test() {
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
   var expiry = (Date.now() + 1000) * 1000;
 
   // Test our handling of host names with a single character at the beginning
   // followed by a dot.
-  cm.add("e.mail.com", "/", "foo", "bar", false, false, true, expiry, {});
+  cm.add("e.mail.com", "/", "foo", "bar", false, false, true, expiry);
   do_check_eq(cm.countCookiesFromHost("e.mail.com"), 1);
   do_check_eq(cs.getCookieString(NetUtil.newURI("http://e.mail.com"), null), "foo=bar");
 }
--- a/extensions/cookie/test/unit/test_bug667087.js
+++ b/extensions/cookie/test/unit/test_bug667087.js
@@ -5,12 +5,12 @@ Components.utils.import("resource://gre/
 
 function run_test() {
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
   var expiry = (Date.now() + 1000) * 1000;
 
   // Test our handling of host names with a single character consisting only
   // of a single character
-  cm.add("a", "/", "foo", "bar", false, false, true, expiry, {});
+  cm.add("a", "/", "foo", "bar", false, false, true, expiry);
   do_check_eq(cm.countCookiesFromHost("a"), 1);
   do_check_eq(cs.getCookieString(NetUtil.newURI("http://a"), null), "foo=bar");
 }
--- a/extensions/cookie/test/unit/test_cookies_async_failure.js
+++ b/extensions/cookie/test/unit/test_cookies_async_failure.js
@@ -153,17 +153,17 @@ function run_test_1(generator)
   do_check_eq(do_count_cookies_in_db(db.db), 1);
 
   // Insert a row.
   db.insertCookie(cookie);
   db.close();
 
   // Attempt to insert a cookie with the same (name, host, path) triplet.
   Services.cookiemgr.add(cookie.host, cookie.path, cookie.name, "hallo",
-    cookie.isSecure, cookie.isHttpOnly, cookie.isSession, cookie.expiry, {});
+    cookie.isSecure, cookie.isHttpOnly, cookie.isSession, cookie.expiry);
 
   // Check that the cookie service accepted the new cookie.
   do_check_eq(Services.cookiemgr.countCookiesFromHost(cookie.host), 1);
 
   // Wait for the cookie service to rename the old database and rebuild.
   new _observer(sub_generator, "cookie-db-rebuilding");
   yield;
   do_execute_soon(function() { do_run_generator(sub_generator); });
@@ -184,17 +184,17 @@ function run_test_1(generator)
   let backupdb = Services.storage.openDatabase(do_get_backup_file(profile));
   do_check_eq(do_count_cookies_in_db(backupdb, "foo.com"), 1);
   backupdb.close();
 
   // Load the profile, and check that it contains the new cookie.
   do_load_profile();
 
   do_check_eq(Services.cookiemgr.countCookiesFromHost("foo.com"), 1);
-  let enumerator = Services.cookiemgr.getCookiesFromHost(cookie.host, {});
+  let enumerator = Services.cookiemgr.getCookiesFromHost(cookie.host);
   do_check_true(enumerator.hasMoreElements());
   let dbcookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
   do_check_eq(dbcookie.value, "hallo");
   do_check_false(enumerator.hasMoreElements());
 
   // Close the profile.
   do_close_profile(sub_generator);
   yield;
--- a/extensions/cookie/test/unit/test_cookies_profile_close.js
+++ b/extensions/cookie/test/unit/test_cookies_profile_close.js
@@ -49,17 +49,17 @@ function do_run_test() {
     Services.cookiemgr.removeAll();
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     Services.cookiemgr.enumerator;
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
-    Services.cookiemgr.add("foo.com", "", "oh4", "hai", false, false, false, 0, {});
+    Services.cookiemgr.add("foo.com", "", "oh4", "hai", false, false, false, 0);
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     Services.cookiemgr.remove("foo.com", "", "oh4", false, {});
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     let file = profile.clone();
@@ -71,17 +71,17 @@ function do_run_test() {
     Services.cookiemgr.cookieExists(cookie);
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     Services.cookies.countCookiesFromHost("foo.com");
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
-    Services.cookies.getCookiesFromHost("foo.com", {});
+    Services.cookies.getCookiesFromHost("foo.com");
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   // Wait for the database to finish closing.
   new _observer(test_generator, "cookie-db-closed");
   yield;
 
   // Load the profile and check that the API is available.
   do_load_profile();
--- a/extensions/cookie/test/unit/test_domain_eviction.js
+++ b/extensions/cookie/test/unit/test_domain_eviction.js
@@ -63,41 +63,41 @@ function do_run_test()
     if (cookie.host == "horse.radish")
       do_throw("cookies not evicted by lastAccessed order");
   }
 
   // Test that expired cookies for a domain are evicted before live ones.
   let shortExpiry = Math.floor(Date.now() / 1000 + 2);
   setCookies("captchart.com", 49, futureExpiry);
   Services.cookiemgr.add("captchart.com", "", "test100", "eviction",
-    false, false, false, shortExpiry, {});
+    false, false, false, shortExpiry);
   do_timeout(2100, continue_test);
   yield;
 
   do_check_eq(countCookies("captchart.com", "captchart.com"), 50);
   Services.cookiemgr.add("captchart.com", "", "test200", "eviction",
-    false, false, false, futureExpiry, {});
+    false, false, false, futureExpiry);
   do_check_eq(countCookies("captchart.com", "captchart.com"), 50);
 
-  enumerator = Services.cookiemgr.getCookiesFromHost("captchart.com", {});
+  enumerator = Services.cookiemgr.getCookiesFromHost("captchart.com");
   while (enumerator.hasMoreElements()) {
     let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
     do_check_true(cookie.expiry == futureExpiry);
   }
 
   do_finish_generator_test(test_generator);
 }
 
 // set 'aNumber' cookies with host 'aHost', with distinct names.
 function
 setCookies(aHost, aNumber, aExpiry)
 {
   for (let i = 0; i < aNumber; ++i)
     Services.cookiemgr.add(aHost, "", "test" + i, "eviction",
-      false, false, false, aExpiry, {});
+      false, false, false, aExpiry);
 }
 
 // count how many cookies are within domain 'aBaseDomain', using three
 // independent interface methods on nsICookieManager2:
 // 1) 'enumerator', an enumerator of all cookies;
 // 2) 'countCookiesFromHost', which returns the number of cookies within the
 //    base domain of 'aHost',
 // 3) 'getCookiesFromHost', which returns an enumerator of 2).
@@ -118,17 +118,17 @@ countCookies(aBaseDomain, aHost)
   }
 
   // confirm the count using countCookiesFromHost and getCookiesFromHost.
   let result = cookies.length;
   do_check_eq(Services.cookiemgr.countCookiesFromHost(aBaseDomain),
     cookies.length);
   do_check_eq(Services.cookiemgr.countCookiesFromHost(aHost), cookies.length);
 
-  enumerator = Services.cookiemgr.getCookiesFromHost(aHost, {});
+  enumerator = Services.cookiemgr.getCookiesFromHost(aHost);
   while (enumerator.hasMoreElements()) {
     let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
 
     if (cookie.host.length >= aBaseDomain.length &&
         cookie.host.slice(cookie.host.length - aBaseDomain.length) == aBaseDomain) {
       let found = false;
       for (let i = 0; i < cookies.length; ++i) {
         if (cookies[i].host == cookie.host && cookies[i].name == cookie.name) {
--- a/extensions/cookie/test/unit/test_eviction.js
+++ b/extensions/cookie/test/unit/test_eviction.js
@@ -194,17 +194,17 @@ function do_run_test()
 function set_cookies(begin, end, expiry)
 {
   do_check_true(begin != end);
 
   let beginTime;
   for (let i = begin; i < end; ++i) {
     let host = "eviction." + i + ".tests";
     Services.cookiemgr.add(host, "", "test", "eviction", false, false, false,
-      expiry, {});
+      expiry);
 
     if (i == begin)
       beginTime = get_creationTime(i);
   }
 
   let endTime = get_creationTime(end - 1);
   do_check_true(begin == end - 1 || endTime > beginTime);
   if (endTime - beginTime > gPurgeAge * 1000000) {
@@ -214,17 +214,17 @@ function set_cookies(begin, end, expiry)
   }
 
   return true;
 }
 
 function get_creationTime(i)
 {
   let host = "eviction." + i + ".tests";
-  let enumerator = Services.cookiemgr.getCookiesFromHost(host, {});
+  let enumerator = Services.cookiemgr.getCookiesFromHost(host);
   do_check_true(enumerator.hasMoreElements());
   let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
   return cookie.creationTime;
 }
 
 // Test that 'aNumberToExpect' cookies remain after purging is complete, and
 // that the cookies that remain consist of the set expected given the number of
 // of older and newer cookies -- eviction should occur by order of lastAccessed
--- a/extensions/cookie/test/unit/test_schema_2_migration.js
+++ b/extensions/cookie/test/unit/test_schema_2_migration.js
@@ -83,17 +83,17 @@ function do_run_test() {
   do_check_eq(Services.cookiemgr.countCookiesFromHost("foo.com"), 20);
 
   // 2) All expired, unique cookies exist.
   do_check_eq(Services.cookiemgr.countCookiesFromHost("bar.com"), 20);
 
   // 3) Only one cookie remains, and it's the one with the highest expiration
   // time.
   do_check_eq(Services.cookiemgr.countCookiesFromHost("baz.com"), 1);
-  let enumerator = Services.cookiemgr.getCookiesFromHost("baz.com", {});
+  let enumerator = Services.cookiemgr.getCookiesFromHost("baz.com");
   let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
   do_check_eq(cookie.expiry, futureExpiry + 44);
 
   do_close_profile(test_generator);
   yield;
 
   // Open the database so we can execute some more schema 2 statements on it.
   schema2db = new CookieDatabaseConnection(do_get_cookie_file(profile), 2);
--- a/extensions/cookie/test/unit/test_schema_3_migration.js
+++ b/extensions/cookie/test/unit/test_schema_3_migration.js
@@ -83,17 +83,17 @@ function do_run_test() {
   do_check_eq(Services.cookiemgr.countCookiesFromHost("foo.com"), 20);
 
   // 2) All expired, unique cookies exist.
   do_check_eq(Services.cookiemgr.countCookiesFromHost("bar.com"), 20);
 
   // 3) Only one cookie remains, and it's the one with the highest expiration
   // time.
   do_check_eq(Services.cookiemgr.countCookiesFromHost("baz.com"), 1);
-  let enumerator = Services.cookiemgr.getCookiesFromHost("baz.com", {});
+  let enumerator = Services.cookiemgr.getCookiesFromHost("baz.com");
   let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
   do_check_eq(cookie.expiry, futureExpiry + 44);
 
   do_close_profile(test_generator);
   yield;
 
   // Open the database so we can execute some more schema 3 statements on it.
   schema3db = new CookieDatabaseConnection(do_get_cookie_file(profile), 3);
@@ -111,15 +111,15 @@ function do_run_test() {
   schema3db = null;
 
   // Load the database. The cookies added immediately prior will have a NULL
   // creationTime column.
   do_load_profile();
 
   // Test the expected set of cookies.
   do_check_eq(Services.cookiemgr.countCookiesFromHost("cat.com"), 20);
-  enumerator = Services.cookiemgr.getCookiesFromHost("cat.com", {});
+  enumerator = Services.cookiemgr.getCookiesFromHost("cat.com");
   cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
   do_check_eq(cookie.creationTime, 0);
 
   finish_test();
 }
 
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2255,98 +2255,26 @@ nsCookieService::GetEnumerator(nsISimple
     for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
       cookieList.AppendObject(cookies[i]);
     }
   }
 
   return NS_NewArrayEnumerator(aEnumerator, cookieList);
 }
 
-static nsresult
-InitializeOriginAttributes(NeckoOriginAttributes* aAttrs,
-                           JS::HandleValue aOriginAttributes,
-                           JSContext* aCx,
-                           uint8_t aArgc,
-                           const char16_t* aAPI,
-                           const char16_t* aInterfaceSuffix)
-{
-  MOZ_ASSERT(aAttrs);
-  MOZ_ASSERT(aCx);
-  MOZ_ASSERT(aAPI);
-  MOZ_ASSERT(aInterfaceSuffix);
-
-  if (aArgc == 0) {
-    const char16_t* params[] = {
-      aAPI,
-      aInterfaceSuffix
-    };
-
-    // This is supposed to be temporary and in 1 or 2 releases we want to
-    // have originAttributes param as mandatory. But for now, we don't want to
-    // break existing addons, so we write a console message to inform the addon
-    // developers about it.
-    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
-                                    NS_LITERAL_CSTRING("Cookie Manager"),
-                                    nullptr,
-                                    nsContentUtils::eNECKO_PROPERTIES,
-                                    "nsICookieManagerAPIDeprecated",
-                                    params, ArrayLength(params));
-  } else if (aArgc == 1) {
-    if (!aOriginAttributes.isObject() ||
-        !aAttrs->Init(aCx, aOriginAttributes)) {
-      return NS_ERROR_INVALID_ARG;
-    }
-  }
-
-  return NS_OK;
-}
-
 NS_IMETHODIMP
 nsCookieService::Add(const nsACString &aHost,
                      const nsACString &aPath,
                      const nsACString &aName,
                      const nsACString &aValue,
                      bool              aIsSecure,
                      bool              aIsHttpOnly,
                      bool              aIsSession,
-                     int64_t           aExpiry,
-                     JS::HandleValue   aOriginAttributes,
-                     JSContext*        aCx,
-                     uint8_t           aArgc)
+                     int64_t           aExpiry)
 {
-  MOZ_ASSERT(aArgc == 0 || aArgc == 1);
-
-  NeckoOriginAttributes attrs;
-  nsresult rv = InitializeOriginAttributes(&attrs,
-                                           aOriginAttributes,
-                                           aCx,
-                                           aArgc,
-                                           MOZ_UTF16("nsICookieManager2.add()"),
-                                           MOZ_UTF16("2"));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return AddNative(aHost, aPath, aName, aValue, aIsSecure, aIsHttpOnly,
-                   aIsSession, aExpiry, &attrs);
-}
-
-NS_IMETHODIMP_(nsresult)
-nsCookieService::AddNative(const nsACString &aHost,
-                           const nsACString &aPath,
-                           const nsACString &aName,
-                           const nsACString &aValue,
-                           bool              aIsSecure,
-                           bool              aIsHttpOnly,
-                           bool              aIsSession,
-                           int64_t           aExpiry,
-                           NeckoOriginAttributes* aOriginAttributes)
-{
-  if (NS_WARN_IF(!aOriginAttributes)) {
-    return NS_ERROR_FAILURE;
-  }
-
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   // first, normalize the hostname, and fail if it contains illegal characters.
   nsAutoCString host(aHost);
   nsresult rv = NormalizeHost(host);
@@ -2354,17 +2282,17 @@ nsCookieService::AddNative(const nsACStr
 
   // get the base domain for the host URI.
   // e.g. for "www.bbc.co.uk", this would be "bbc.co.uk".
   nsAutoCString baseDomain;
   rv = GetBaseDomainFromHost(host, baseDomain);
   NS_ENSURE_SUCCESS(rv, rv);
 
   int64_t currentTimeInUsec = PR_Now();
-  nsCookieKey key = nsCookieKey(baseDomain, *aOriginAttributes);
+  nsCookieKey key = DEFAULT_APP_KEY(baseDomain);
 
   RefPtr<nsCookie> cookie =
     nsCookie::Create(aName, aValue, host, aPath,
                      aExpiry,
                      currentTimeInUsec,
                      nsCookie::GenerateUniqueCreationTime(currentTimeInUsec),
                      aIsSession,
                      aIsSecure,
@@ -2437,26 +2365,34 @@ nsCookieService::Remove(const nsACString
                         const nsACString &aName,
                         const nsACString &aPath,
                         bool             aBlocked,
                         JS::HandleValue  aOriginAttributes,
                         JSContext*       aCx,
                         uint8_t          aArgc)
 {
   MOZ_ASSERT(aArgc == 0 || aArgc == 1);
+  if (aArgc == 0) {
+    // This is supposed to be temporary and in 1 or 2 releases we want to
+    // have originAttributes param as mandatory. But for now, we don't want to
+    // break existing addons, so we write a console message to inform the addon
+    // developers about it.
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    NS_LITERAL_CSTRING("Cookie Manager"),
+                                    nullptr,
+                                    nsContentUtils::eNECKO_PROPERTIES,
+                                    "nsICookieManagerRemoveDeprecated");
+  }
 
   NeckoOriginAttributes attrs;
-  nsresult rv = InitializeOriginAttributes(&attrs,
-                                           aOriginAttributes,
-                                           aCx,
-                                           aArgc,
-                                           MOZ_UTF16("nsICookieManager.remove()"),
-                                           MOZ_UTF16(""));
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  if (aArgc == 1 &&
+      (!aOriginAttributes.isObject() ||
+       !attrs.Init(aCx, aOriginAttributes))) {
+    return NS_ERROR_INVALID_ARG;
+  }
   return RemoveNative(aHost, aName, aPath, aBlocked, &attrs);
 }
 
 NS_IMETHODIMP_(nsresult)
 nsCookieService::RemoveNative(const nsACString &aHost,
                               const nsACString &aName,
                               const nsACString &aPath,
                               bool aBlocked,
@@ -4357,47 +4293,33 @@ nsCookieService::CountCookiesFromHost(co
   *aCountFromHost = entry ? entry->GetCookies().Length() : 0;
   return NS_OK;
 }
 
 // get an enumerator of cookies stored by a particular host. this is provided by the
 // nsICookieManager2 interface.
 NS_IMETHODIMP
 nsCookieService::GetCookiesFromHost(const nsACString     &aHost,
-                                    JS::HandleValue       aOriginAttributes,
-                                    JSContext*            aCx,
-                                    uint8_t               aArgc,
                                     nsISimpleEnumerator **aEnumerator)
 {
-  MOZ_ASSERT(aArgc == 0 || aArgc == 1);
-
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   // first, normalize the hostname, and fail if it contains illegal characters.
   nsAutoCString host(aHost);
   nsresult rv = NormalizeHost(host);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString baseDomain;
   rv = GetBaseDomainFromHost(host, baseDomain);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  NeckoOriginAttributes attrs;
-  rv = InitializeOriginAttributes(&attrs,
-                                  aOriginAttributes,
-                                  aCx,
-                                  aArgc,
-                                  MOZ_UTF16("nsICookieManager2.getCookiesFromHost()"),
-                                  MOZ_UTF16("2"));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCookieKey key = nsCookieKey(baseDomain, attrs);
+  nsCookieKey key = DEFAULT_APP_KEY(baseDomain);
   EnsureReadDomain(key);
 
   nsCookieEntry *entry = mDBState->hostTable.GetEntry(key);
   if (!entry)
     return NS_NewEmptyEnumerator(aEnumerator);
 
   nsCOMArray<nsICookie> cookieList(mMaxCookiesPerHost);
   const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
--- a/netwerk/cookie/nsICookieManager2.idl
+++ b/netwerk/cookie/nsICookieManager2.idl
@@ -41,40 +41,25 @@ interface nsICookieManager2 : nsICookieM
    *        modified by, an http connection.
    * @param aIsSession
    *        true if the cookie should exist for the current session only.
    *        see aExpiry.
    * @param aExpiry
    *        expiration date, in seconds since midnight (00:00:00), January 1,
    *        1970 UTC. note that expiry time will also be honored for session cookies;
    *        in this way, the more restrictive of the two will take effect.
-   * @param aOriginAttributes The originAttributes of this cookie. This
-   *                          attribute is optional to avoid breaking add-ons.
    */
-  [implicit_jscontext, optional_argc]
   void add(in AUTF8String aHost,
            in AUTF8String aPath,
            in ACString    aName,
            in ACString    aValue,
            in boolean     aIsSecure,
            in boolean     aIsHttpOnly,
            in boolean     aIsSession,
-           in int64_t     aExpiry,
-           [optional] in jsval aOriginAttributes);
-
-  [notxpcom]
-  nsresult addNative(in AUTF8String aHost,
-                     in AUTF8String aPath,
-                     in ACString    aName,
-                     in ACString    aValue,
-                     in boolean     aIsSecure,
-                     in boolean     aIsHttpOnly,
-                     in boolean     aIsSession,
-                     in int64_t     aExpiry,
-                     in NeckoOriginAttributesPtr aOriginAttributes);
+           in int64_t     aExpiry);
 
   /**
    * Find whether a given cookie already exists.
    *
    * @param aCookie
    *        the cookie to look for
    *
    * @return true if a cookie was found which matches the host, path, and name
@@ -102,27 +87,22 @@ interface nsICookieManager2 : nsICookieM
    * 'aHost'. Thus, for a host "weather.yahoo.com", the base domain would be
    * "yahoo.com", and any host or domain cookies for "yahoo.com" and its
    * subdomains would be returned.
    *
    * @param aHost
    *        the host string to search for, e.g. "google.com". this should consist
    *        of only the host portion of a URI. see @add for a description of
    *        acceptable host strings.
-   * @param aOriginAttributes The originAttributes of cookies that would be
-   *                          retrived. This attribute is optional to avoid
-   *                          breaking add-ons.
    *
    * @return an nsISimpleEnumerator of nsICookie2 objects.
    *
    * @see countCookiesFromHost
    */
-  [implicit_jscontext, optional_argc]
-  nsISimpleEnumerator getCookiesFromHost(in AUTF8String aHost,
-                                         [optional] in jsval aOriginAttributes);
+  nsISimpleEnumerator getCookiesFromHost(in AUTF8String aHost);
 
   /**
    * Import an old-style cookie file. Imported cookies will be added to the
    * existing database. If the database contains any cookies the same as those
    * being imported (i.e. domain, name, and path match), they will be replaced.
    *
    * @param aCookieFile the file to import, usually cookies.txt
    */
deleted file mode 100644
--- a/netwerk/cookie/test/unit/test_bug1267910.js
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Bug 1267910 - Add test cases for the backward compatiability and originAttributes
- *               of nsICookieManager2.
- */
-
-var {utils: Cu, interfaces: Ci, classes: Cc} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-const BASE_URL = "http://example.org/";
-
-const COOKIE = {
-  host: BASE_URL,
-  path: "/",
-  name: "test1",
-  value: "yes",
-  isSecure: false,
-  isHttpOnly: false,
-  isSession: true,
-  expiry: 2145934800,
-};
-
-const COOKIE_OA_DEFAULT = {
-  host: BASE_URL,
-  path: "/",
-  name: "test0",
-  value: "yes0",
-  isSecure: false,
-  isHttpOnly: false,
-  isSession: true,
-  expiry: 2145934800,
-  originAttributes: {},
-};
-
-const COOKIE_OA_1 = {
-  host: BASE_URL,
-  path: "/",
-  name: "test1",
-  value: "yes1",
-  isSecure: false,
-  isHttpOnly: false,
-  isSession: true,
-  expiry: 2145934800,
-  originAttributes: {userContextId: 1},
-};
-
-function checkCookie(cookie, cookieObj) {
-  for (let prop of Object.keys(cookieObj)) {
-    if (prop === "originAttributes") {
-      ok(ChromeUtils.isOriginAttributesEqual(cookie[prop], cookieObj[prop]),
-        "Check cookie: " + prop);
-    } else {
-      equal(cookie[prop], cookieObj[prop], "Check cookie: " + prop);
-    }
-  }
-}
-
-function countCookies(enumerator) {
-  let cnt = 0;
-
-  while (enumerator.hasMoreElements()) {
-    cnt++;
-    enumerator.getNext();
-  }
-
-  return cnt;
-}
-
-function run_test() {
-  // Allow all cookies.
-  Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
-
-  // Enable user context id
-  Services.prefs.setBoolPref("privacy.userContext.enabled", true);
-
-  add_test(test_backward_compatiability);
-  add_test(test_originAttributes);
-
-
-  run_next_test();
-}
-
-/*
- * Test for backward compatiablility that APIs works correctly without
- * originAttributes.
- */
-function test_backward_compatiability() {
-  // Clear cookies.
-  Services.cookies.removeAll();
-
-  // Call Add() to add a cookie without originAttributes
-  Services.cookies.add(COOKIE.host,
-                       COOKIE.path,
-                       COOKIE.name,
-                       COOKIE.value,
-                       COOKIE.isSecure,
-                       COOKIE.isHttpOnly,
-                       COOKIE.isSession,
-                       COOKIE.expiry);
-
-  // Call getCookiesFromHost() to get cookies without originAttributes
-  let enumerator = Services.cookies.getCookiesFromHost(BASE_URL);
-
-  ok(enumerator.hasMoreElements(), "Cookies available");
-  let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
-
-  checkCookie(foundCookie, COOKIE);
-
-  ok(!enumerator.hasMoreElements(), "We should get only one cookie");
-
-  run_next_test();
-}
-
-/*
- * Test for originAttributes.
- */
-function test_originAttributes() {
-  // Clear cookies.
-  Services.cookies.removeAll();
-
-  // Add a cookie for default originAttributes.
-  Services.cookies.add(COOKIE_OA_DEFAULT.host,
-                       COOKIE_OA_DEFAULT.path,
-                       COOKIE_OA_DEFAULT.name,
-                       COOKIE_OA_DEFAULT.value,
-                       COOKIE_OA_DEFAULT.isSecure,
-                       COOKIE_OA_DEFAULT.isHttpOnly,
-                       COOKIE_OA_DEFAULT.isSession,
-                       COOKIE_OA_DEFAULT.expiry,
-                       COOKIE_OA_DEFAULT.originAttributes);
-
-  // Get cookies for default originAttributes.
-  let enumerator = Services.cookies.getCookiesFromHost(BASE_URL, COOKIE_OA_DEFAULT.originAttributes);
-
-  // Check that do we get cookie correctly.
-  ok(enumerator.hasMoreElements(), "Cookies available");
-  let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
-  checkCookie(foundCookie, COOKIE_OA_DEFAULT);
-
-  // We should only get one cookie.
-  ok(!enumerator.hasMoreElements(), "We should get only one cookie");
-
-  // Get cookies for originAttributes with user context id 1.
-  enumerator = Services.cookies.getCookiesFromHost(BASE_URL, COOKIE_OA_1.originAttributes);
-
-  // Check that we will not get cookies if the originAttributes is different.
-  ok(!enumerator.hasMoreElements(), "No cookie should be here");
-
-  // Add a cookie for originAttributes with user context id 1.
-  Services.cookies.add(COOKIE_OA_1.host,
-                       COOKIE_OA_1.path,
-                       COOKIE_OA_1.name,
-                       COOKIE_OA_1.value,
-                       COOKIE_OA_1.isSecure,
-                       COOKIE_OA_1.isHttpOnly,
-                       COOKIE_OA_1.isSession,
-                       COOKIE_OA_1.expiry,
-                       COOKIE_OA_1.originAttributes);
-
-  // Get cookies for originAttributes with user context id 1.
-  enumerator = Services.cookies.getCookiesFromHost(BASE_URL, COOKIE_OA_1.originAttributes);
-
-  // Check that do we get cookie correctly.
-  ok(enumerator.hasMoreElements(), "Cookies available");
-  foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
-  checkCookie(foundCookie, COOKIE_OA_1);
-
-  // We should only get one cookie.
-  ok(!enumerator.hasMoreElements(), "We should get only one cookie");
-
-  // Check that add a cookie will not affect cookies in different originAttributes.
-  enumerator = Services.cookies.getCookiesFromHost(BASE_URL, COOKIE_OA_DEFAULT.originAttributes);
-  equal(countCookies(enumerator), 1, "We should get only one cookie for default originAttributes");
-
-  // Remove a cookie for originAttributes with user context id 1.
-  Services.cookies.remove(COOKIE_OA_1.host, COOKIE_OA_1.name, COOKIE_OA_1.path,
-                          false, COOKIE_OA_1.originAttributes);
-
-  // Check that remove will not affect cookies in default originAttributes.
-  enumerator = Services.cookies.getCookiesFromHost(BASE_URL, COOKIE_OA_DEFAULT.originAttributes);
-  equal(countCookies(enumerator), 1, "Get one cookie for default originAttributes.");
-
-  // Check that should be no cookie for originAttributes with user context id 1.
-  enumerator = Services.cookies.getCookiesFromHost(BASE_URL, COOKIE_OA_1.originAttributes);
-  equal(countCookies(enumerator), 0, "No cookie shold be here");
-
-  // Remove a cookie for default originAttributes.
-  Services.cookies.remove(COOKIE_OA_DEFAULT.host, COOKIE_OA_DEFAULT.name, COOKIE_OA_DEFAULT.path,
-                          false, COOKIE_OA_DEFAULT.originAttributes);
-
-  // Check remove() works correctly for default originAttributes.
-  enumerator = Services.cookies.getCookiesFromHost(BASE_URL, COOKIE_OA_DEFAULT.originAttributes);
-  equal(countCookies(enumerator), 0, "No cookie shold be here");
-
-  run_next_test();
-}
--- a/netwerk/cookie/test/unit/xpcshell.ini
+++ b/netwerk/cookie/test/unit/xpcshell.ini
@@ -1,10 +1,9 @@
 [DEFAULT]
 head = 
 tail = 
 skip-if = toolkit == 'gonk'
 
 [test_bug643051.js]
 [test_bug1155169.js]
-[test_bug1267910.js]
 [test_parser_0001.js]
 [test_parser_0019.js]
--- a/netwerk/locales/en-US/necko.properties
+++ b/netwerk/locales/en-US/necko.properties
@@ -39,10 +39,10 @@ SuperfluousAuth=You are about to log in to the site “%1$S” with the username “%2$S”, but the website does not require authentication. This may be an attempt to trick you.\n\nIs “%1$S” the site you want to visit?
 AutomaticAuth=You are about to log in to the site “%1$S” with the username “%2$S”.
 
 TrackingUriBlocked=The resource at “%1$S” was blocked because tracking protection is enabled.
 
 # LOCALIZATION NOTE (APIDeprecationWarning):
 # %1$S is the deprected API; %2$S is the API function that should be used.
 APIDeprecationWarning=Warning: ‘%1$S’ deprecated, please use ‘%2$S’
 
-# LOCALIZATION NOTE (nsICookieManagerDeprecated): don't localize originAttributes.
-nsICookieManagerAPIDeprecated=“%1$S” is changed. Update your code and pass the correct originAttributes. Read more on MDN: https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieManager%2$S
+# LOCALIZATION NOTE (nsICookieManagerRemoveDeprecated): don't localize nsICookieManager.remove() and originAttributes.
+nsICookieManagerRemoveDeprecated=“nsICookieManager.remove()” is changed. Update your code and pass the correct originAttributes. Read more on MDN: https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieManager
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -592,48 +592,43 @@ main(int32_t argc, char *argv[])
 
       // *** nsICookieManager{2} interface tests
       sBuffer = PR_sprintf_append(sBuffer, "*** Beginning nsICookieManager{2} interface tests...\n");
       nsCOMPtr<nsICookieManager> cookieMgr = do_GetService(NS_COOKIEMANAGER_CONTRACTID, &rv0);
       if (NS_FAILED(rv0)) return -1;
       nsCOMPtr<nsICookieManager2> cookieMgr2 = do_QueryInterface(cookieMgr);
       if (!cookieMgr2) return -1;
 
-      mozilla::NeckoOriginAttributes attrs;
-
       // first, ensure a clean slate
       rv[0] = NS_SUCCEEDED(cookieMgr->RemoveAll());
       // add some cookies
-      rv[1] = NS_SUCCEEDED(cookieMgr2->AddNative(NS_LITERAL_CSTRING("cookiemgr.test"), // domain
+      rv[1] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("cookiemgr.test"), // domain
                                            NS_LITERAL_CSTRING("/foo"),           // path
                                            NS_LITERAL_CSTRING("test1"),          // name
                                            NS_LITERAL_CSTRING("yes"),            // value
                                            false,                             // is secure
                                            false,                             // is httponly
                                            true,                              // is session
-                                           INT64_MAX,                            // expiry time
-                                           &attrs));                         // originAttributes
-      rv[2] = NS_SUCCEEDED(cookieMgr2->AddNative(NS_LITERAL_CSTRING("cookiemgr.test"), // domain
+                                           INT64_MAX));                          // expiry time
+      rv[2] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("cookiemgr.test"), // domain
                                            NS_LITERAL_CSTRING("/foo"),           // path
                                            NS_LITERAL_CSTRING("test2"),          // name
                                            NS_LITERAL_CSTRING("yes"),            // value
                                            false,                             // is secure
                                            true,                              // is httponly
                                            true,                              // is session
-                                           PR_Now() / PR_USEC_PER_SEC + 2,       // expiry time
-                                           &attrs));                         // originAttributes
-      rv[3] = NS_SUCCEEDED(cookieMgr2->AddNative(NS_LITERAL_CSTRING("new.domain"),     // domain
+                                           PR_Now() / PR_USEC_PER_SEC + 2));     // expiry time
+      rv[3] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("new.domain"),     // domain
                                            NS_LITERAL_CSTRING("/rabbit"),        // path
                                            NS_LITERAL_CSTRING("test3"),          // name
                                            NS_LITERAL_CSTRING("yes"),            // value
                                            false,                             // is secure
                                            false,                             // is httponly
                                            true,                              // is session
-                                           INT64_MAX,                            // expiry time
-                                           &attrs));                         // originAttributes
+                                           INT64_MAX));                          // expiry time
       // confirm using enumerator
       nsCOMPtr<nsISimpleEnumerator> enumerator;
       rv[4] = NS_SUCCEEDED(cookieMgr->GetEnumerator(getter_AddRefs(enumerator)));
       int32_t i = 0;
       bool more;
       nsCOMPtr<nsICookie2> expiredCookie, newDomainCookie;
       while (NS_SUCCEEDED(enumerator->HasMoreElements(&more)) && more) {
         nsCOMPtr<nsISupports> cookie;
@@ -659,33 +654,33 @@ main(int32_t argc, char *argv[])
       // check CountCookiesFromHost()
       uint32_t hostCookies = 0;
       rv[8] = NS_SUCCEEDED(cookieMgr2->CountCookiesFromHost(NS_LITERAL_CSTRING("cookiemgr.test"), &hostCookies)) &&
               hostCookies == 2;
       // check CookieExists() using the third cookie
       bool found;
       rv[9] = NS_SUCCEEDED(cookieMgr2->CookieExists(newDomainCookie, &found)) && found;
 
+      mozilla::NeckoOriginAttributes attrs;
 
       // remove the cookie, block it, and ensure it can't be added again
       rv[10] = NS_SUCCEEDED(cookieMgr->RemoveNative(NS_LITERAL_CSTRING("new.domain"), // domain
                                                     NS_LITERAL_CSTRING("test3"),      // name
                                                     NS_LITERAL_CSTRING("/rabbit"),    // path
                                                     true,                             // is blocked
                                                     &attrs));                         // originAttributes
       rv[11] = NS_SUCCEEDED(cookieMgr2->CookieExists(newDomainCookie, &found)) && !found;
-      rv[12] = NS_SUCCEEDED(cookieMgr2->AddNative(NS_LITERAL_CSTRING("new.domain"),     // domain
+      rv[12] = NS_SUCCEEDED(cookieMgr2->Add(NS_LITERAL_CSTRING("new.domain"),     // domain
                                             NS_LITERAL_CSTRING("/rabbit"),        // path
                                             NS_LITERAL_CSTRING("test3"),          // name
                                             NS_LITERAL_CSTRING("yes"),            // value
                                             false,                             // is secure
                                             false,                             // is httponly
                                             true,                              // is session
-                                            INT64_MIN,                            // expiry time
-                                            &attrs));                         // originAttributes
+                                            INT64_MIN));                          // expiry time
       rv[13] = NS_SUCCEEDED(cookieMgr2->CookieExists(newDomainCookie, &found)) && !found;
       // sleep four seconds, to make sure the second cookie has expired
       PR_Sleep(4 * PR_TicksPerSecond());
       // check that both CountCookiesFromHost() and CookieExists() count the
       // expired cookie
       rv[14] = NS_SUCCEEDED(cookieMgr2->CountCookiesFromHost(NS_LITERAL_CSTRING("cookiemgr.test"), &hostCookies)) &&
               hostCookies == 2;
       rv[15] = NS_SUCCEEDED(cookieMgr2->CookieExists(expiredCookie, &found)) && found;
--- a/netwerk/test/unit/test_bug411952.js
+++ b/netwerk/test/unit/test_bug411952.js
@@ -1,16 +1,16 @@
 function run_test() {
   try {
     var cm = Cc["@mozilla.org/cookiemanager;1"].
              getService(Ci.nsICookieManager2);
     do_check_neq(cm, null, "Retrieving the cookie manager failed");
 
     const time = (new Date("Jan 1, 2030")).getTime() / 1000;
-    cm.add("example.com", "/", "C", "V", false, true, false, time, {});
+    cm.add("example.com", "/", "C", "V", false, true, false, time);
     const now = Math.floor((new Date()).getTime() / 1000);
 
     var enumerator = cm.enumerator, found = false;
     while (enumerator.hasMoreElements()) {
       var cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
       if (cookie.host == "example.com" &&
           cookie.path == "/" &&
           cookie.name == "C") {
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2053,18 +2053,17 @@ GeckoDriver.prototype.addCookie = functi
     Services.cookies.add(
         cookie.domain,
         cookie.path,
         cookie.name,
         cookie.value,
         cookie.secure,
         cookie.httpOnly,
         cookie.session,
-        cookie.expiry,
-        {}); // originAttributes
+        cookie.expiry);
     return true;
   };
   this.mm.addMessageListener("Marionette:addCookie", cb);
   yield this.listener.addCookie(cmd.parameters.cookie);
 };
 
 /**
  * Get all the cookies for the current domain.
@@ -2617,17 +2616,17 @@ GeckoDriver.prototype.receiveMessage = f
       }
       break;
 
     case "Marionette:getVisibleCookies":
       let [currentPath, host] = message.json;
       let isForCurrentPath = path => currentPath.indexOf(path) != -1;
       let results = [];
 
-      let en = cookieManager.getCookiesFromHost(host, {});
+      let en = cookieManager.getCookiesFromHost(host);
       while (en.hasMoreElements()) {
         let cookie = en.getNext().QueryInterface(Ci.nsICookie2);
         // take the hostname and progressively shorten
         let hostname = host;
         do {
           if ((cookie.host == "." + hostname || cookie.host == hostname) &&
               isForCurrentPath(cookie.path)) {
             results.push({
--- a/toolkit/components/extensions/ext-cookies.js
+++ b/toolkit/components/extensions/ext-cookies.js
@@ -141,23 +141,23 @@ function* query(detailsIn, props, extens
   }
 
   // We can use getCookiesFromHost for faster searching.
   let enumerator;
   let uri;
   if ("url" in details) {
     try {
       uri = NetUtil.newURI(details.url).QueryInterface(Ci.nsIURL);
-      enumerator = Services.cookies.getCookiesFromHost(uri.host, {});
+      enumerator = Services.cookies.getCookiesFromHost(uri.host);
     } catch (ex) {
       // This often happens for about: URLs
       return;
     }
   } else if ("domain" in details) {
-    enumerator = Services.cookies.getCookiesFromHost(details.domain, {});
+    enumerator = Services.cookies.getCookiesFromHost(details.domain);
   } else {
     enumerator = Services.cookies.enumerator;
   }
 
   // Based on nsCookieService::GetCookieStringInternal
   function matches(cookie) {
     function domainMatches(host) {
       return cookie.rawHost == host || (cookie.isDomain && host.endsWith(cookie.host));
@@ -283,17 +283,17 @@ extensions.registerSchemaAPI("cookies", 
         let cookieAttrs = {host: details.domain, path: path, isSecure: secure};
         if (!checkSetCookiePermissions(extension, uri, cookieAttrs)) {
           return Promise.reject({message: `Permission denied to set cookie ${JSON.stringify(details)}`});
         }
 
         // The permission check may have modified the domain, so use
         // the new value instead.
         Services.cookies.add(cookieAttrs.host, path, name, value,
-                             secure, httpOnly, isSession, expiry, {});
+                             secure, httpOnly, isSession, expiry);
 
         return self.cookies.get(details);
       },
 
       remove: function(details) {
         for (let cookie of query(details, ["url", "name", "storeId"], extension)) {
           Services.cookies.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
           // Todo: could there be multiple per subdomain?
--- a/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
@@ -121,17 +121,17 @@ function* testCookies(options) {
   extension.sendMessage("cookies-changed");
 
   yield extension.awaitFinish("cookie-permissions");
   yield extension.unload();
 
 
   function getCookies(host) {
     let cookies = [];
-    let enum_ = cookieSvc.getCookiesFromHost(host, {});
+    let enum_ = cookieSvc.getCookiesFromHost(host);
     while (enum_.hasMoreElements()) {
       cookies.push(enum_.getNext().QueryInterface(SpecialPowers.Ci.nsICookie2));
     }
     return cookies.sort((a, b) => String.localeCompare(a.name, b.name));
   }
 
   let cookies = getCookies(options.domain);
   info(`Cookies: ${cookies.map(c => `${c.name}=${c.value}`)}`);
--- a/toolkit/forgetaboutsite/ForgetAboutSite.jsm
+++ b/toolkit/forgetaboutsite/ForgetAboutSite.jsm
@@ -69,17 +69,17 @@ this.ForgetAboutSite = {
     } catch (ex) {
       Cu.reportError("Exception thrown while clearing the image cache: " +
         ex.toString());
     }
 
     // Cookies
     let cm = Cc["@mozilla.org/cookiemanager;1"].
              getService(Ci.nsICookieManager2);
-    let enumerator = cm.getCookiesFromHost(aDomain, {});
+    let enumerator = cm.getCookiesFromHost(aDomain);
     while (enumerator.hasMoreElements()) {
       let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
       cm.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
     }
 
     // EME
     let mps = Cc["@mozilla.org/gecko-media-plugin-service;1"].
                getService(Ci.mozIGeckoMediaPluginChromeService);
--- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
+++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
@@ -78,17 +78,17 @@ function promiseIsURIVisited(aURI)
  *
  * @param aDomain
  */
 function add_cookie(aDomain)
 {
   check_cookie_exists(aDomain, false);
   let cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
   cm.add(aDomain, COOKIE_PATH, COOKIE_NAME, "", false, false, false,
-         COOKIE_EXPIRY, {});
+         COOKIE_EXPIRY);
   check_cookie_exists(aDomain, true);
 }
 
 /**
  * Checks to ensure that a cookie exists or not for a domain.
  *
  * @param aDomain
  *        The domain to check for the cookie.
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
@@ -5,17 +5,17 @@
 function test() {
   Harness.installEndedCallback = install_ended;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   var cm = Components.classes["@mozilla.org/cookiemanager;1"]
                      .getService(Components.interfaces.nsICookieManager2);
   cm.add("example.com", "/browser/" + RELATIVE_DIR, "xpinstall", "true", false,
-         false, true, (Date.now() / 1000) + 60, {});
+         false, true, (Date.now() / 1000) + 60);
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
   var triggers = encodeURIComponent(JSON.stringify({
     "Cookie check": TESTROOT + "cookieRedirect.sjs?" + TESTROOT + "amosigned.xpi"
   }));
   gBrowser.selectedTab = gBrowser.addTab();
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
@@ -5,17 +5,17 @@
 function test() {
   Harness.installEndedCallback = install_ended;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   var cm = Components.classes["@mozilla.org/cookiemanager;1"]
                      .getService(Components.interfaces.nsICookieManager2);
   cm.add("example.com", "/browser/" + RELATIVE_DIR, "xpinstall", "true", false,
-         false, true, (Date.now() / 1000) + 60, {});
+         false, true, (Date.now() / 1000) + 60);
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
   Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
 
   var triggers = encodeURIComponent(JSON.stringify({
     "Cookie check": TESTROOT + "cookieRedirect.sjs?" + TESTROOT + "amosigned.xpi"
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
@@ -6,17 +6,17 @@
 function test() {
   Harness.downloadFailedCallback = download_failed;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   var cm = Components.classes["@mozilla.org/cookiemanager;1"]
                      .getService(Components.interfaces.nsICookieManager2);
   cm.add("example.org", "/browser/" + RELATIVE_DIR, "xpinstall", "true", false,
-         false, true, (Date.now() / 1000) + 60, {});
+         false, true, (Date.now() / 1000) + 60);
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
   Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
 
   var triggers = encodeURIComponent(JSON.stringify({
     "Cookie check": TESTROOT2 + "cookieRedirect.sjs?" + TESTROOT + "amosigned.xpi"