OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_CRONET_ANDROID_CRONET_DATA_REDUCTION_PROXY_H_ | |
6 #define COMPONENTS_CRONET_ANDROID_CRONET_DATA_REDUCTION_PROXY_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 | |
14 class PrefService; | |
15 | |
16 namespace base { | |
17 class SingleThreadTaskRunner; | |
18 } | |
19 | |
20 namespace data_reduction_proxy { | |
21 class DataReductionProxyIOData; | |
22 class DataReductionProxySettings; | |
23 } | |
24 | |
25 namespace net { | |
26 class NetLog; | |
27 class NetworkDelegate; | |
28 class URLRequestContext; | |
29 class URLRequestContextGetter; | |
30 class URLRequestInterceptor; | |
31 } | |
32 | |
33 namespace cronet { | |
34 | |
35 // Wrapper and configurator of Data Reduction Proxy objects for cronet. | |
mmenke
2015/03/13 18:16:47
nit: Cronet
bengr
2015/03/19 01:03:51
Done.
| |
36 class CronetDataReductionProxy { | |
mmenke
2015/03/13 18:16:47
Do we need the proxy delegate?
bengr
2015/03/19 01:03:51
No. That was used only for DRP CONNECT support. Th
| |
37 public: | |
38 // Construct Data Reduction Proxy Settings and IOData objects and set | |
39 // the authentication key. | |
40 CronetDataReductionProxy( | |
41 const std::string& key, | |
42 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | |
mmenke
2015/03/13 18:16:47
Should make it clear what the requirements for the
bengr
2015/03/19 01:03:50
Done.
| |
43 net::NetLog* net_log); | |
44 | |
45 virtual ~CronetDataReductionProxy(); | |
mmenke
2015/03/13 18:16:47
Virtual not needed.
bengr
2015/03/19 01:03:51
Done.
| |
46 | |
47 // Constructs a network delegate suitable for adding Data Reduction Proxy | |
48 // request headers. | |
49 net::NetworkDelegate* CreateNetworkDelegate( | |
mmenke
2015/03/13 18:16:47
Should return a scoped_ptr<NetworkDelegate>
bengr
2015/03/19 01:03:51
Done.
| |
50 scoped_ptr<net::NetworkDelegate> wrapped_network_delegate); | |
51 | |
52 // Constructs a URLRequestInterceptor suitable for carrying out the Data | |
53 // Reduction Proxy's bypass protocol. | |
54 scoped_ptr<net::URLRequestInterceptor> CreateInterceptor(); | |
55 | |
56 // Constructs a bridge between the Settings and IOData objects, sets up a | |
57 // context for secure proxy check requests, and enables the proxy, if | |
58 // |enable| is true. | |
59 void Init(bool enable, net::URLRequestContext* context); | |
60 | |
61 private: | |
62 static scoped_ptr<PrefService> CreatePrefService(); | |
mmenke
2015/03/13 18:16:47
This isn't needed in the header - can just be in a
bengr
2015/03/19 01:03:51
Done.
| |
63 | |
64 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
65 scoped_ptr<PrefService> prefs_; | |
66 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | |
mmenke
2015/03/13 18:16:47
I don't think we need to hold on to this.
bengr
2015/03/19 01:03:51
Someone does, and currently DRPService takes a raw
mmenke
2015/03/19 02:50:18
That should be fixed. Happy to review a tiny CL t
bengr
2015/03/19 17:56:24
This can't be fixed easily afaik. In profile_impl_
| |
67 scoped_ptr<data_reduction_proxy::DataReductionProxySettings> settings_; | |
68 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> io_data_; | |
69 | |
70 DISALLOW_COPY_AND_ASSIGN(CronetDataReductionProxy); | |
71 }; | |
72 | |
73 } // namespace cronet | |
74 | |
75 #endif // COMPONENTS_CRONET_ANDROID_CRONET_DATA_REDUCTION_PROXY_H_ | |
OLD | NEW |