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

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

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline Created 4 years, 11 months 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNode(f rame)); 110 this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNode(f rame));
111 }, 111 },
112 112
113 /** 113 /**
114 * @param {!WebInspector.Event} event 114 * @param {!WebInspector.Event} event
115 */ 115 */
116 _onFrameSelected: function(event) 116 _onFrameSelected: function(event)
117 { 117 {
118 var selectedNode = /** @type {!WebInspector.ResourceWebSocketFrameNode} */ (event.target.selectedNode); 118 var selectedNode = /** @type {!WebInspector.ResourceWebSocketFrameNode} */ (event.target.selectedNode);
119 var contentProvider = selectedNode.contentProvider(); 119 var contentProvider = selectedNode.contentProvider();
120 contentProvider.requestContent(content => { 120 contentProvider.requestContent().then(content => {
121 var parsedJSON = content ? WebInspector.JSONView.parseJSON(content) : null; 121 var parsedJSON = content ? WebInspector.JSONView.parseJSON(content) : null;
122 var view = parsedJSON ? new WebInspector.JSONView(parsedJSON) : new WebInspector.ResourceSourceFrame(contentProvider); 122 var view = parsedJSON ? new WebInspector.JSONView(parsedJSON) : new WebInspector.ResourceSourceFrame(contentProvider);
123 this._splitWidget.setSidebarWidget(view); 123 this._splitWidget.setSidebarWidget(view);
124 }); 124 });
125 }, 125 },
126 126
127 refresh: function() 127 refresh: function()
128 { 128 {
129 this._dataGrid.rootNode().removeChildren(); 129 this._dataGrid.rootNode().removeChildren();
130 var frames = this._request.frames(); 130 var frames = this._request.frames();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698