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

Unified Diff: Source/bindings/v8/ScriptSourceCode.h

Issue 26538007: [devtools] Remove trailing fragment identifier from script urls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase; remove inflightResourceForURL Created 7 years, 1 month 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 | « LayoutTests/inspector/debugger/debug-inlined-scripts-fragment-id-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptSourceCode.h
diff --git a/Source/bindings/v8/ScriptSourceCode.h b/Source/bindings/v8/ScriptSourceCode.h
index 5bacd8bb1162a323f250daef755a467c489c116c..c95262cacbc230d07e25565b86e493d766e43f30 100644
--- a/Source/bindings/v8/ScriptSourceCode.h
+++ b/Source/bindings/v8/ScriptSourceCode.h
@@ -50,6 +50,8 @@ public:
, m_url(url)
, m_startPosition(startPosition)
{
+ if (!m_url.isEmpty())
+ m_url.removeFragmentIdentifier();
}
// We lose the encoding information from ScriptResource.
@@ -57,7 +59,6 @@ public:
ScriptSourceCode(ScriptResource* cs)
: m_source(cs->script())
, m_resource(cs)
- , m_url(cs->url())
, m_startPosition(TextPosition::minimumPosition())
{
}
@@ -68,8 +69,11 @@ public:
ScriptResource* resource() const { return m_resource.get(); }
const KURL& url() const
{
- if (m_resource)
- return m_resource->response().url();
+ if (m_url.isEmpty() && m_resource) {
+ m_url = m_resource->response().url();
+ if (!m_url.isEmpty())
+ m_url.removeFragmentIdentifier();
+ }
return m_url;
}
int startLine() const { return m_startPosition.m_line.oneBasedInt(); }
@@ -78,7 +82,7 @@ public:
private:
String m_source;
ResourcePtr<ScriptResource> m_resource;
- KURL m_url;
+ mutable KURL m_url;
TextPosition m_startPosition;
};
« no previous file with comments | « LayoutTests/inspector/debugger/debug-inlined-scripts-fragment-id-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698