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

Unified Diff: net/base/url_util.cc

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Adding a DCHECK to probably make a lot of tests fail. Created 3 years, 11 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
Index: net/base/url_util.cc
diff --git a/net/base/url_util.cc b/net/base/url_util.cc
index 062481fef392c9a9b103e152f86932addb997757..00ca5cbd82e944d00d8508c1c565ef78e8c25d8e 100644
--- a/net/base/url_util.cc
+++ b/net/base/url_util.cc
@@ -371,6 +371,16 @@ bool IsLocalhost(base::StringPiece host) {
return false;
}
+bool IsFragmentAddedOrUpdated(const GURL& old_url, const GURL& new_url) {
+ if (!new_url.has_ref() || old_url == new_url)
+ return false;
+
+ url::Replacements<char> replacements;
+ replacements.ClearRef();
+ return old_url.ReplaceComponents(replacements) ==
+ new_url.ReplaceComponents(replacements);
+}
+
GURL SimplifyUrlForRequest(const GURL& url) {
DCHECK(url.is_valid());
// Fast path to avoid re-canonicalization via ReplaceComponents.

Powered by Google App Engine
This is Rietveld 408576698