Bug 1413394 - Port relevant parts of |Bug 1407720 - Merge nsICookieManager and nsICookieManager2| to suite r=IanN
authorEdmund Wong <ewong@pw-wspx.org>
Wed, 01 Nov 2017 14:34:42 +0800
changeset 29299 952762964f408e33d060dd1110cac0626ae5fa51
parent 29298 0cac090f60803e4d922817906ce77386feab6c08
child 29300 7b60e6e99b88f07d1eebad0def13446155c29140
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1413394, 1407720
Bug 1413394 - Port relevant parts of |Bug 1407720 - Merge nsICookieManager and nsICookieManager2| to suite r=IanN
suite/common/tests/browser/browser_423132.js
suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
--- a/suite/common/tests/browser/browser_423132.js
+++ b/suite/common/tests/browser/browser_423132.js
@@ -16,17 +16,17 @@ function browserWindowsCount() {
 
 function test() {
   // test that cookies are stored and restored correctly by sessionstore,
   // bug 423132, ported by bug 524371.
   is(browserWindowsCount(), 1, "Only one browser window should be open initially");
 
   waitForExplicitFinish();
 
-  let cs = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager2);
+  let cs = Components.classes["@mozilla.org/cookiemanager;1"].getService(Components.interfaces.nsICookieManager);
   cs.removeAll();
 
   // make sure that sessionstore.js can be forced to be created by setting
   // the interval pref to 0
   Services.prefs.setIntPref("browser.sessionstore.interval", 0);
 
   const testURL = "http://mochi.test:8888/browser/" +
     "suite/common/tests/browser/browser_423132_sample.html";
--- a/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsSuiteProfileMigratorUtils.h"
 #include "nsCRT.h"
-#include "nsICookieManager2.h"
+#include "nsICookieManager.h"
 #include "nsIFile.h"
 #include "nsILineInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefLocalizedString.h"
 #include "nsIPrefService.h"
 #include "nsIServiceManager.h"
 #include "nsISupportsPrimitives.h"
@@ -654,17 +654,17 @@ nsNetscapeProfileMigratorBase::CopyCooki
     mTargetProfile->Clone(getter_AddRefs(targetFile));
     targetFile->AppendNative(NS_LITERAL_CSTRING(FILE_NAME_COOKIES_SQLITE));
     targetFile->Remove(false);
 
     return CopyFile(FILE_NAME_COOKIES, FILE_NAME_COOKIES);
   }
 
   nsresult rv;
-  nsCOMPtr<nsICookieManager2> cookieManager(do_GetService(NS_COOKIEMANAGER_CONTRACTID, &rv));
+  nsCOMPtr<nsICookieManager> cookieManager(do_GetService(NS_COOKIEMANAGER_CONTRACTID, &rv));
   if (NS_FAILED(rv))
     return rv;
 
   nsCOMPtr<nsIFile> seamonkeyCookiesFile;
   mSourceProfile->Clone(getter_AddRefs(seamonkeyCookiesFile));
   seamonkeyCookiesFile->AppendNative(NS_LITERAL_CSTRING(FILE_NAME_COOKIES));
 
   return cookieManager->ImportCookies(seamonkeyCookiesFile);