Chromium Code Reviews| 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 EXTENSIONS_BROWSER_EXTENSION_URL_REQUEST_CONTEXT_GETTER_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_URL_REQUEST_CONTEXT_GETTER_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "content/shell/browser/shell_url_request_context_getter.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #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_job_factory.h" | |
| 14 | 10 |
| 15 namespace base { | 11 namespace base { |
| 16 class MessageLoop; | 12 class MessageLoop; |
| 17 } | 13 } |
| 18 | 14 |
| 15 namespace content { | |
| 16 class BrowserContext; | |
| 17 } | |
| 18 | |
| 19 namespace net { | 19 namespace net { |
| 20 class NetworkDelegate; | 20 class NetworkDelegate; |
| 21 class NetLog; | 21 class NetLog; |
| 22 class ProxyConfigService; | |
| 23 class URLRequestContextStorage; | |
| 24 } | 22 } |
| 25 | 23 |
| 26 namespace extensions { | 24 namespace extensions { |
| 27 | 25 |
| 28 class InfoMap; | 26 class InfoMap; |
| 29 | 27 |
| 30 class ExtensionURLRequestContextGetter : public net::URLRequestContextGetter { | 28 class ShellURLRequestContextGetter : |
| 29 public content::ShellURLRequestContextGetter { | |
| 31 public: | 30 public: |
| 32 explicit ExtensionURLRequestContextGetter( | 31 ShellURLRequestContextGetter( |
| 33 void* browser_context, | 32 content::BrowserContext* browser_context, |
| 34 bool ignore_certificate_errors, | 33 bool ignore_certificate_errors, |
| 35 const base::FilePath& base_path, | 34 const base::FilePath& base_path, |
| 36 base::MessageLoop* io_loop, | 35 base::MessageLoop* io_loop, |
| 37 base::MessageLoop* file_loop, | 36 base::MessageLoop* file_loop, |
| 38 content::ProtocolHandlerMap* protocol_handlers, | 37 content::ProtocolHandlerMap* protocol_handlers, |
| 39 content::URLRequestInterceptorScopedVector request_interceptors, | 38 content::URLRequestInterceptorScopedVector request_interceptors, |
| 40 net::NetLog* net_log, | 39 net::NetLog* net_log, |
| 41 InfoMap* extension_info_map); | 40 InfoMap* extension_info_map); |
| 42 | 41 |
| 43 // net::URLRequestContextGetter implementation. | 42 // content::ShellURLRequestContextGetter implementation. |
| 44 virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; | 43 virtual net::NetworkDelegate* CreateNetworkDelegate() override; |
| 45 virtual scoped_refptr<base::SingleThreadTaskRunner> | |
| 46 GetNetworkTaskRunner() const OVERRIDE; | |
| 47 | 44 |
| 48 protected: | 45 protected: |
| 49 virtual ~ExtensionURLRequestContextGetter(); | 46 virtual ~ShellURLRequestContextGetter(); |
| 47 | |
| 50 private: | 48 private: |
| 51 void* browser_context_; | 49 content::BrowserContext* browser_context_; |
| 52 bool ignore_certificate_errors_; | 50 bool ignore_certificate_errors_; |
|
James Cook
2014/10/07 20:14:17
I don't think you need this member.
Xi Han
2014/10/07 21:10:18
I remove this member and check its value when crea
| |
| 53 base::FilePath base_path_; | |
| 54 base::MessageLoop* io_loop_; | |
| 55 base::MessageLoop* file_loop_; | |
| 56 net::NetLog* net_log_; | |
| 57 InfoMap* extension_info_map_; | 51 InfoMap* extension_info_map_; |
| 58 | 52 |
| 59 scoped_ptr<net::ProxyConfigService> proxy_config_service_; | |
| 60 scoped_ptr<net::NetworkDelegate> network_delegate_; | |
| 61 scoped_ptr<net::URLRequestContextStorage> storage_; | |
| 62 scoped_ptr<net::URLRequestContext> url_request_context_; | |
| 63 content::ProtocolHandlerMap protocol_handlers_; | |
| 64 content::URLRequestInterceptorScopedVector request_interceptors_; | |
| 65 | |
| 66 private: | 53 private: |
| 67 DISALLOW_COPY_AND_ASSIGN(ExtensionURLRequestContextGetter); | 54 DISALLOW_COPY_AND_ASSIGN(ShellURLRequestContextGetter); |
| 68 }; | 55 }; |
| 69 | 56 |
| 70 } // namespace extensions | 57 } // namespace extensions |
| 71 | 58 |
| 72 #endif // EXTENSIONS_BROWSER_EXTENSION_URL_REQUEST_CONTEXT_GETTER_H_ | 59 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_URL_REQUEST_CONTEXT_GETTER_H_ |
| OLD | NEW |