| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 * @param {!WebInspector.NetworkRequest} request | 8 * @param {!WebInspector.NetworkRequest} request |
| 9 */ | 9 */ |
| 10 WebInspector.EventSourceMessagesView = function(request) | 10 WebInspector.EventSourceMessagesView = function(request) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 this._dataGrid.setStickToBottom(true); | 25 this._dataGrid.setStickToBottom(true); |
| 26 this._dataGrid.markColumnAsSortedBy("time", WebInspector.DataGrid.Order.Asce
nding); | 26 this._dataGrid.markColumnAsSortedBy("time", WebInspector.DataGrid.Order.Asce
nding); |
| 27 this._sortItems(); | 27 this._sortItems(); |
| 28 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged,
this._sortItems, this); | 28 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged,
this._sortItems, this); |
| 29 | 29 |
| 30 this._dataGrid.setName("EventSourceMessagesView"); | 30 this._dataGrid.setName("EventSourceMessagesView"); |
| 31 this._dataGrid.asWidget().show(this.element); | 31 this._dataGrid.asWidget().show(this.element); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 WebInspector.EventSourceMessagesView.prototype = { | 34 WebInspector.EventSourceMessagesView.prototype = { |
| 35 /** |
| 36 * @override |
| 37 */ |
| 35 wasShown: function() | 38 wasShown: function() |
| 36 { | 39 { |
| 37 this._dataGrid.rootNode().removeChildren(); | 40 this._dataGrid.rootNode().removeChildren(); |
| 38 var messages = this._request.eventSourceMessages(); | 41 var messages = this._request.eventSourceMessages(); |
| 39 for (var i = 0; i < messages.length; ++i) | 42 for (var i = 0; i < messages.length; ++i) |
| 40 this._dataGrid.insertChild(new WebInspector.EventSourceMessageNode(m
essages[i])); | 43 this._dataGrid.insertChild(new WebInspector.EventSourceMessageNode(m
essages[i])); |
| 41 | 44 |
| 42 this._request.addEventListener(WebInspector.NetworkRequest.Events.EventS
ourceMessageAdded, this._messageAdded, this); | 45 this._request.addEventListener(WebInspector.NetworkRequest.Events.EventS
ourceMessageAdded, this._messageAdded, this); |
| 43 }, | 46 }, |
| 44 | 47 |
| 48 /** |
| 49 * @override |
| 50 */ |
| 45 willHide: function() | 51 willHide: function() |
| 46 { | 52 { |
| 47 this._request.removeEventListener(WebInspector.NetworkRequest.Events.Eve
ntSourceMessageAdded, this._messageAdded, this); | 53 this._request.removeEventListener(WebInspector.NetworkRequest.Events.Eve
ntSourceMessageAdded, this._messageAdded, this); |
| 48 }, | 54 }, |
| 49 | 55 |
| 50 /** | 56 /** |
| 51 * @param {!WebInspector.Event} event | 57 * @param {!WebInspector.Event} event |
| 52 */ | 58 */ |
| 53 _messageAdded: function(event) | 59 _messageAdded: function(event) |
| 54 { | 60 { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 var bValue = b._message[field]; | 108 var bValue = b._message[field]; |
| 103 return aValue < bValue ? -1 : aValue > bValue ? 1 : 0; | 109 return aValue < bValue ? -1 : aValue > bValue ? 1 : 0; |
| 104 }; | 110 }; |
| 105 | 111 |
| 106 /** @type {!Object.<string, !WebInspector.SortableDataGrid.NodeComparator>} */ | 112 /** @type {!Object.<string, !WebInspector.SortableDataGrid.NodeComparator>} */ |
| 107 WebInspector.EventSourceMessageNode.Comparators = { | 113 WebInspector.EventSourceMessageNode.Comparators = { |
| 108 "id": WebInspector.EventSourceMessageNodeComparator.bind(null, "eventId"), | 114 "id": WebInspector.EventSourceMessageNodeComparator.bind(null, "eventId"), |
| 109 "type": WebInspector.EventSourceMessageNodeComparator.bind(null, "eventName"
), | 115 "type": WebInspector.EventSourceMessageNodeComparator.bind(null, "eventName"
), |
| 110 "time": WebInspector.EventSourceMessageNodeComparator.bind(null, "time") | 116 "time": WebInspector.EventSourceMessageNodeComparator.bind(null, "time") |
| 111 }; | 117 }; |
| OLD | NEW |