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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1530153002: Change how DOM Inspector fetches document's base URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added documentation. Created 5 years 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 575395007f8ab3d302e05cca6ea46b6a0ebcc58f..6a5661578eb88cb6cbb275fce3c2b41e5cc6024f 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4312,6 +4312,15 @@ KURL Document::completeURLWithOverride(const String& url, const KURL& baseURLOve
if (url.isNull())
return KURL();
// This logic is deliberately spread over many statements in an attempt to track down http://crbug.com/312410.
+ const KURL& baseURL = baseURLForOverride(baseURLOverride);
+ if (!encoding().isValid())
+ return KURL(baseURL, url);
+ return KURL(baseURL, url, encoding());
+}
+
+const KURL& Document::baseURLForOverride(const KURL& baseURLOverride) const
+{
+ // This logic is deliberately spread over many statements in an attempt to track down http://crbug.com/312410.
const KURL* baseURLFromParent = 0;
bool shouldUseParentBaseURL = baseURLOverride.isEmpty();
if (!shouldUseParentBaseURL) {
@@ -4322,10 +4331,7 @@ KURL Document::completeURLWithOverride(const String& url, const KURL& baseURLOve
if (Document* parent = parentDocument())
baseURLFromParent = &parent->baseURL();
}
- const KURL& baseURL = baseURLFromParent ? *baseURLFromParent : baseURLOverride;
- if (!encoding().isValid())
- return KURL(baseURL, url);
- return KURL(baseURL, url, encoding());
+ return baseURLFromParent ? *baseURLFromParent : baseURLOverride;
}
// Support for Javascript execCommand, and related methods
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698