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

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

Issue 1468633002: DevTools: Prettify websocket frames preview on Network pane. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js b/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
index 63105e2811a0aa4884e69e74c1697095bdf94cf5..b94d8deb8dd46b9146a6a8953310c9f3b9265a73 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
@@ -118,12 +118,22 @@ WebInspector.ResourceWebSocketFrameView.prototype = {
_onFrameSelected: function(event)
{
var selectedNode = /** @type {!WebInspector.ResourceWebSocketFrameNode} */ (event.target.selectedNode);
- if (this._messageView)
- this._messageView.detach();
- if (this._dataView)
- this._dataView.detach();
- this._dataView = new WebInspector.ResourceSourceFrame(selectedNode.contentProvider());
- this._splitWidget.setSidebarWidget(this._dataView);
+ var contentProvider = selectedNode.contentProvider();
caseq 2015/11/20 22:23:41 nit: drop the var?
alph 2015/11/20 22:38:46 noway
+ contentProvider.requestContent(contentReady.bind(this));
+ /**
+ * @this {WebInspector.ResourceWebSocketFrameView}
caseq 2015/11/20 22:23:41 nit: @param, then @this?
alph 2015/11/20 22:38:46 Done.
+ * @param {?string} content
+ */
+ function contentReady(content)
+ {
+ 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.
+ this._messageView.detach();
+ if (this._dataView)
+ this._dataView.detach();
+ var parsedJSON = content ? WebInspector.JSONView.parseJSON(content) : null;
+ this._dataView = parsedJSON ? new WebInspector.JSONView(parsedJSON) : new WebInspector.ResourceSourceFrame(contentProvider);
+ this._splitWidget.setSidebarWidget(this._dataView);
+ }
},
refresh: function()

Powered by Google App Engine
This is Rietveld 408576698