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

Side by Side 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 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) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (c) 2010-2011 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo ints.As<v8::Array>()); 495 handleProgramBreak(eventDetails, v8::Handle<v8::Value>(), hitBreakpo ints.As<v8::Array>());
496 } 496 }
497 } 497 }
498 } 498 }
499 499
500 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 ::Handle<v8::Object> object) 500 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 ::Handle<v8::Object> object)
501 { 501 {
502 String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::St ring::NewSymbol("id"))); 502 String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::St ring::NewSymbol("id")));
503 503
504 ScriptDebugListener::Script script; 504 ScriptDebugListener::Script script;
505 script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String: :NewSymbol("name"))); 505
506 String rawScriptURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v 8::String::NewSymbol("name")));
507 // Remove any fragment identifier.
508 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
509 if (hashCharPos != kNotFound) {
510 script.url = rawScriptURL.substring(0, hashCharPos);
511 } else {
512 script.url = rawScriptURL;
513 }
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
514
506 script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::Stri ng::NewSymbol("source"))); 515 script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::Stri ng::NewSymbol("source")));
507 script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Ge t(v8::String::NewSymbol("sourceMappingURL"))); 516 script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Ge t(v8::String::NewSymbol("sourceMappingURL")));
508 script.startLine = object->Get(v8::String::NewSymbol("startLine"))->ToIntege r()->Value(); 517 script.startLine = object->Get(v8::String::NewSymbol("startLine"))->ToIntege r()->Value();
509 script.startColumn = object->Get(v8::String::NewSymbol("startColumn"))->ToIn teger()->Value(); 518 script.startColumn = object->Get(v8::String::NewSymbol("startColumn"))->ToIn teger()->Value();
510 script.endLine = object->Get(v8::String::NewSymbol("endLine"))->ToInteger()- >Value(); 519 script.endLine = object->Get(v8::String::NewSymbol("endLine"))->ToInteger()- >Value();
511 script.endColumn = object->Get(v8::String::NewSymbol("endColumn"))->ToIntege r()->Value(); 520 script.endColumn = object->Get(v8::String::NewSymbol("endColumn"))->ToIntege r()->Value();
512 script.isContentScript = object->Get(v8::String::NewSymbol("isContentScript" ))->ToBoolean()->Value(); 521 script.isContentScript = object->Get(v8::String::NewSymbol("isContentScript" ))->ToBoolean()->Value();
513 522
514 listener->didParseSource(sourceID, script); 523 listener->didParseSource(sourceID, script);
515 } 524 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 { 637 {
629 return PassOwnPtr<ScriptSourceCode>(); 638 return PassOwnPtr<ScriptSourceCode>();
630 } 639 }
631 640
632 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source, const String& url, const String& functionName) 641 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source, const String& url, const String& functionName)
633 { 642 {
634 return source; 643 return source;
635 } 644 }
636 645
637 } // namespace WebCore 646 } // namespace WebCore
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