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

Unified Diff: url/gurl.cc

Issue 2686853004: Move IsAboutBlank from url_utils to GURL (Closed)
Patch Set: Addressed nit Created 3 years, 10 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
« no previous file with comments | « url/gurl.h ('k') | url/gurl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/gurl.cc
diff --git a/url/gurl.cc b/url/gurl.cc
index f521692f931da535b50bc5b48aef21d71a6e9ba7..c9dad0600b2801f5629ad24a3ce20972b887d7f0 100644
--- a/url/gurl.cc
+++ b/url/gurl.cc
@@ -348,6 +348,19 @@ bool GURL::IsStandard() const {
return url::IsStandard(spec_.data(), parsed_.scheme);
}
+bool GURL::IsAboutBlank() const {
+ if (!SchemeIs(url::kAboutScheme))
+ return false;
+
+ if (has_host() || has_username() || has_password() || has_port())
+ return false;
+
+ if (path() != url::kAboutBlankPath && path() != url::kAboutBlankWithHashPath)
+ return false;
+
+ return true;
+}
+
bool GURL::SchemeIs(base::StringPiece lower_ascii_scheme) const {
DCHECK(base::IsStringASCII(lower_ascii_scheme));
DCHECK(base::ToLowerASCII(lower_ascii_scheme) == lower_ascii_scheme);
« no previous file with comments | « url/gurl.h ('k') | url/gurl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698