Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/sidebar.js

Issue 4875867805188096: issue #660 - HTTP cache api v2 fixes (Closed)
Patch Set: Created July 4, 2014, 8:54 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld