diff --git a/toolkit/components/places/BookmarkJSONUtils.jsm b/toolkit/components/places/BookmarkJSONUtils.jsm index f99708c151c2..4a68e26c0b28 100644 --- a/toolkit/components/places/BookmarkJSONUtils.jsm +++ b/toolkit/components/places/BookmarkJSONUtils.jsm @@ -208,14 +208,13 @@ BookmarkImporter.prototype = { let uri = NetUtil.newURI(spec); let channel = NetUtil.newChannel({ - uri, - loadingPrincipal: Services.scriptSecurityManager.createCodebasePrincipal(uri, {}), - contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_XMLHTTPREQUEST + uri: uri, + loadUsingSystemPrincipal: true }); let streamLoader = Cc["@mozilla.org/network/stream-loader;1"] .createInstance(Ci.nsIStreamLoader); streamLoader.init(streamObserver); - channel.asyncOpen(streamLoader, channel); + channel.asyncOpen2(streamLoader); }); }, diff --git a/toolkit/components/places/nsLivemarkService.js b/toolkit/components/places/nsLivemarkService.js index 32fd46e82dc6..3f67e5c604da 100644 --- a/toolkit/components/places/nsLivemarkService.js +++ b/toolkit/components/places/nsLivemarkService.js @@ -528,9 +528,14 @@ Livemark.prototype = { // cancel the channel. let loadgroup = Cc["@mozilla.org/network/load-group;1"]. createInstance(Ci.nsILoadGroup); + // Creating a CodeBasePrincipal and using it as the loadingPrincipal + // is *not* desired and is only tolerated within this file. + // TODO: Find the right OriginAttributes and pass something other + // than {} to .createCodeBasePrincipal(). let channel = NetUtil.newChannel({ - uri: this.feedURI.spec, + uri: this.feedURI, loadingPrincipal: Services.scriptSecurityManager.createCodebasePrincipal(this.feedURI, {}), + securityFlags: Ci.nsILoadInfo.SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED, contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_XMLHTTPREQUEST }).QueryInterface(Ci.nsIHttpChannel); channel.loadGroup = loadgroup; @@ -542,7 +547,7 @@ Livemark.prototype = { // Stream the result to the feed parser with this listener let listener = new LivemarkLoadListener(this); channel.notificationCallbacks = listener; - channel.asyncOpen(listener, null); + channel.asyncOpen2(listener); this.loadGroup = loadgroup; }