Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js

Issue 2450663004: DevTools: do not allow using 'this' before call into super. (Closed)
Patch Set: rebaselined Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 }; 191 };
192 192
193 /** 193 /**
194 * @constructor 194 * @constructor
195 * @extends {WebInspector.SortableDataGridNode} 195 * @extends {WebInspector.SortableDataGridNode}
196 * @param {string} url 196 * @param {string} url
197 * @param {!WebInspector.NetworkRequest.WebSocketFrame} frame 197 * @param {!WebInspector.NetworkRequest.WebSocketFrame} frame
198 */ 198 */
199 WebInspector.ResourceWebSocketFrameNode = function(url, frame) 199 WebInspector.ResourceWebSocketFrameNode = function(url, frame)
200 { 200 {
201 this._frame = frame; 201 var dataText = frame.text;
202 this._dataText = frame.text;
203 this._url = url;
204 var length = frame.text.length; 202 var length = frame.text.length;
205 var time = new Date(frame.time * 1000); 203 var time = new Date(frame.time * 1000);
206 var timeText = ("0" + time.getHours()).substr(-2) + ":" + ("0" + time.getMin utes()).substr(-2) + ":" + ("0" + time.getSeconds()).substr(-2) + "." + ("00" + time.getMilliseconds()).substr(-3); 204 var timeText = ("0" + time.getHours()).substr(-2) + ":" + ("0" + time.getMin utes()).substr(-2) + ":" + ("0" + time.getSeconds()).substr(-2) + "." + ("00" + time.getMilliseconds()).substr(-3);
207 var timeNode = createElement("div"); 205 var timeNode = createElement("div");
208 timeNode.createTextChild(timeText); 206 timeNode.createTextChild(timeText);
209 timeNode.title = time.toLocaleString(); 207 timeNode.title = time.toLocaleString();
210 208
211 this._isTextFrame = frame.opCode === WebInspector.ResourceWebSocketFrameView .OpCodes.TextFrame; 209 var isTextFrame = frame.opCode === WebInspector.ResourceWebSocketFrameView.O pCodes.TextFrame;
212 if (!this._isTextFrame) 210 if (!isTextFrame)
213 this._dataText = WebInspector.ResourceWebSocketFrameView.opCodeDescripti on(frame.opCode, frame.mask); 211 dataText = WebInspector.ResourceWebSocketFrameView.opCodeDescription(fra me.opCode, frame.mask);
214 212
215 WebInspector.SortableDataGridNode.call(this, {data: this._dataText, length: length, time: timeNode}); 213 WebInspector.SortableDataGridNode.call(this, {data: dataText, length: length , time: timeNode});
214
215 this._url = url;
216 this._frame = frame;
217 this._isTextFrame = isTextFrame;
218 this._dataText = dataText;
216 }; 219 };
217 220
218 WebInspector.ResourceWebSocketFrameNode.prototype = { 221 WebInspector.ResourceWebSocketFrameNode.prototype = {
219 /** 222 /**
220 * @override 223 * @override
221 */ 224 */
222 createCells: function() 225 createCells: function()
223 { 226 {
224 var element = this._element; 227 var element = this._element;
225 element.classList.toggle("websocket-frame-view-row-error", this._frame.t ype === WebInspector.NetworkRequest.WebSocketFrameType.Error); 228 element.classList.toggle("websocket-frame-view-row-error", this._frame.t ype === WebInspector.NetworkRequest.WebSocketFrameType.Error);
(...skipping 24 matching lines...) Expand all
250 253
251 /** 254 /**
252 * @param {!WebInspector.ResourceWebSocketFrameNode} a 255 * @param {!WebInspector.ResourceWebSocketFrameNode} a
253 * @param {!WebInspector.ResourceWebSocketFrameNode} b 256 * @param {!WebInspector.ResourceWebSocketFrameNode} b
254 * @return {number} 257 * @return {number}
255 */ 258 */
256 WebInspector.ResourceWebSocketFrameNodeTimeComparator = function(a, b) 259 WebInspector.ResourceWebSocketFrameNodeTimeComparator = function(a, b)
257 { 260 {
258 return a._frame.time - b._frame.time; 261 return a._frame.time - b._frame.time;
259 }; 262 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698