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