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

Side by Side Diff: netlog_viewer/alt_svc_view.js

Issue 2178423002: Bring the gh-pages branch up to date with the master branch (Closed) Base URL: https://github.com/catapult-project/catapult.git@gh-pages
Patch Set: Created 4 years, 4 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/alt_svc_view.html ('k') | netlog_viewer/bandwidth_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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * This view displays the Alt-Svc mappings. 6 * This view displays the Alt-Svc mappings.
7 */ 7 */
8 var AltSvcView = (function() { 8 var AltSvcView = (function() {
9 'use strict'; 9 'use strict';
10 10
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 AltSvcView.TAB_ID = 'tab-handle-alt-svc'; 26 AltSvcView.TAB_ID = 'tab-handle-alt-svc';
27 AltSvcView.TAB_NAME = 'Alt-Svc'; 27 AltSvcView.TAB_NAME = 'Alt-Svc';
28 AltSvcView.TAB_HASH = '#alt-svc'; 28 AltSvcView.TAB_HASH = '#alt-svc';
29 29
30 // IDs for special HTML elements in alt_svc_view.html 30 // IDs for special HTML elements in alt_svc_view.html
31 AltSvcView.MAIN_BOX_ID = 'alt-svc-view-tab-content'; 31 AltSvcView.MAIN_BOX_ID = 'alt-svc-view-tab-content';
32 AltSvcView.ALTERNATE_PROTOCOL_MAPPINGS_ID = 32 AltSvcView.ALTERNATE_PROTOCOL_MAPPINGS_ID =
33 'alt-svc-view-alternate-protocol-mappings'; 33 'alt-svc-view-alternate-protocol-mappings';
34 AltSvcView.MAPPINGS_CONTENT_ID =
35 'alt-svc-view-mappings-content';
36 AltSvcView.MAPPINGS_NO_CONTENT_ID =
37 'alt-svc-view-mappings-no-content';
38 AltSvcView.MAPPINGS_TBODY_ID = 'alt-svc-view-mappings-tbody';
34 39
35 cr.addSingletonGetter(AltSvcView); 40 cr.addSingletonGetter(AltSvcView);
36 41
37 AltSvcView.prototype = { 42 AltSvcView.prototype = {
38 // Inherit the superclass's methods. 43 // Inherit the superclass's methods.
39 __proto__: superClass.prototype, 44 __proto__: superClass.prototype,
40 45
41 onLoadLogFinish: function(data) { 46 onLoadLogFinish: function(data) {
42 // TODO(rch): Remove the check for spdyAlternateProtocolMappings after 47 // TODO(rch): Remove the check for spdyAlternateProtocolMappings after
43 // M53 (It was renamed to altSvcMappings in M50). 48 // M53 (It was renamed to altSvcMappings in M50).
44 return this.onAltSvcMappingsChanged(data.altSvcMappings || 49 return this.onAltSvcMappingsChanged(data.altSvcMappings ||
45 data.spdyAlternateProtocolMappings); 50 data.spdyAlternateProtocolMappings);
46 }, 51 },
47 52
48 /** 53 /**
49 * Displays the alternate service mappings. 54 * Displays the alternate service mappings.
50 */ 55 */
51 onAltSvcMappingsChanged: function(altSvcMappings) { 56 onAltSvcMappingsChanged: function(altSvcMappings) {
52 if (!altSvcMappings) 57 if (!altSvcMappings)
53 return false; 58 return false;
54 // TODO(rayraymond): Update DOM without use of jstemplate. 59
55 // var input = new JsEvalContext({altSvcMappings: altSvcMappings}); 60 var hasMappings = altSvcMappings && altSvcMappings.length > 0;
56 // jstProcess(input, $(AltSvcView.ALTERNATE_PROTOCOL_MAPPINGS_ID)); 61
62 setNodeDisplay($(AltSvcView.MAPPINGS_CONTENT_ID), hasMappings);
63 setNodeDisplay($(AltSvcView.MAPPINGS_NO_CONTENT_ID), !hasMappings);
64
65 var tbody = $(AltSvcView.MAPPINGS_TBODY_ID);
66 tbody.innerHTML = '';
67
68 // Fill in the alternate service mappings table.
69 for (var i = 0; i < altSvcMappings.length; ++i) {
70 var a = altSvcMappings[i];
71 var tr = addNode(tbody, 'tr');
72
73 addNodeWithText(tr, 'td', a.server);
74 addNodeWithText(tr, 'td', a.alternative_service);
75 }
76
57 return true; 77 return true;
58 } 78 }
59 }; 79 };
60 80
61 return AltSvcView; 81 return AltSvcView;
62 })(); 82 })();
OLDNEW
« no previous file with comments | « netlog_viewer/alt_svc_view.html ('k') | netlog_viewer/bandwidth_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698