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

Side by Side Diff: netlog_viewer/http_cache_view.js

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « netlog_viewer/http_cache_view.html ('k') | netlog_viewer/import_view.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * This view displays information on the HTTP cache.
7 */
8 var HttpCacheView = (function() {
9 'use strict';
10
11 // We inherit from DivView.
12 var superClass = DivView;
13
14 /**
15 * @constructor
16 */
17 function HttpCacheView() {
18 assertFirstConstructorCall(HttpCacheView);
19
20 // Call superclass's constructor.
21 superClass.call(this, HttpCacheView.MAIN_BOX_ID);
22
23 this.statsDiv_ = $(HttpCacheView.STATS_DIV_ID);
24
25 // Register to receive http cache info.
26 g_browser.addHttpCacheInfoObserver(this, true);
27 }
28
29 HttpCacheView.TAB_ID = 'tab-handle-http-cache';
30 HttpCacheView.TAB_NAME = 'Cache';
31 HttpCacheView.TAB_HASH = '#httpCache';
32
33 // IDs for special HTML elements in http_cache_view.html
34 HttpCacheView.MAIN_BOX_ID = 'http-cache-view-tab-content';
35 HttpCacheView.STATS_DIV_ID = 'http-cache-view-cache-stats';
36
37 cr.addSingletonGetter(HttpCacheView);
38
39 HttpCacheView.prototype = {
40 // Inherit the superclass's methods.
41 __proto__: superClass.prototype,
42
43 onLoadLogFinish: function(data) {
44 return this.onHttpCacheInfoChanged(data.httpCacheInfo);
45 },
46
47 onHttpCacheInfoChanged: function(info) {
48 this.statsDiv_.innerHTML = '';
49
50 if (!info)
51 return false;
52
53 // Print the statistics.
54 var statsUl = addNode(this.statsDiv_, 'ul');
55 for (var statName in info.stats) {
56 var li = addNode(statsUl, 'li');
57 addTextNode(li, statName + ': ' + info.stats[statName]);
58 }
59 return true;
60 }
61 };
62
63 return HttpCacheView;
64 })();
65
OLDNEW
« no previous file with comments | « netlog_viewer/http_cache_view.html ('k') | netlog_viewer/import_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698