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 CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_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/browser_context.h" | 12 #include "content/public/browser/browser_context.h" |
13 #include "content/public/browser/content_browser_client.h" | 13 #include "content/public/browser/content_browser_client.h" |
14 #include "content/public/browser/resource_context.h" | 14 #include "content/public/browser/resource_context.h" |
15 #include "content/shell/browser/shell_url_request_context_getter.h" | 15 #include "content/shell/browser/shell_url_request_context_getter.h" |
16 #include "net/url_request/url_request_job_factory.h" | 16 #include "net/url_request/url_request_job_factory.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 class NetLog; | 19 class NetLog; |
20 } | 20 } |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 class DownloadManagerDelegate; | 24 class DownloadManagerDelegate; |
25 class ShellDownloadManagerDelegate; | 25 class ShellDownloadManagerDelegate; |
26 | 26 |
27 class ShellBrowserContext : public BrowserContext { | 27 class ShellBrowserContext : public BrowserContext { |
28 public: | 28 public: |
29 ShellBrowserContext(bool off_the_record, net::NetLog* net_log); | 29 ShellBrowserContext(bool off_the_record, net::NetLog* net_log); |
30 virtual ~ShellBrowserContext(); | 30 ~ShellBrowserContext() override; |
31 | 31 |
32 void set_guest_manager_for_testing( | 32 void set_guest_manager_for_testing( |
33 BrowserPluginGuestManager* guest_manager) { | 33 BrowserPluginGuestManager* guest_manager) { |
34 guest_manager_ = guest_manager; | 34 guest_manager_ = guest_manager; |
35 } | 35 } |
36 | 36 |
37 // BrowserContext implementation. | 37 // BrowserContext implementation. |
38 virtual base::FilePath GetPath() const override; | 38 base::FilePath GetPath() const override; |
39 virtual bool IsOffTheRecord() const override; | 39 bool IsOffTheRecord() const override; |
40 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() override; | 40 DownloadManagerDelegate* GetDownloadManagerDelegate() override; |
41 virtual net::URLRequestContextGetter* GetRequestContext() override; | 41 net::URLRequestContextGetter* GetRequestContext() override; |
42 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 42 net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
43 int renderer_child_id) override; | 43 int renderer_child_id) override; |
44 virtual net::URLRequestContextGetter* GetMediaRequestContext() override; | 44 net::URLRequestContextGetter* GetMediaRequestContext() override; |
45 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 45 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
46 int renderer_child_id) override; | 46 int renderer_child_id) override; |
47 virtual net::URLRequestContextGetter* | 47 net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition( |
48 GetMediaRequestContextForStoragePartition( | 48 const base::FilePath& partition_path, |
49 const base::FilePath& partition_path, | 49 bool in_memory) override; |
50 bool in_memory) override; | 50 ResourceContext* GetResourceContext() override; |
51 virtual ResourceContext* GetResourceContext() override; | 51 BrowserPluginGuestManager* GetGuestManager() override; |
52 virtual BrowserPluginGuestManager* GetGuestManager() override; | 52 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; |
53 virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; | 53 PushMessagingService* GetPushMessagingService() override; |
54 virtual PushMessagingService* GetPushMessagingService() override; | 54 SSLHostStateDelegate* GetSSLHostStateDelegate() override; |
55 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() override; | |
56 | 55 |
57 net::URLRequestContextGetter* CreateRequestContext( | 56 net::URLRequestContextGetter* CreateRequestContext( |
58 ProtocolHandlerMap* protocol_handlers, | 57 ProtocolHandlerMap* protocol_handlers, |
59 URLRequestInterceptorScopedVector request_interceptors); | 58 URLRequestInterceptorScopedVector request_interceptors); |
60 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | 59 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
61 const base::FilePath& partition_path, | 60 const base::FilePath& partition_path, |
62 bool in_memory, | 61 bool in_memory, |
63 ProtocolHandlerMap* protocol_handlers, | 62 ProtocolHandlerMap* protocol_handlers, |
64 URLRequestInterceptorScopedVector request_interceptors); | 63 URLRequestInterceptorScopedVector request_interceptors); |
65 | 64 |
66 protected: | 65 protected: |
67 // Contains URLRequestContextGetter required for resource loading. | 66 // Contains URLRequestContextGetter required for resource loading. |
68 class ShellResourceContext : public ResourceContext { | 67 class ShellResourceContext : public ResourceContext { |
69 public: | 68 public: |
70 ShellResourceContext(); | 69 ShellResourceContext(); |
71 virtual ~ShellResourceContext(); | 70 ~ShellResourceContext() override; |
72 | 71 |
73 // ResourceContext implementation: | 72 // ResourceContext implementation: |
74 virtual net::HostResolver* GetHostResolver() override; | 73 net::HostResolver* GetHostResolver() override; |
75 virtual net::URLRequestContext* GetRequestContext() override; | 74 net::URLRequestContext* GetRequestContext() override; |
76 | 75 |
77 void set_url_request_context_getter(ShellURLRequestContextGetter* getter) { | 76 void set_url_request_context_getter(ShellURLRequestContextGetter* getter) { |
78 getter_ = getter; | 77 getter_ = getter; |
79 } | 78 } |
80 | 79 |
81 private: | 80 private: |
82 ShellURLRequestContextGetter* getter_; | 81 ShellURLRequestContextGetter* getter_; |
83 | 82 |
84 DISALLOW_COPY_AND_ASSIGN(ShellResourceContext); | 83 DISALLOW_COPY_AND_ASSIGN(ShellResourceContext); |
85 }; | 84 }; |
(...skipping 28 matching lines...) Expand all Loading... |
114 base::FilePath path_; | 113 base::FilePath path_; |
115 BrowserPluginGuestManager* guest_manager_; | 114 BrowserPluginGuestManager* guest_manager_; |
116 scoped_refptr<ShellURLRequestContextGetter> url_request_getter_; | 115 scoped_refptr<ShellURLRequestContextGetter> url_request_getter_; |
117 | 116 |
118 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); | 117 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); |
119 }; | 118 }; |
120 | 119 |
121 } // namespace content | 120 } // namespace content |
122 | 121 |
123 #endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ | 122 #endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ |
OLD | NEW |