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

Unified Diff: third_party/WebKit/Source/platform/weborigin/KURL.cpp

Issue 1495013002: Check for equality of the URL's origin in replaceState/pushState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow --disable-web-security again, add more tests 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/platform/weborigin/KURL.cpp
diff --git a/third_party/WebKit/Source/platform/weborigin/KURL.cpp b/third_party/WebKit/Source/platform/weborigin/KURL.cpp
index 99af364f9470dda7bd7c13faab6132cfc5205bff..82d9297678681913f1a6102419f044b48e6aee0e 100644
--- a/third_party/WebKit/Source/platform/weborigin/KURL.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/KURL.cpp
@@ -721,6 +721,24 @@ bool equalIgnoringFragmentIdentifier(const KURL& a, const KURL& b)
return true;
}
+bool equalIgnoringPathQueryAndFragment(const KURL& a, const KURL& b)
+{
+ int aLength = a.pathStart();
+ int bLength = b.pathStart();
+
+ if (aLength != bLength)
+ return false;
+
+ const String& aString = a.m_string;
+ const String& bString = b.m_string;
+ // FIXME: Abstraction this into a function in WTFString.h.
brettw 2015/12/08 05:41:32 I would remove this FIXME, I don't think this shou
robwu 2015/12/08 08:45:17 Then it also applies to the function above. In eit
+ for (int i = 0; i < aLength; ++i) {
+ if (aString[i] != bString[i])
+ return false;
+ }
+ return true;
+}
+
unsigned KURL::hostStart() const
{
return m_parsed.CountCharactersBefore(url::Parsed::HOST, false);

Powered by Google App Engine
This is Rietveld 408576698