OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. | 2 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Lesser General Public | 5 * modify it under the terms of the GNU Lesser General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 var frame = /** @type {!WebInspector.NetworkRequest.WebSocketFrame} */ ( event.data); | 111 var frame = /** @type {!WebInspector.NetworkRequest.WebSocketFrame} */ ( event.data); |
112 this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNode(f rame)); | 112 this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNode(f rame)); |
113 }, | 113 }, |
114 | 114 |
115 /** | 115 /** |
116 * @param {!WebInspector.Event} event | 116 * @param {!WebInspector.Event} event |
117 */ | 117 */ |
118 _onFrameSelected: function(event) | 118 _onFrameSelected: function(event) |
119 { | 119 { |
120 var selectedNode = /** @type {!WebInspector.ResourceWebSocketFrameNode} */ (event.target.selectedNode); | 120 var selectedNode = /** @type {!WebInspector.ResourceWebSocketFrameNode} */ (event.target.selectedNode); |
121 if (this._messageView) | 121 var contentProvider = selectedNode.contentProvider(); |
caseq
2015/11/20 22:23:41
nit: drop the var?
alph
2015/11/20 22:38:46
noway
| |
122 this._messageView.detach(); | 122 contentProvider.requestContent(contentReady.bind(this)); |
123 if (this._dataView) | 123 /** |
124 this._dataView.detach(); | 124 * @this {WebInspector.ResourceWebSocketFrameView} |
caseq
2015/11/20 22:23:41
nit: @param, then @this?
alph
2015/11/20 22:38:46
Done.
| |
125 this._dataView = new WebInspector.ResourceSourceFrame(selectedNode.conte ntProvider()); | 125 * @param {?string} content |
126 this._splitWidget.setSidebarWidget(this._dataView); | 126 */ |
127 function contentReady(content) | |
128 { | |
129 if (this._messageView) | |
caseq
2015/11/20 22:23:41
s/this._messageView/this._currentView/ and nuke th
alph
2015/11/20 22:38:46
I can go deeper.
| |
130 this._messageView.detach(); | |
131 if (this._dataView) | |
132 this._dataView.detach(); | |
133 var parsedJSON = content ? WebInspector.JSONView.parseJSON(content) : null; | |
134 this._dataView = parsedJSON ? new WebInspector.JSONView(parsedJSON) : new WebInspector.ResourceSourceFrame(contentProvider); | |
135 this._splitWidget.setSidebarWidget(this._dataView); | |
136 } | |
127 }, | 137 }, |
128 | 138 |
129 refresh: function() | 139 refresh: function() |
130 { | 140 { |
131 this._dataGrid.rootNode().removeChildren(); | 141 this._dataGrid.rootNode().removeChildren(); |
132 var frames = this._request.frames(); | 142 var frames = this._request.frames(); |
133 for (var i = 0; i < frames.length; ++i) | 143 for (var i = 0; i < frames.length; ++i) |
134 this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNo de(frames[i])); | 144 this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNo de(frames[i])); |
135 }, | 145 }, |
136 | 146 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 | 227 |
218 /** | 228 /** |
219 * @param {!WebInspector.ResourceWebSocketFrameNode} a | 229 * @param {!WebInspector.ResourceWebSocketFrameNode} a |
220 * @param {!WebInspector.ResourceWebSocketFrameNode} b | 230 * @param {!WebInspector.ResourceWebSocketFrameNode} b |
221 * @return {number} | 231 * @return {number} |
222 */ | 232 */ |
223 WebInspector.ResourceWebSocketFrameNodeTimeComparator = function(a, b) | 233 WebInspector.ResourceWebSocketFrameNodeTimeComparator = function(a, b) |
224 { | 234 { |
225 return a._frame.time - b._frame.time; | 235 return a._frame.time - b._frame.time; |
226 } | 236 } |
OLD | NEW |