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

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

Issue 1468633002: DevTools: Prettify websocket frames preview on Network pane. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update tests. Created 5 years 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 /** 79 /**
80 * @return {string} 80 * @return {string}
81 */ 81 */
82 _requestContent: function() 82 _requestContent: function()
83 { 83 {
84 var content = this.request.content; 84 var content = this.request.content;
85 return this.request.contentEncoded ? window.atob(content || "") : (conte nt || ""); 85 return this.request.contentEncoded ? window.atob(content || "") : (conte nt || "");
86 }, 86 },
87 87
88 /** 88 /**
89 * @return {?WebInspector.RequestJSONView} 89 * @return {?WebInspector.JSONView}
90 */ 90 */
91 _jsonView: function() 91 _jsonView: function()
92 { 92 {
93 var content = this._requestContent(); 93 var parsedJSON = WebInspector.JSONView.parseJSON(this._requestContent()) ;
94 var parsedJSON = WebInspector.RequestJSONView.parseJSON(content); 94 return parsedJSON && new WebInspector.JSONView(parsedJSON);
95 return parsedJSON ? new WebInspector.RequestJSONView(this.request, parse dJSON) : null;
96 }, 95 },
97 96
98 /** 97 /**
99 * @return {?WebInspector.XMLView} 98 * @return {?WebInspector.XMLView}
100 */ 99 */
101 _xmlView: function() 100 _xmlView: function()
102 { 101 {
103 var content = this._requestContent(); 102 var content = this._requestContent();
104 var parsedXML = WebInspector.XMLView.parseXML(content, this.request.mime Type); 103 var parsedXML = WebInspector.XMLView.parseXML(content, this.request.mime Type);
105 return parsedXML ? new WebInspector.XMLView(parsedXML) : null; 104 return parsedXML ? new WebInspector.XMLView(parsedXML) : null;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return this._responseView.sourceView; 155 return this._responseView.sourceView;
157 156
158 if (this.request.resourceType() === WebInspector.resourceTypes.Other) 157 if (this.request.resourceType() === WebInspector.resourceTypes.Other)
159 return this._createEmptyWidget(); 158 return this._createEmptyWidget();
160 159
161 return WebInspector.RequestView.nonSourceViewForRequest(this.request); 160 return WebInspector.RequestView.nonSourceViewForRequest(this.request);
162 }, 161 },
163 162
164 __proto__: WebInspector.RequestContentView.prototype 163 __proto__: WebInspector.RequestContentView.prototype
165 } 164 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698