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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h

Issue 596053003: Add client type in chrome-proxy header for desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extension
Patch Set: Remove unnecessary const keyword. Created 6 years, 2 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: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
index e4a3d4166439091c52b66716a8c044d69df7a354..fba02db513ec1413ef7210b7996d4034f38e70b8 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
@@ -29,9 +29,25 @@ namespace data_reduction_proxy {
extern const char kAndroidWebViewProtocolVersion[];
#endif
-extern const char kClientAndroidWebview[];
-extern const char kClientChromeAndroid[];
-extern const char kClientChromeIOS[];
+#define CLIENT_ENUMS_LIST \
+ CLIENT_ENUM(UNKNOWN, "") \
+ CLIENT_ENUM(WEBVIEW_ANDROID, "webview") \
+ CLIENT_ENUM(CHROME_ANDROID, "android") \
+ CLIENT_ENUM(CHROME_IOS, "ios") \
+ CLIENT_ENUM(CHROME_MAC, "mac") \
+ CLIENT_ENUM(CHROME_CHROMEOS, "chromeos") \
+ CLIENT_ENUM(CHROME_LINUX, "linux") \
+ CLIENT_ENUM(CHROME_WINDOWS, "win") \
+ CLIENT_ENUM(CHROME_FREEBSD, "freebsd") \
+ CLIENT_ENUM(CHROME_OPENBSD, "openbsd") \
+ CLIENT_ENUM(CHROME_SOLARIS, "solaris") \
+ CLIENT_ENUM(CHROME_QNX, "qnx")
+
+#define CLIENT_ENUM(name, str_value) name,
+typedef enum {
+ CLIENT_ENUMS_LIST
+} Client;
+#undef CLIENT_ENUM
class DataReductionProxyParams;
@@ -42,7 +58,7 @@ class DataReductionProxyAuthRequestHandler {
// Constructs a DataReductionProxyAuthRequestHandler object with the given
// client type, params, and network task runner.
DataReductionProxyAuthRequestHandler(
- const std::string& client,
+ Client client,
DataReductionProxyParams* params,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);
@@ -89,7 +105,7 @@ class DataReductionProxyAuthRequestHandler {
// Visible for testing.
DataReductionProxyAuthRequestHandler(
- const std::string& client,
+ Client client,
const std::string& version,
DataReductionProxyParams* params,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner);

Powered by Google App Engine
This is Rietveld 408576698