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

Side by Side Diff: Source/devtools/front_end/common/ParsedURL.js

Issue 661983003: DevTools: bring back exception handling in URL decoding (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/bindings/NetworkWorkspaceBinding.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) 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } else 85 } else
86 this.lastPathComponent = path; 86 this.lastPathComponent = path;
87 } 87 }
88 88
89 /** 89 /**
90 * @param {string} url 90 * @param {string} url
91 * @return {!Array.<string>} 91 * @return {!Array.<string>}
92 */ 92 */
93 WebInspector.ParsedURL.splitURLIntoPathComponents = function(url) 93 WebInspector.ParsedURL.splitURLIntoPathComponents = function(url)
94 { 94 {
95 var parsedURL = new WebInspector.ParsedURL(decodeURI(url)); 95 var decodedURL = url;
96 try {
97 decodedURL = decodeURI(url);
98 } catch (e) { }
99 var parsedURL = new WebInspector.ParsedURL(decodedURL);
96 var origin; 100 var origin;
97 var folderPath; 101 var folderPath;
98 var name; 102 var name;
99 if (parsedURL.isValid) { 103 if (parsedURL.isValid) {
100 origin = parsedURL.scheme + "://" + parsedURL.host; 104 origin = parsedURL.scheme + "://" + parsedURL.host;
101 if (parsedURL.port) 105 if (parsedURL.port)
102 origin += ":" + parsedURL.port; 106 origin += ":" + parsedURL.port;
103 folderPath = parsedURL.folderPathComponents; 107 folderPath = parsedURL.folderPathComponents;
104 name = parsedURL.lastPathComponent; 108 name = parsedURL.lastPathComponent;
105 if (parsedURL.queryParams) 109 if (parsedURL.queryParams)
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 /** 242 /**
239 * @return {?WebInspector.ParsedURL} 243 * @return {?WebInspector.ParsedURL}
240 */ 244 */
241 String.prototype.asParsedURL = function() 245 String.prototype.asParsedURL = function()
242 { 246 {
243 var parsedURL = new WebInspector.ParsedURL(this.toString()); 247 var parsedURL = new WebInspector.ParsedURL(this.toString());
244 if (parsedURL.isValid) 248 if (parsedURL.isValid)
245 return parsedURL; 249 return parsedURL;
246 return null; 250 return null;
247 } 251 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/bindings/NetworkWorkspaceBinding.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698