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

Unified Diff: netlog_viewer/spdy_view.js

Issue 2154753002: Serving version 1 of the web app. All code has been copied from the (Closed) Base URL: https://github.com/catapult-project/catapult.git@gh-pages
Patch Set: Removed some unecessary files. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « netlog_viewer/spdy_view.html ('k') | netlog_viewer/status_view.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: netlog_viewer/spdy_view.js
diff --git a/netlog_viewer/spdy_view.js b/netlog_viewer/spdy_view.js
new file mode 100644
index 0000000000000000000000000000000000000000..d07b2795d61f49389bdb8b380cc623b8c2a5a5eb
--- /dev/null
+++ b/netlog_viewer/spdy_view.js
@@ -0,0 +1,76 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * This view displays a summary of the state of each SPDY sessions, and
+ * has links to display them in the events tab.
+ */
+var SpdyView = (function() {
+ 'use strict';
+
+ // We inherit from DivView.
+ var superClass = DivView;
+
+ /**
+ * @constructor
+ */
+ function SpdyView() {
+ assertFirstConstructorCall(SpdyView);
+
+ // Call superclass's constructor.
+ superClass.call(this, SpdyView.MAIN_BOX_ID);
+
+ g_browser.addSpdySessionInfoObserver(this, true);
+ g_browser.addSpdyStatusObserver(this, true);
+ }
+
+ SpdyView.TAB_ID = 'tab-handle-spdy';
+ SpdyView.TAB_NAME = 'HTTP/2';
+ SpdyView.TAB_HASH = '#http2';
+
+ // IDs for special HTML elements in spdy_view.html
+ SpdyView.MAIN_BOX_ID = 'spdy-view-tab-content';
+ SpdyView.STATUS_ID = 'spdy-view-status';
+ SpdyView.SESSION_INFO_ID = 'spdy-view-session-info';
+
+ cr.addSingletonGetter(SpdyView);
+
+ SpdyView.prototype = {
+ // Inherit the superclass's methods.
+ __proto__: superClass.prototype,
+
+ onLoadLogFinish: function(data) {
+ return this.onSpdySessionInfoChanged(data.spdySessionInfo) &&
+ this.onSpdyStatusChanged(data.spdyStatus);
+ },
+
+ /**
+ * If |spdySessionInfo| contains any sessions, displays a single table with
+ * information on each SPDY session. Otherwise, displays "None".
+ */
+ onSpdySessionInfoChanged: function(spdySessionInfo) {
+ if (!spdySessionInfo)
+ return false;
+ // TODO(rayraymond): Update DOM without use of jstemplate.
+ // var input = new JsEvalContext({ spdySessionInfo: spdySessionInfo });
+ // jstProcess(input, $(SpdyView.SESSION_INFO_ID));
+ return true;
+ },
+
+ /**
+ * Displays information on the global SPDY status.
+ */
+ onSpdyStatusChanged: function(spdyStatus) {
+ if (!spdyStatus)
+ return false;
+ // TODO(rayraymond): Update DOM without use of jstemplate.
+ // var input = new JsEvalContext(spdyStatus);
+ // jstProcess(input, $(SpdyView.STATUS_ID));
+ return true;
+ }
+ };
+
+ return SpdyView;
+})();
+
« no previous file with comments | « netlog_viewer/spdy_view.html ('k') | netlog_viewer/status_view.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698