OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define CONTENT_SHELL_BROWSER_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 "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
| 13 #include "net/proxy/proxy_config_service.h" |
13 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
14 #include "net/url_request/url_request_job_factory.h" | 15 #include "net/url_request/url_request_job_factory.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class MessageLoop; | 18 class MessageLoop; |
18 } | 19 } |
19 | 20 |
20 namespace net { | 21 namespace net { |
21 class HostResolver; | 22 class HostResolver; |
22 class MappedHostResolver; | 23 class MappedHostResolver; |
23 class NetworkDelegate; | 24 class NetworkDelegate; |
24 class NetLog; | 25 class NetLog; |
25 class ProxyConfigService; | 26 class ProxyConfigService; |
| 27 class ProxyService; |
26 class URLRequestContextStorage; | 28 class URLRequestContextStorage; |
27 } | 29 } |
28 | 30 |
29 namespace content { | 31 namespace content { |
30 | 32 |
31 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { | 33 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { |
32 public: | 34 public: |
33 ShellURLRequestContextGetter( | 35 ShellURLRequestContextGetter( |
34 bool ignore_certificate_errors, | 36 bool ignore_certificate_errors, |
35 const base::FilePath& base_path, | 37 const base::FilePath& base_path, |
36 base::MessageLoop* io_loop, | 38 base::MessageLoop* io_loop, |
37 base::MessageLoop* file_loop, | 39 base::MessageLoop* file_loop, |
38 ProtocolHandlerMap* protocol_handlers, | 40 ProtocolHandlerMap* protocol_handlers, |
39 URLRequestInterceptorScopedVector request_interceptors, | 41 URLRequestInterceptorScopedVector request_interceptors, |
40 net::NetLog* net_log); | 42 net::NetLog* net_log); |
41 | 43 |
42 // net::URLRequestContextGetter implementation. | 44 // net::URLRequestContextGetter implementation. |
43 virtual net::URLRequestContext* GetURLRequestContext() override; | 45 virtual net::URLRequestContext* GetURLRequestContext() override; |
44 virtual scoped_refptr<base::SingleThreadTaskRunner> | 46 virtual scoped_refptr<base::SingleThreadTaskRunner> |
45 GetNetworkTaskRunner() const override; | 47 GetNetworkTaskRunner() const override; |
46 | 48 |
47 // Used by subclasses to create their own implementation of NetworkDelegate. | |
48 virtual net::NetworkDelegate* CreateNetworkDelegate(); | |
49 | 49 |
50 net::HostResolver* host_resolver(); | 50 net::HostResolver* host_resolver(); |
51 | 51 |
52 protected: | 52 protected: |
53 virtual ~ShellURLRequestContextGetter(); | 53 virtual ~ShellURLRequestContextGetter(); |
54 | 54 |
| 55 // Used by subclasses to create their own implementation of NetworkDelegate |
| 56 // and net::ProxyService. |
| 57 virtual net::NetworkDelegate* CreateNetworkDelegate(); |
| 58 virtual net::ProxyConfigService* GetProxyConfigService(); |
| 59 virtual net::ProxyService* GetProxyService(); |
| 60 |
55 private: | 61 private: |
56 bool ignore_certificate_errors_; | 62 bool ignore_certificate_errors_; |
57 base::FilePath base_path_; | 63 base::FilePath base_path_; |
58 base::MessageLoop* io_loop_; | 64 base::MessageLoop* io_loop_; |
59 base::MessageLoop* file_loop_; | 65 base::MessageLoop* file_loop_; |
60 net::NetLog* net_log_; | 66 net::NetLog* net_log_; |
61 | 67 |
62 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 68 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
63 scoped_ptr<net::NetworkDelegate> network_delegate_; | 69 scoped_ptr<net::NetworkDelegate> network_delegate_; |
64 scoped_ptr<net::URLRequestContextStorage> storage_; | 70 scoped_ptr<net::URLRequestContextStorage> storage_; |
65 scoped_ptr<net::URLRequestContext> url_request_context_; | 71 scoped_ptr<net::URLRequestContext> url_request_context_; |
66 ProtocolHandlerMap protocol_handlers_; | 72 ProtocolHandlerMap protocol_handlers_; |
67 URLRequestInterceptorScopedVector request_interceptors_; | 73 URLRequestInterceptorScopedVector request_interceptors_; |
68 | 74 |
69 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); | 75 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); |
70 }; | 76 }; |
71 | 77 |
72 } // namespace content | 78 } // namespace content |
73 | 79 |
74 #endif // CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 80 #endif // CONTENT_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
OLD | NEW |