Chromium Code Reviews| Index: content/shell/browser/shell_browser_context.h |
| diff --git a/content/shell/browser/shell_browser_context.h b/content/shell/browser/shell_browser_context.h |
| index f015344063cae5c5b2c9d062c6078db6f905b4e6..b59144c59ff43204add14661457294672218088d 100644 |
| --- a/content/shell/browser/shell_browser_context.h |
| +++ b/content/shell/browser/shell_browser_context.h |
| @@ -11,6 +11,8 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "content/public/browser/browser_context.h" |
| #include "content/public/browser/content_browser_client.h" |
| +#include "content/public/browser/resource_context.h" |
| +#include "content/shell/browser/shell_url_request_context_getter.h" |
|
James Cook
2014/10/07 20:14:17
You should be able to forward declare ShellURLRequ
Xi Han
2014/10/07 21:10:18
It is needed here because the method void set_url
James Cook
2014/10/07 22:38:45
Huh? set_url_request_context_getter() just sets ge
Xi Han
2014/10/08 13:48:48
There are two set_url_request_context_getter() in
|
| #include "net/url_request/url_request_job_factory.h" |
| namespace net { |
| @@ -20,9 +22,7 @@ class NetLog; |
| namespace content { |
| class DownloadManagerDelegate; |
| -class ResourceContext; |
| class ShellDownloadManagerDelegate; |
| -class ShellURLRequestContextGetter; |
| class ShellBrowserContext : public BrowserContext { |
| public: |
| @@ -63,8 +63,39 @@ class ShellBrowserContext : public BrowserContext { |
| ProtocolHandlerMap* protocol_handlers, |
| URLRequestInterceptorScopedVector request_interceptors); |
| + protected: |
| + // Contains URLRequestContextGetter required for resource loading. |
| + class ShellResourceContext : public ResourceContext { |
| + public: |
| + ShellResourceContext() : getter_(NULL) {} |
|
James Cook
2014/10/07 20:14:16
Implement these in the .cc file
Xi Han
2014/10/07 21:10:18
Done.
|
| + virtual ~ShellResourceContext() {} |
| + |
| + // ResourceContext implementation: |
| + virtual net::HostResolver* GetHostResolver() override; |
| + virtual net::URLRequestContext* GetRequestContext() override; |
| + |
| + void set_url_request_context_getter(ShellURLRequestContextGetter* getter) { |
| + getter_ = getter; |
| + } |
| + |
| + private: |
| + ShellURLRequestContextGetter* getter_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ShellResourceContext); |
| + }; |
| + |
| + // Used by ShellBrowserContext to initiate and set different types of |
| + // URLRequestContextGetter. |
| + void set_url_request_context_getter(ShellURLRequestContextGetter* getter) { |
| + url_request_getter_ = getter; |
| + } |
| + |
| + ShellURLRequestContextGetter* get_url_request_context_getter() { |
|
James Cook
2014/10/07 20:14:17
Just use url_request_context_getter(). And tradit
Xi Han
2014/10/07 21:10:18
Done.
|
| + return url_request_getter_.get(); } |
|
James Cook
2014/10/07 20:14:16
formatting
Xi Han
2014/10/07 21:10:18
Done.
|
| + |
| + scoped_ptr<ShellResourceContext> resource_context_; |
| + |
| private: |
| - class ShellResourceContext; |
| // Performs initialization of the ShellBrowserContext while IO is still |
| // allowed on the current thread. |
| @@ -75,7 +106,6 @@ class ShellBrowserContext : public BrowserContext { |
| bool ignore_certificate_errors_; |
| base::FilePath path_; |
| BrowserPluginGuestManager* guest_manager_; |
| - scoped_ptr<ShellResourceContext> resource_context_; |
| scoped_ptr<ShellDownloadManagerDelegate> download_manager_delegate_; |
| scoped_refptr<ShellURLRequestContextGetter> url_request_getter_; |