Bug 1165272 - Part 3: Replace getCodebasePrincipal. r=bholley
authorYoshi Huang <allstars.chh@mozilla.com>
Mon, 24 Aug 2015 03:34:00 -0400
changeset 259014 2bd4cb790c48d3f6d3da0ea9b03ce5cfb40e6b46
parent 259013 8d116b0d696f461cd63840f1dd21430b47e740a5
child 259015 6521d38bea7a838946c9f2f1d40c985ffd911ff8
push id29268
push userryanvm@gmail.com
push dateTue, 25 Aug 2015 00:37:23 +0000
treeherdermozilla-central@08015770c9d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1165272
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1165272 - Part 3: Replace getCodebasePrincipal. r=bholley
addon-sdk/source/lib/sdk/indexed-db.js
toolkit/devtools/server/actors/storage.js
--- a/addon-sdk/source/lib/sdk/indexed-db.js
+++ b/addon-sdk/source/lib/sdk/indexed-db.js
@@ -27,19 +27,19 @@ let sanitizeId = function(id){
 
 const PSEUDOURI = "indexeddb://" + sanitizeId(id) // https://bugzilla.mozilla.org/show_bug.cgi?id=779197
 
 // Use XPCOM because `require("./url").URL` doesn't expose the raw uri object.
 let principaluri = Cc["@mozilla.org/network/io-service;1"].
               getService(Ci.nsIIOService).
               newURI(PSEUDOURI, null, null);
 
-let principal = Cc["@mozilla.org/scriptsecuritymanager;1"].
-	               getService(Ci.nsIScriptSecurityManager).
-	               getCodebasePrincipal(principaluri);
+let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
+            .getService(Ci.nsIScriptSecurityManager);
+let principal = ssm.createCodebasePrincipal(principaluri, {});
 
 function toArray(args) {
   return Array.prototype.slice.call(args);
 }
 
 function openInternal(args, forPrincipal, deleting) {
   if (forPrincipal) {
     args = toArray(args);
--- a/toolkit/devtools/server/actors/storage.js
+++ b/toolkit/devtools/server/actors/storage.js
@@ -1319,17 +1319,17 @@ let indexedDBHelpers = {
    */
   openWithOrigin: function(host, name) {
     let principal;
 
     if (/^(about:|chrome:)/.test(host)) {
       principal = Services.scriptSecurityManager.getSystemPrincipal();
     } else {
       let uri = Services.io.newURI(host, null, null);
-      principal = Services.scriptSecurityManager.getCodebasePrincipal(uri);
+      principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
     }
 
     return require("indexedDB").openForPrincipal(principal, name);
   },
 
     /**
    * Fetches all the databases and their metadata for the given `host`.
    */