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.
6 * This view displays a summary of the state of each HTTP pipelined connection,
7 * and has links to display them in the events tab.
9 var HttpPipelineView = (function() {
12 // We inherit from DivView.
13 var superClass = DivView;
18 function HttpPipelineView() {
19 assertFirstConstructorCall(HttpPipelineView);
21 // Call superclass's constructor.
22 superClass.call(this, HttpPipelineView.MAIN_BOX_ID);
24 g_browser.addHttpPipeliningStatusObserver(this, true);
27 HttpPipelineView.TAB_ID = 'tab-handle-http-pipeline';
28 HttpPipelineView.TAB_NAME = 'Pipelining';
29 HttpPipelineView.TAB_HASH = '#httpPipeline';
31 // IDs for special HTML elements in http_pipeline_view.html
32 HttpPipelineView.MAIN_BOX_ID = 'http-pipeline-view-tab-content';
33 HttpPipelineView.ENABLED_SPAN_ID = 'http-pipeline-view-enabled-span';
34 HttpPipelineView.KNOWN_HOSTS_TABLE_ID =
35 'http-pipeline-view-known-hosts-table';
37 cr.addSingletonGetter(HttpPipelineView);
39 HttpPipelineView.prototype = {
40 // Inherit the superclass's methods.
41 __proto__: superClass.prototype,
43 onLoadLogFinish: function(data) {
44 return this.onHttpPipeliningStatusChanged(data.httpPipeliningStatus);
48 * Displays information on the global HTTP pipelining status.
50 onHttpPipeliningStatusChanged: function(httpPipeliningStatus) {
51 if (!httpPipeliningStatus)
53 var input = new JsEvalContext(httpPipeliningStatus);
54 jstProcess(input, $(HttpPipelineView.MAIN_BOX_ID));
55 // Hide view in loaded logs if pipelining isn't enabled.
56 return httpPipeliningStatus.pipelining_enabled;
60 return HttpPipelineView;