Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2477)

Unified Diff: chrome/browser/resources/net_internals/main.js

Issue 2011009: Add the http cache info to chrome://net2. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/net_internals/main.css ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/main.js
===================================================================
--- chrome/browser/resources/net_internals/main.js (revision 46639)
+++ chrome/browser/resources/net_internals/main.js (working copy)
@@ -66,6 +66,11 @@
var testView = new TestView("testTabContent", "testUrlInput", "testStart",
"testSummary");
+ var httpCacheView = new HttpCacheView("httpCacheTabContent",
+ "reloadHttpCacheListing",
+ "httpCacheStats",
+ "httpCacheListing");
+
// Create a view which lets you tab between the different sub-views.
var categoryTabSwitcher =
new TabSwitcherView(new DivView('categoryTabHandles'));
@@ -76,8 +81,7 @@
categoryTabSwitcher.addTab('dnsTab', dnsView, false);
categoryTabSwitcher.addTab('socketsTab', new DivView('socketsTabContent'),
false);
- categoryTabSwitcher.addTab('httpCacheTab',
- new DivView('httpCacheTabContent'), false);
+ categoryTabSwitcher.addTab('httpCacheTab', httpCacheView, false);
categoryTabSwitcher.addTab('dataTab', dataView, false);
categoryTabSwitcher.addTab('testTab', testView, false);
@@ -121,6 +125,7 @@
// List of observers for various bits of browser state.
this.logObservers_ = [];
this.connectionTestsObservers_ = [];
+ this.httpCacheInfoObservers_ = [];
this.proxySettings_ = new PollableDataHelper('onProxySettingsChanged');
this.badProxies_ = new PollableDataHelper('onBadProxiesChanged');
this.hostResolverCache_ =
@@ -183,6 +188,10 @@
chrome.send('startConnectionTests', [url]);
};
+BrowserBridge.prototype.sendGetHttpCacheInfo = function() {
+ chrome.send('getHttpCacheInfo');
+};
+
//------------------------------------------------------------------------------
// Messages received from the browser
//------------------------------------------------------------------------------
@@ -261,6 +270,11 @@
this.connectionTestsObservers_[i].onCompletedConnectionTestSuite();
};
+BrowserBridge.prototype.receivedHttpCacheInfo = function(info) {
+ for (var i = 0; i < this.httpCacheInfoObservers_.length; ++i)
+ this.httpCacheInfoObservers_[i].onHttpCacheInfoReceived(info);
+};
+
//------------------------------------------------------------------------------
/**
@@ -325,6 +339,16 @@
};
/**
+ * Adds a listener for the http cache info results.
+ * The observer will be called back with:
+ *
+ * observer.onHttpCacheInfoReceived(info);
+ */
+BrowserBridge.prototype.addHttpCacheInfoObserver = function(observer) {
+ this.httpCacheInfoObservers_.push(observer);
+};
+
+/**
* The browser gives us times in terms of "time ticks" in milliseconds.
* This function converts the tick count to a Date() object.
*
« no previous file with comments | « chrome/browser/resources/net_internals/main.css ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698