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

Unified Diff: Source/bindings/v8/ScriptDebugServer.cpp

Issue 26538007: [devtools] Remove trailing fragment identifier from script urls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 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/bindings/v8/ScriptDebugServer.cpp
diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp
index 34f6bc7cbe1b7586095a48f27a737441d5d07771..a15da89bc3ed6adad034e0e5308624f32971b551 100644
--- a/Source/bindings/v8/ScriptDebugServer.cpp
+++ b/Source/bindings/v8/ScriptDebugServer.cpp
@@ -502,7 +502,16 @@ void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8
String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("id")));
ScriptDebugListener::Script script;
- script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("name")));
+
+ String rawScriptURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("name")));
+ // Remove any fragment identifier.
+ size_t hashCharPos = rawScriptURL.find("#");
abarth-chromium 2013/10/11 20:20:41 This seems like the wrong layer for this work. Th
johnjbarton 2013/10/11 21:31:16 The debugger layer (listener here) gets a const Sc
+ if (hashCharPos != kNotFound) {
+ script.url = rawScriptURL.substring(0, hashCharPos);
+ } else {
+ script.url = rawScriptURL;
+ }
abarth-chromium 2013/10/11 20:20:41 This branch isn't needed. substring(0, kNotFound)
johnjbarton 2013/10/11 21:31:16 If I understand you, I could have written: scri
+
script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("source")));
script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("sourceMappingURL")));
script.startLine = object->Get(v8::String::NewSymbol("startLine"))->ToInteger()->Value();
« 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