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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_util.h

Issue 2104143002: Refactoring client/version to util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 6 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/core/common/data_reduction_proxy_util.h
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_util.h b/components/data_reduction_proxy/core/common/data_reduction_proxy_util.h
index dcefb8cf48077576df879e63dd24af52334ea650..d56442944cb6f789e1408e035f66f707f6039fdc 100644
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_util.h
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_util.h
@@ -18,22 +18,50 @@ class Time;
class TimeDelta;
}
namespace net {
class ProxyConfig;
class ProxyInfo;
}
namespace data_reduction_proxy {
+enum class Client {
+ UNKNOWN,
+ CRONET_ANDROID,
+ WEBVIEW_ANDROID,
+ CHROME_ANDROID,
+ CHROME_IOS,
+ CHROME_MAC,
+ CHROME_CHROMEOS,
+ CHROME_LINUX,
+ CHROME_WINDOWS,
+ CHROME_FREEBSD,
+ CHROME_OPENBSD,
+ CHROME_SOLARIS,
+ CHROME_QNX,
+};
+
namespace util {
+// Returns the version of Chromium that is being used, e.g. "1.2.3.4".
+const char* ChromiumVersion();
+
+// Returns the build and patch numbers of |version_string|. |version_string|
+// must be a properly formed Chromium version number, e.g. "1.2.3.4".
+void GetChromiumBuildAndPatch(const std::string& version_string,
+ std::string* build,
+ std::string* patch);
+
+// Get the human-readable version of |client|.
+const char* GetStringForClient(Client client);
+
// Returns true if the request method is idempotent.
bool IsMethodIdempotent(const std::string& method);
GURL AddApiKeyToUrl(const GURL& url);
// Returns whether this is valid for data reduction proxy use. |proxy_info|
// should contain a single DIRECT ProxyServer, |url| should not be WS or WSO,
// and the |method| should be idempotent for this to be eligible.
bool EligibleForDataReductionProxy(const net::ProxyInfo& proxy_info,
const GURL& url,

Powered by Google App Engine
This is Rietveld 408576698