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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 * @constructor | 161 * @constructor |
162 * @extends {WebInspector.SortableDataGridNode} | 162 * @extends {WebInspector.SortableDataGridNode} |
163 * @param {!WebInspector.NetworkRequest.WebSocketFrame} frame | 163 * @param {!WebInspector.NetworkRequest.WebSocketFrame} frame |
164 */ | 164 */ |
165 WebInspector.ResourceWebSocketFrameNode = function(frame) | 165 WebInspector.ResourceWebSocketFrameNode = function(frame) |
166 { | 166 { |
167 this._frame = frame; | 167 this._frame = frame; |
168 this._dataText = frame.text; | 168 this._dataText = frame.text; |
169 var length = frame.text.length; | 169 var length = frame.text.length; |
170 var time = new Date(frame.time * 1000); | 170 var time = new Date(frame.time * 1000); |
171 var timeText = ("0" + time.getHours()).substr(-2) + ":" + ("0" + time.getMin
utes()).substr(-2)+ ":" + ("0" + time.getSeconds()).substr(-2) + "." + ("00" + t
ime.getMilliseconds()).substr(-3); | 171 var timeText = ("0" + time.getHours()).substr(-2) + ":" + ("0" + time.getMin
utes()).substr(-2) + ":" + ("0" + time.getSeconds()).substr(-2) + "." + ("00" +
time.getMilliseconds()).substr(-3); |
172 var timeNode = createElement("div"); | 172 var timeNode = createElement("div"); |
173 timeNode.createTextChild(timeText); | 173 timeNode.createTextChild(timeText); |
174 timeNode.title = time.toLocaleString(); | 174 timeNode.title = time.toLocaleString(); |
175 | 175 |
176 this._isTextFrame = frame.opCode === WebInspector.ResourceWebSocketFrameView
.OpCodes.TextFrame; | 176 this._isTextFrame = frame.opCode === WebInspector.ResourceWebSocketFrameView
.OpCodes.TextFrame; |
177 if (!this._isTextFrame) | 177 if (!this._isTextFrame) |
178 this._dataText = WebInspector.ResourceWebSocketFrameView.opCodeDescripti
on(frame.opCode, frame.mask); | 178 this._dataText = WebInspector.ResourceWebSocketFrameView.opCodeDescripti
on(frame.opCode, frame.mask); |
179 | 179 |
180 WebInspector.SortableDataGridNode.call(this, {data: this._dataText, length:
length, time: timeNode}); | 180 WebInspector.SortableDataGridNode.call(this, {data: this._dataText, length:
length, time: timeNode}); |
181 } | 181 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 /** | 216 /** |
217 * @param {!WebInspector.ResourceWebSocketFrameNode} a | 217 * @param {!WebInspector.ResourceWebSocketFrameNode} a |
218 * @param {!WebInspector.ResourceWebSocketFrameNode} b | 218 * @param {!WebInspector.ResourceWebSocketFrameNode} b |
219 * @return {number} | 219 * @return {number} |
220 */ | 220 */ |
221 WebInspector.ResourceWebSocketFrameNodeTimeComparator = function(a, b) | 221 WebInspector.ResourceWebSocketFrameNodeTimeComparator = function(a, b) |
222 { | 222 { |
223 return a._frame.time - b._frame.time; | 223 return a._frame.time - b._frame.time; |
224 } | 224 } |
OLD | NEW |