OLD | NEW |
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 IOS_WEB_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef IOS_WEB_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
6 #define IOS_WEB_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define IOS_WEB_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop_proxy.h" |
12 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
13 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 class HostResolver; | 17 class HostResolver; |
17 class MappedHostResolver; | 18 class MappedHostResolver; |
18 class NetworkDelegate; | 19 class NetworkDelegate; |
19 class NetLog; | 20 class NetLog; |
20 class ProxyConfigService; | 21 class ProxyConfigService; |
21 class TransportSecurityPersister; | 22 class TransportSecurityPersister; |
22 class URLRequestContext; | 23 class URLRequestContext; |
23 class URLRequestContextStorage; | 24 class URLRequestContextStorage; |
24 } | 25 } |
25 | 26 |
26 namespace web { | 27 namespace web { |
27 | 28 |
28 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { | 29 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { |
29 public: | 30 public: |
30 ShellURLRequestContextGetter( | 31 ShellURLRequestContextGetter( |
31 const base::FilePath& base_path, | 32 const base::FilePath& base_path, |
32 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, | 33 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, |
33 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner, | 34 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner, |
34 const scoped_refptr<base::SingleThreadTaskRunner>& cache_task_runner); | 35 const scoped_refptr<base::MessageLoopProxy>& cache_task_runner); |
35 | 36 |
36 // net::URLRequestContextGetter implementation. | 37 // net::URLRequestContextGetter implementation. |
37 net::URLRequestContext* GetURLRequestContext() override; | 38 net::URLRequestContext* GetURLRequestContext() override; |
38 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() | 39 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
39 const override; | 40 const override; |
40 | 41 |
41 protected: | 42 protected: |
42 ~ShellURLRequestContextGetter() override; | 43 ~ShellURLRequestContextGetter() override; |
43 | 44 |
44 private: | 45 private: |
45 base::FilePath base_path_; | 46 base::FilePath base_path_; |
46 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; | 47 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; |
47 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 48 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
48 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner_; | 49 scoped_refptr<base::MessageLoopProxy> cache_task_runner_; |
49 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 50 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
50 scoped_ptr<net::NetworkDelegate> network_delegate_; | 51 scoped_ptr<net::NetworkDelegate> network_delegate_; |
51 scoped_ptr<net::URLRequestContextStorage> storage_; | 52 scoped_ptr<net::URLRequestContextStorage> storage_; |
52 scoped_ptr<net::URLRequestContext> url_request_context_; | 53 scoped_ptr<net::URLRequestContext> url_request_context_; |
53 scoped_ptr<net::NetLog> net_log_; | 54 scoped_ptr<net::NetLog> net_log_; |
54 scoped_ptr<net::TransportSecurityPersister> transport_security_persister_; | 55 scoped_ptr<net::TransportSecurityPersister> transport_security_persister_; |
55 | 56 |
56 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); | 57 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); |
57 }; | 58 }; |
58 | 59 |
59 } // namespace web | 60 } // namespace web |
60 | 61 |
61 #endif // IOS_WEB_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 62 #endif // IOS_WEB_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
OLD | NEW |