OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
6 #define CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_path.h" | 9 #include "base/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 "net/url_request/url_request_context_getter.h" | 12 #include "net/url_request/url_request_context_getter.h" |
| 13 #include "net/url_request/url_request_job_factory.h" |
13 | 14 |
14 class MessageLoop; | 15 class MessageLoop; |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 class HostResolver; | 18 class HostResolver; |
18 class MappedHostResolver; | 19 class MappedHostResolver; |
19 class NetworkDelegate; | 20 class NetworkDelegate; |
20 class ProxyConfigService; | 21 class ProxyConfigService; |
21 class URLRequestContextStorage; | 22 class URLRequestContextStorage; |
22 } | 23 } |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
26 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { | 27 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { |
27 public: | 28 public: |
28 ShellURLRequestContextGetter( | 29 ShellURLRequestContextGetter( |
29 bool ignore_certificate_errors, | 30 bool ignore_certificate_errors, |
30 const FilePath& base_path, | 31 const FilePath& base_path, |
31 MessageLoop* io_loop, | 32 MessageLoop* io_loop, |
32 MessageLoop* file_loop); | 33 MessageLoop* file_loop, |
| 34 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 35 blob_protocol_handler, |
| 36 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 37 file_system_protocol_handler, |
| 38 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 39 developer_protocol_handler); |
33 | 40 |
34 // net::URLRequestContextGetter implementation. | 41 // net::URLRequestContextGetter implementation. |
35 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; | 42 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; |
36 virtual scoped_refptr<base::SingleThreadTaskRunner> | 43 virtual scoped_refptr<base::SingleThreadTaskRunner> |
37 GetNetworkTaskRunner() const OVERRIDE; | 44 GetNetworkTaskRunner() const OVERRIDE; |
38 | 45 |
39 net::HostResolver* host_resolver(); | 46 net::HostResolver* host_resolver(); |
40 | 47 |
41 protected: | 48 protected: |
42 virtual ~ShellURLRequestContextGetter(); | 49 virtual ~ShellURLRequestContextGetter(); |
43 | 50 |
44 private: | 51 private: |
45 bool ignore_certificate_errors_; | 52 bool ignore_certificate_errors_; |
46 FilePath base_path_; | 53 FilePath base_path_; |
47 MessageLoop* io_loop_; | 54 MessageLoop* io_loop_; |
48 MessageLoop* file_loop_; | 55 MessageLoop* file_loop_; |
49 | 56 |
50 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 57 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
51 scoped_ptr<net::NetworkDelegate> network_delegate_; | 58 scoped_ptr<net::NetworkDelegate> network_delegate_; |
52 scoped_ptr<net::URLRequestContextStorage> storage_; | 59 scoped_ptr<net::URLRequestContextStorage> storage_; |
53 scoped_ptr<net::URLRequestContext> url_request_context_; | 60 scoped_ptr<net::URLRequestContext> url_request_context_; |
| 61 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 62 blob_protocol_handler_; |
| 63 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 64 file_system_protocol_handler_; |
| 65 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 66 developer_protocol_handler_; |
54 | 67 |
55 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); | 68 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); |
56 }; | 69 }; |
57 | 70 |
58 } // namespace content | 71 } // namespace content |
59 | 72 |
60 #endif // CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 73 #endif // CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
OLD | NEW |