| 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/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 "net/url_request/url_request_context_getter.h" | 13 #include "net/url_request/url_request_context_getter.h" |
| 13 #include "net/url_request/url_request_job_factory.h" | 14 #include "net/url_request/url_request_job_factory.h" |
| 14 | 15 |
| 15 class MessageLoop; | 16 class MessageLoop; |
| 16 | 17 |
| 17 namespace net { | 18 namespace net { |
| 18 class HostResolver; | 19 class HostResolver; |
| 19 class MappedHostResolver; | 20 class MappedHostResolver; |
| 20 class NetworkDelegate; | 21 class NetworkDelegate; |
| 21 class ProxyConfigService; | 22 class ProxyConfigService; |
| 22 class URLRequestContextStorage; | 23 class URLRequestContextStorage; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| 26 | 27 |
| 27 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { | 28 class ShellURLRequestContextGetter : public net::URLRequestContextGetter { |
| 28 public: | 29 public: |
| 29 ShellURLRequestContextGetter( | 30 ShellURLRequestContextGetter( |
| 30 bool ignore_certificate_errors, | 31 bool ignore_certificate_errors, |
| 31 const base::FilePath& base_path, | 32 const base::FilePath& base_path, |
| 32 MessageLoop* io_loop, | 33 MessageLoop* io_loop, |
| 33 MessageLoop* file_loop, | 34 MessageLoop* file_loop, |
| 34 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 35 ProtocolHandlerMap* protocol_handlers); |
| 35 blob_protocol_handler, | |
| 36 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 37 file_system_protocol_handler, | |
| 38 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 39 developer_protocol_handler, | |
| 40 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 41 chrome_protocol_handler, | |
| 42 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 43 chrome_devtools_protocol_handler); | |
| 44 | 36 |
| 45 // net::URLRequestContextGetter implementation. | 37 // net::URLRequestContextGetter implementation. |
| 46 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; | 38 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; |
| 47 virtual scoped_refptr<base::SingleThreadTaskRunner> | 39 virtual scoped_refptr<base::SingleThreadTaskRunner> |
| 48 GetNetworkTaskRunner() const OVERRIDE; | 40 GetNetworkTaskRunner() const OVERRIDE; |
| 49 | 41 |
| 50 net::HostResolver* host_resolver(); | 42 net::HostResolver* host_resolver(); |
| 51 | 43 |
| 52 protected: | 44 protected: |
| 53 virtual ~ShellURLRequestContextGetter(); | 45 virtual ~ShellURLRequestContextGetter(); |
| 54 | 46 |
| 55 private: | 47 private: |
| 56 bool ignore_certificate_errors_; | 48 bool ignore_certificate_errors_; |
| 57 base::FilePath base_path_; | 49 base::FilePath base_path_; |
| 58 MessageLoop* io_loop_; | 50 MessageLoop* io_loop_; |
| 59 MessageLoop* file_loop_; | 51 MessageLoop* file_loop_; |
| 60 | 52 |
| 61 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | 53 scoped_ptr<net::ProxyConfigService> proxy_config_service_; |
| 62 scoped_ptr<net::NetworkDelegate> network_delegate_; | 54 scoped_ptr<net::NetworkDelegate> network_delegate_; |
| 63 scoped_ptr<net::URLRequestContextStorage> storage_; | 55 scoped_ptr<net::URLRequestContextStorage> storage_; |
| 64 scoped_ptr<net::URLRequestContext> url_request_context_; | 56 scoped_ptr<net::URLRequestContext> url_request_context_; |
| 65 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 57 ProtocolHandlerMap protocol_handlers_; |
| 66 blob_protocol_handler_; | |
| 67 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 68 file_system_protocol_handler_; | |
| 69 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 70 developer_protocol_handler_; | |
| 71 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 72 chrome_protocol_handler_; | |
| 73 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 74 chrome_devtools_protocol_handler_; | |
| 75 | 58 |
| 76 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); | 59 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); |
| 77 }; | 60 }; |
| 78 | 61 |
| 79 } // namespace content | 62 } // namespace content |
| 80 | 63 |
| 81 #endif // CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ | 64 #endif // CONTENT_SHELL_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
| OLD | NEW |