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

Unified Diff: Source/devtools/front_end/sdk/NetworkWorkspaceBinding.js

Issue 368643002: DevTools: Make addFileForURL more robust (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/NetworkWorkspaceBinding.js
diff --git a/Source/devtools/front_end/sdk/NetworkWorkspaceBinding.js b/Source/devtools/front_end/sdk/NetworkWorkspaceBinding.js
index 643113f86ea61e3e8762c1cc652d162ce9e2a203..fc67ec2d7eaa1c3457f815bf10c985a61698dbf3 100644
--- a/Source/devtools/front_end/sdk/NetworkWorkspaceBinding.js
+++ b/Source/devtools/front_end/sdk/NetworkWorkspaceBinding.js
@@ -129,8 +129,14 @@ WebInspector.NetworkWorkspaceBinding.prototype = {
{
var splitURL = WebInspector.ParsedURL.splitURL(url);
var projectName = splitURL[0];
- var parentPath = decodeURI(splitURL.slice(1, splitURL.length - 1).join("/"));
- var name = decodeURI(splitURL[splitURL.length - 1]);
+ var parentPath = splitURL.slice(1, -1).join("/");
+ try {
+ parentPath = decodeURIComponent(parentPath);
aandrey 2014/07/01 18:21:52 FYI, there are decodeURI(), decodeURIComponent() a
alph 2014/07/02 09:49:22 Thanks, I know about these. decodeURI is supposed
+ } catch (e) { }
+ var name = splitURL.peekLast() || "";
+ try {
+ name = decodeURIComponent(name);
+ } catch (e) { }
var projectDelegate = this._projectDelegate(projectName, isContentScript || false);
var path = projectDelegate.addFile(parentPath, name, url, contentProvider);
var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (this._workspace.uiSourceCode(projectDelegate.id(), path));
« 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