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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h

Issue 893003002: Data Reduction Proxy class ownership updates and Settings cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
7 7
8 #include "base/memory/scoped_ptr.h"
9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_requ est_options.h" 8 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_requ est_options.h"
10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
11 #include "components/keyed_service/core/keyed_service.h" 10 #include "components/keyed_service/core/keyed_service.h"
12 11
12 class PrefService;
13
13 namespace base { 14 namespace base {
14 class PrefService; 15 class SingleThreadTaskRunner;
15 } 16 }
16 17
17 namespace data_reduction_proxy { 18 namespace data_reduction_proxy {
18 class DataReductionProxyConfigurator;
19 class DataReductionProxyIOData; 19 class DataReductionProxyIOData;
20 class DataReductionProxyEventStore;
21 class DataReductionProxyParams;
22 } 20 }
23 21
24 namespace net { 22 namespace net {
25 class NetLog;
26 class URLRequestContextGetter; 23 class URLRequestContextGetter;
27 } 24 }
28 25
29 class PrefService; 26 class PrefService;
30 27
31 // Data reduction proxy settings class suitable for use with a Chrome browser. 28 // Data reduction proxy settings class suitable for use with a Chrome browser.
32 // It is keyed to a browser context. 29 // It is keyed to a browser context.
33 class DataReductionProxyChromeSettings 30 class DataReductionProxyChromeSettings
34 : public data_reduction_proxy::DataReductionProxySettings, 31 : public data_reduction_proxy::DataReductionProxySettings,
35 public KeyedService { 32 public KeyedService {
36 public: 33 public:
37 // Constructs a settings object with the given configuration parameters. 34 // Constructs a settings object. Construction and destruction must happen on
38 // Construction and destruction must happen on the UI thread. 35 // the UI thread.
39 explicit DataReductionProxyChromeSettings( 36 DataReductionProxyChromeSettings();
40 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> params);
41 37
42 // Destructs the settings object. 38 // Destructs the settings object.
43 ~DataReductionProxyChromeSettings() override; 39 ~DataReductionProxyChromeSettings() override;
44 40
45 // Initialize the settings object with the given configurator, prefs services, 41 // Overrides KeyedService::Shutdown:
46 // and request context. Settings takes ownership of statistics prefs from 42 void Shutdown() override;
47 // |io_data|. 43
44 // Initialize the settings object with the given io_data, prefs services,
45 // request context getter, and task runner.
48 void InitDataReductionProxySettings( 46 void InitDataReductionProxySettings(
49 data_reduction_proxy::DataReductionProxyIOData* io_data, 47 data_reduction_proxy::DataReductionProxyIOData* io_data,
50 PrefService* profile_prefs, 48 PrefService* profile_prefs,
51 PrefService* local_state_prefs, 49 net::URLRequestContextGetter* request_context,
bengr 2015/02/20 00:00:36 nit: request_context_getter
jeremyim 2015/02/20 02:17:17 Done.
52 net::URLRequestContextGetter* request_context); 50 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner);
53 51
54 // Gets the client type for the data reduction proxy. 52 // Gets the client type for the data reduction proxy.
55 static data_reduction_proxy::Client GetClient(); 53 static data_reduction_proxy::Client GetClient();
56 54
57 // Public for testing. 55 // Public for testing.
58 void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs); 56 void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs);
59 57
60 private: 58 private:
61 // Registers the DataReductionProxyEnabled synthetic field trial with 59 // Registers the DataReductionProxyEnabled synthetic field trial with
62 // the group |data_reduction_proxy_enabled|. 60 // the group |data_reduction_proxy_enabled|.
63 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled); 61 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled);
64 62
65 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings); 63 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings);
66 }; 64 };
67 65
68 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ 66 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698