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

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

Issue 654083006: DevTools: NetworkPanel: use optimistic JSON parser for response preview. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/devtools/front_end/network/RequestJSONView.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 _createMessageView: function(message) 74 _createMessageView: function(message)
75 { 75 {
76 return new WebInspector.EmptyView(message); 76 return new WebInspector.EmptyView(message);
77 }, 77 },
78 78
79 /** 79 /**
80 * @return {?WebInspector.RequestJSONView} 80 * @return {?WebInspector.RequestJSONView}
81 */ 81 */
82 _jsonView: function() 82 _jsonView: function()
83 { 83 {
84 var parsedJSON = WebInspector.RequestJSONView.parseJSON(this.request.con tent || ""); 84 var request = this.request;
85 var content = request.content;
86 content = request.contentEncoded ? window.atob(content || "") : (content || "");
87 var parsedJSON = WebInspector.RequestJSONView.parseJSON(content);
85 return parsedJSON ? new WebInspector.RequestJSONView(this.request, parse dJSON) : null; 88 return parsedJSON ? new WebInspector.RequestJSONView(this.request, parse dJSON) : null;
86 }, 89 },
87 90
88 /** 91 /**
89 * @return {?WebInspector.RequestHTMLView} 92 * @return {?WebInspector.RequestHTMLView}
90 */ 93 */
91 _htmlErrorPreview: function() 94 _htmlErrorPreview: function()
92 { 95 {
93 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"]; 96 var whitelist = ["text/html", "text/plain", "application/xhtml+xml"];
94 if (whitelist.indexOf(this.request.mimeType) === -1) 97 if (whitelist.indexOf(this.request.mimeType) === -1)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return this._responseView.sourceView; 135 return this._responseView.sourceView;
133 136
134 if (this.request.type === WebInspector.resourceTypes.Other) 137 if (this.request.type === WebInspector.resourceTypes.Other)
135 return this._createEmptyView(); 138 return this._createEmptyView();
136 139
137 return WebInspector.RequestView.nonSourceViewForRequest(this.request); 140 return WebInspector.RequestView.nonSourceViewForRequest(this.request);
138 }, 141 },
139 142
140 __proto__: WebInspector.RequestContentView.prototype 143 __proto__: WebInspector.RequestContentView.prototype
141 } 144 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/network/RequestJSONView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698