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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js

Issue 1832413002: DevTools: Address empty query parameters being displayed fugly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 852
853 /** 853 /**
854 * @param {string} queryString 854 * @param {string} queryString
855 * @return {!Array.<!WebInspector.NetworkRequest.NameValue>} 855 * @return {!Array.<!WebInspector.NetworkRequest.NameValue>}
856 */ 856 */
857 _parseParameters: function(queryString) 857 _parseParameters: function(queryString)
858 { 858 {
859 function parseNameValue(pair) 859 function parseNameValue(pair)
860 { 860 {
861 var position = pair.indexOf("="); 861 var position = pair.indexOf("=");
862 if (position === -1) 862 if (position === -1) {
863 if (pair === "") {
864 return {name: "(empty)", value: "(empty)"};
caseq 2016/04/06 18:36:43 I'd rather say we could skip these, but if the con
865 }
863 return {name: pair, value: ""}; 866 return {name: pair, value: ""};
864 else 867 }
868 else {
865 return {name: pair.substring(0, position), value: pair.substring (position + 1)}; 869 return {name: pair.substring(0, position), value: pair.substring (position + 1)};
870 }
866 } 871 }
867 return queryString.split("&").map(parseNameValue); 872 return queryString.split("&").map(parseNameValue);
868 }, 873 },
869 874
870 /** 875 /**
871 * @param {!Array.<!WebInspector.NetworkRequest.NameValue>} headers 876 * @param {!Array.<!WebInspector.NetworkRequest.NameValue>} headers
872 * @param {string} headerName 877 * @param {string} headerName
873 * @return {string|undefined} 878 * @return {string|undefined}
874 */ 879 */
875 _headerValue: function(headers, headerName) 880 _headerValue: function(headers, headerName)
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.EventSo urceMessageAdded, message); 1191 this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.EventSo urceMessageAdded, message);
1187 }, 1192 },
1188 1193
1189 replayXHR: function() 1194 replayXHR: function()
1190 { 1195 {
1191 this.target().networkAgent().replayXHR(this.requestId); 1196 this.target().networkAgent().replayXHR(this.requestId);
1192 }, 1197 },
1193 1198
1194 __proto__: WebInspector.SDKObject.prototype 1199 __proto__: WebInspector.SDKObject.prototype
1195 } 1200 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698