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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.h

Issue 1017853003: Add ClientConfig proto, and JSON generation/parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting and unit test fix. Created 5 years, 9 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/browser/data_reduction_proxy_config_client.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf2d4c21484c6712c5c2234ee5d287207f7f1f3c
--- /dev/null
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_client.h
@@ -0,0 +1,52 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_CLIENT_H_
+#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_CLIENT_H_
+
+#include <string>
+
+#include "base/gtest_prod_util.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class DictionaryValue;
sclittle 2015/03/18 20:31:51 Remove unused forward declaration
jeremyim 2015/03/20 16:21:11 Done.
+}
+
+namespace data_reduction_proxy {
+
+class DataReductionProxyParams;
+class DataReductionProxyRequestOptions;
+
+// Retrieves the Data Reduction Proxy configuration from a remote service. This
+// objects lives on the IO thread.
sclittle 2015/03/18 20:31:51 nit: s/objects/object/
jeremyim 2015/03/20 16:21:10 Done.
+class DataReductionProxyConfigClient {
sclittle 2015/03/18 20:31:51 "ConfigClient" seems a bit ambiguous, maybe "Confi
jeremyim 2015/03/20 16:21:11 Done.
+ public:
+ // The caller must ensure that all parameters remain alive for the lifetime of
+ // the |DataReductionProxyConfigClient|.
+ DataReductionProxyConfigClient(
sclittle 2015/03/18 20:31:51 This class doesn't have any public methods, and th
jeremyim 2015/03/20 16:21:10 The next CL is already pretty large; the more I ca
+ DataReductionProxyParams* params,
+ DataReductionProxyRequestOptions* request_options);
+
+ virtual ~DataReductionProxyConfigClient();
bengr 2015/03/19 16:31:14 Does this need to be virtual?
jeremyim 2015/03/20 16:21:10 Done.
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigClientTest,
+ TestConstructStaticResponse);
+
+ // Constructs a synthetic response based on |params_|.
bengr 2015/03/19 16:31:14 Why is it 'synthetic'?
jeremyim 2015/03/20 16:21:11 It is synthetic in that it is locally manufactured
+ std::string ConstructStaticResponse();
+
+ // The caller must ensure that the |params_| outlives this instance.
+ DataReductionProxyParams* params_;
+
+ // The caller must ensure that the |request_options_| outlives this instance.
+ DataReductionProxyRequestOptions* request_options_;
+
+ DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfigClient);
+};
+
+} // namespace data_reduction_proxy
+#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698