| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 /** | |
| 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. | |
| 8 */ | |
| 9 var HttpPipelineView = (function() { | |
| 10 'use strict'; | |
| 11 | |
| 12 // We inherit from DivView. | |
| 13 var superClass = DivView; | |
| 14 | |
| 15 /** | |
| 16 * @constructor | |
| 17 */ | |
| 18 function HttpPipelineView() { | |
| 19 assertFirstConstructorCall(HttpPipelineView); | |
| 20 | |
| 21 // Call superclass's constructor. | |
| 22 superClass.call(this, HttpPipelineView.MAIN_BOX_ID); | |
| 23 | |
| 24 g_browser.addHttpPipeliningStatusObserver(this, true); | |
| 25 } | |
| 26 | |
| 27 HttpPipelineView.TAB_ID = 'tab-handle-http-pipeline'; | |
| 28 HttpPipelineView.TAB_NAME = 'Pipelining'; | |
| 29 HttpPipelineView.TAB_HASH = '#httpPipeline'; | |
| 30 | |
| 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'; | |
| 36 | |
| 37 cr.addSingletonGetter(HttpPipelineView); | |
| 38 | |
| 39 HttpPipelineView.prototype = { | |
| 40 // Inherit the superclass's methods. | |
| 41 __proto__: superClass.prototype, | |
| 42 | |
| 43 onLoadLogFinish: function(data) { | |
| 44 return this.onHttpPipeliningStatusChanged(data.httpPipeliningStatus); | |
| 45 }, | |
| 46 | |
| 47 /** | |
| 48 * Displays information on the global HTTP pipelining status. | |
| 49 */ | |
| 50 onHttpPipeliningStatusChanged: function(httpPipeliningStatus) { | |
| 51 if (!httpPipeliningStatus) | |
| 52 return false; | |
| 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; | |
| 57 }, | |
| 58 }; | |
| 59 | |
| 60 return HttpPipelineView; | |
| 61 })(); | |
| OLD | NEW |