Index: chrome/content/ui/sidebar.js |
=================================================================== |
--- a/chrome/content/ui/sidebar.js |
+++ b/chrome/content/ui/sidebar.js |
@@ -200,6 +200,7 @@ |
if (item) |
treeView.addItem(node, item, scanComplete); |
}); |
+ cacheStorage = null; |
} |
// Fills a box with text splitting it up into multiple lines if necessary |
@@ -302,10 +303,13 @@ |
{ |
let {Services} = Cu.import("resource://gre/modules/Services.jsm", null); |
// Cache v2 API is enabled by default starting with Gecko 32 |
- if (Services.vc.compare(Utils.platformVersion, "32.0") >= 0) |
+ if (Services.vc.compare(Utils.platformVersion, "32.0a1") >= 0) |
{ |
let {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", null); |
- cacheStorage = Services.cache2.diskCacheStorage(LoadContextInfo.default, true); |
+ cacheStorage = Services.cache2.diskCacheStorage(LoadContextInfo.fromLoadContext( |
+ content.QueryInterface(Ci.nsIInterfaceRequestor) |
+ .getInterface(Ci.nsIWebNavigation) |
+ .QueryInterface(Ci.nsILoadContext), false), false); |
Wladimir Palant
2014/07/04 18:09:00
Nit: The indentation here is strange, normally you
saroyanm
2014/07/04 19:32:12
Done.
|
} |
else |
cacheStorage = Services.cache.createSession("HTTP", Ci.nsICache.STORE_ANYWHERE, true); |
@@ -321,11 +325,11 @@ |
if (Ci.nsICacheStorage && cacheStorage instanceof Ci.nsICacheStorage) |
{ |
cacheStorage.asyncOpenURI(Utils.makeURI(item.location), "", Ci.nsICacheStorage.OPEN_READONLY, { |
- onCacheEntryCheck: function (entry, appCache) |
Wladimir Palant
2014/07/04 18:09:00
Please don't remove the parameters even if you don
saroyanm
2014/07/04 19:32:12
My bad.
|
+ onCacheEntryCheck: function () |
{ |
return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; |
}, |
- onCacheEntryAvailable: function (entry, isNew, appCache, status) { |
+ onCacheEntryAvailable: function (entry, isNew) { |
if (!isNew) |
showTooltipPreview(); |
} |
@@ -334,7 +338,7 @@ |
else |
{ |
cacheStorage.asyncOpenCacheEntry(item.location, Ci.nsICache.ACCESS_READ, { |
- onCacheEntryAvailable: function(descriptor, accessGranted, status) |
+ onCacheEntryAvailable: function(descriptor) |
{ |
if (!descriptor) |
return; |