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

Unified Diff: url/gurl.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« 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 b7374b1f20e87a47fd372dd0861edff9db172d5c..b5801254069eb3e50d749c94fe9a082fd9a701af 100644
--- a/url/gurl.cc
+++ b/url/gurl.cc
@@ -322,8 +322,10 @@ GURL GURL::GetOrigin() const {
}
GURL GURL::GetAsReferrer() const {
- if (!is_valid_ ||
- (!has_ref() && !has_username() && !has_password()))
+ if (!is_valid_ || !SchemeIsHTTPOrHTTPS())
+ return GURL();
+
+ if (!has_ref() && !has_username() && !has_password())
return GURL(*this);
url::Replacements<char> replacements;
« 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