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

Unified Diff: chrome/browser/google/google_util.h

Issue 10908028: Allow the X-Chrome-Variations header to transmit to all ports. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix up some tests Created 8 years, 4 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 | « chrome/browser/google/google_url_tracker.cc ('k') | chrome/browser/google/google_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google/google_util.h
diff --git a/chrome/browser/google/google_util.h b/chrome/browser/google/google_util.h
index 43bc685e0a279f56a0a49c6d03b7bf3e058606a9..58d150188e3f87efd9fc47ce5b1a49621142210f 100644
--- a/chrome/browser/google/google_util.h
+++ b/chrome/browser/google/google_util.h
@@ -58,14 +58,25 @@ enum SubdomainPermission {
DISALLOW_SUBDOMAIN,
};
-// True if |url| is an HTTP[S] request with host "[www.]google.<TLD>" and no
-// explicit port. If |permission| is ALLOW_SUBDOMAIN, we check against host
-// "*.google.<TLD>" instead.
-bool IsGoogleDomainUrl(const std::string& url, SubdomainPermission permission);
+// Designate whether or not a URL checking function also checks for standard
+// ports (80 for http, 443 for https), or if it allows all port numbers.
Ilya Sherman 2012/08/31 03:05:42 This isn't quite right -- http://www.google.com:80
SteveT 2012/08/31 13:29:31 So the GURL code actually parses out port 80 on ht
Ilya Sherman 2012/08/31 19:26:52 Ah, ok, lovely :)
SteveT 2012/08/31 21:58:17 Sounds good!
+enum PortPermission {
+ ALLOW_ALL_PORTS,
+ ALLOW_STANDARD_PORTS,
Ilya Sherman 2012/08/31 03:05:42 nit: Perhaps these should be ALLOW_EXPLICIT_PORTS
SteveT 2012/08/31 13:29:31 See comments above... they sort of explain why I u
Ilya Sherman 2012/08/31 19:26:52 Ok. I still think it's useful to frame this as al
SteveT 2012/08/31 21:58:17 Done.
+};
+
+// True if |url| is an HTTP[S] request with host "[www.]google.<TLD>". If
+// |subdomain_permission| is ALLOW_SUBDOMAIN, we check against host
+// "*.google.<TLD>" instead. If |port_permission| is ALLOW_STANDARD_PORTS, we
+// disallow explicit ports.
SteveT 2012/08/31 13:29:31 I guess we could change this comment up if the wor
+bool IsGoogleDomainUrl(const std::string& url,
+ SubdomainPermission subdomain_permission,
+ PortPermission port_permission);
// True if |host| is "[www.]google.<TLD>" with a valid TLD. If
-// |permission| is ALLOW_SUBDOMAIN, we check against host "*.google.<TLD>"
-// instead.
-bool IsGoogleHostname(const std::string& host, SubdomainPermission permission);
+// |subdomain_permission| is ALLOW_SUBDOMAIN, we check against host
+// "*.google.<TLD>" instead.
+bool IsGoogleHostname(const std::string& host,
+ SubdomainPermission subdomain_permission);
// True if |url| represents a valid Google home page URL.
bool IsGoogleHomePageUrl(const std::string& url);
// True if |url| represents a valid Google search URL.
« no previous file with comments | « chrome/browser/google/google_url_tracker.cc ('k') | chrome/browser/google/google_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698