cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / net_internals / spdy_view.js
blobe7146807e29f3870f15276785a1b6f28f092e8fb
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
3 // found in the LICENSE file.
5 /**
6 * This view displays a summary of the state of each SPDY sessions, and
7 * has links to display them in the events tab.
8 */
9 var SpdyView = (function() {
10 'use strict';
12 // We inherit from DivView.
13 var superClass = DivView;
15 /**
16 * @constructor
18 function SpdyView() {
19 assertFirstConstructorCall(SpdyView);
21 // Call superclass's constructor.
22 superClass.call(this, SpdyView.MAIN_BOX_ID);
24 g_browser.addSpdySessionInfoObserver(this, true);
25 g_browser.addSpdyStatusObserver(this, true);
26 g_browser.addSpdyAlternateProtocolMappingsObserver(this, true);
29 SpdyView.TAB_ID = 'tab-handle-spdy';
30 SpdyView.TAB_NAME = 'HTTP/2';
31 SpdyView.TAB_HASH = '#http2';
33 // IDs for special HTML elements in spdy_view.html
34 SpdyView.MAIN_BOX_ID = 'spdy-view-tab-content';
35 SpdyView.STATUS_ID = 'spdy-view-status';
36 SpdyView.SESSION_INFO_ID = 'spdy-view-session-info';
37 SpdyView.ALTERNATE_PROTOCOL_MAPPINGS_ID =
38 'spdy-view-alternate-protocol-mappings';
40 cr.addSingletonGetter(SpdyView);
42 SpdyView.prototype = {
43 // Inherit the superclass's methods.
44 __proto__: superClass.prototype,
46 onLoadLogFinish: function(data) {
47 return this.onSpdySessionInfoChanged(data.spdySessionInfo) &&
48 this.onSpdyStatusChanged(data.spdyStatus) &&
49 this.onSpdyAlternateProtocolMappingsChanged(
50 data.spdyAlternateProtocolMappings);
53 /**
54 * If |spdySessionInfo| contains any sessions, displays a single table with
55 * information on each SPDY session. Otherwise, displays "None".
57 onSpdySessionInfoChanged: function(spdySessionInfo) {
58 if (!spdySessionInfo)
59 return false;
60 var input = new JsEvalContext({ spdySessionInfo: spdySessionInfo });
61 jstProcess(input, $(SpdyView.SESSION_INFO_ID));
62 return true;
65 /**
66 * Displays information on the global SPDY status.
68 onSpdyStatusChanged: function(spdyStatus) {
69 if (!spdyStatus)
70 return false;
71 var input = new JsEvalContext(spdyStatus);
72 jstProcess(input, $(SpdyView.STATUS_ID));
73 return true;
76 /**
77 * Displays information on the SPDY alternate protocol mappings.
79 onSpdyAlternateProtocolMappingsChanged: function(
80 spdyAlternateProtocolMappings) {
81 if (!spdyAlternateProtocolMappings)
82 return false;
83 var input = new JsEvalContext(
84 {spdyAlternateProtocolMappings: spdyAlternateProtocolMappings});
85 jstProcess(input, $(SpdyView.ALTERNATE_PROTOCOL_MAPPINGS_ID));
86 return true;
90 return SpdyView;
91 })();