Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |