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, 7:24 p.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);
+ let loadContext = content.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsILoadContext);
+ cacheStorage = Services.cache2.diskCacheStorage(LoadContextInfo.fromLoadContext(loadContext, false), false);
}
else
cacheStorage = Services.cache.createSession("HTTP", Ci.nsICache.STORE_ANYWHERE, true);
@@ -325,7 +329,8 @@
{
return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED;
},
- onCacheEntryAvailable: function (entry, isNew, appCache, status) {
+ onCacheEntryAvailable: function (entry, isNew, appCache, status)
+ {
if (!isNew)
showTooltipPreview();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld