| 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_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 namespace content { | 49 namespace content { |
| 50 | 50 |
| 51 class BackgroundSyncController; | 51 class BackgroundSyncController; |
| 52 class BlobHandle; | 52 class BlobHandle; |
| 53 class BrowserPluginGuestManager; | 53 class BrowserPluginGuestManager; |
| 54 class DownloadManager; | 54 class DownloadManager; |
| 55 class DownloadManagerDelegate; | 55 class DownloadManagerDelegate; |
| 56 class IndexedDBContext; | 56 class IndexedDBContext; |
| 57 class MojoShellConnection; | |
| 58 class PermissionManager; | 57 class PermissionManager; |
| 59 class PushMessagingService; | 58 class PushMessagingService; |
| 60 class ResourceContext; | 59 class ResourceContext; |
| 60 class ServiceManagerConnection; |
| 61 class SiteInstance; | 61 class SiteInstance; |
| 62 class StoragePartition; | 62 class StoragePartition; |
| 63 class SSLHostStateDelegate; | 63 class SSLHostStateDelegate; |
| 64 | 64 |
| 65 // A mapping from the scheme name to the protocol handler that services its | 65 // A mapping from the scheme name to the protocol handler that services its |
| 66 // content. | 66 // content. |
| 67 typedef std::map< | 67 typedef std::map< |
| 68 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > | 68 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > |
| 69 ProtocolHandlerMap; | 69 ProtocolHandlerMap; |
| 70 | 70 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // that the ResourceContext is ready. | 140 // that the ResourceContext is ready. |
| 141 static void EnsureResourceContextInitialized(BrowserContext* browser_context); | 141 static void EnsureResourceContextInitialized(BrowserContext* browser_context); |
| 142 | 142 |
| 143 // Tells the HTML5 objects on this context to persist their session state | 143 // Tells the HTML5 objects on this context to persist their session state |
| 144 // across the next restart. | 144 // across the next restart. |
| 145 static void SaveSessionState(BrowserContext* browser_context); | 145 static void SaveSessionState(BrowserContext* browser_context); |
| 146 | 146 |
| 147 static void SetDownloadManagerForTesting(BrowserContext* browser_context, | 147 static void SetDownloadManagerForTesting(BrowserContext* browser_context, |
| 148 DownloadManager* download_manager); | 148 DownloadManager* download_manager); |
| 149 | 149 |
| 150 // Makes mojo aware of this BrowserContext, and assigns a user ID number to | 150 // Makes the Service Manager aware of this BrowserContext, and assigns a user |
| 151 // it. Should be called for each BrowserContext created. | 151 // ID number to it. Should be called for each BrowserContext created. |
| 152 static void Initialize(BrowserContext* browser_context, | 152 static void Initialize(BrowserContext* browser_context, |
| 153 const base::FilePath& path); | 153 const base::FilePath& path); |
| 154 | 154 |
| 155 // Returns a Shell User ID associated with this BrowserContext. This ID is not | 155 // Returns a Service User ID associated with this BrowserContext. This ID is |
| 156 // persistent across runs. See | 156 // not persistent across runs. See |
| 157 // services/shell/public/interfaces/connector.mojom. By default, this user id | 157 // services/shell/public/interfaces/connector.mojom. By default, this user id |
| 158 // is randomly generated when Initialize() is called. | 158 // is randomly generated when Initialize() is called. |
| 159 static const std::string& GetShellUserIdFor(BrowserContext* browser_context); | 159 static const std::string& GetServiceUserIdFor( |
| 160 BrowserContext* browser_context); |
| 160 | 161 |
| 161 // Returns the BrowserContext associated with |user_id|, or nullptr if no | 162 // Returns the BrowserContext associated with |user_id|, or nullptr if no |
| 162 // BrowserContext exists for that |user_id|. | 163 // BrowserContext exists for that |user_id|. |
| 163 static BrowserContext* GetBrowserContextForShellUserId( | 164 static BrowserContext* GetBrowserContextForServiceUserId( |
| 164 const std::string& user_id); | 165 const std::string& user_id); |
| 165 | 166 |
| 166 // Returns a Connector associated with this BrowserContext, which can be used | 167 // Returns a Connector associated with this BrowserContext, which can be used |
| 167 // to connect to service instances bound as this user. | 168 // to connect to service instances bound as this user. |
| 168 static shell::Connector* GetShellConnectorFor( | 169 static shell::Connector* GetConnectorFor(BrowserContext* browser_context); |
| 169 BrowserContext* browser_context); | 170 static ServiceManagerConnection* GetServiceManagerConnectionFor( |
| 170 static MojoShellConnection* GetMojoShellConnectionFor( | |
| 171 BrowserContext* browser_context); | 171 BrowserContext* browser_context); |
| 172 | 172 |
| 173 ~BrowserContext() override; | 173 ~BrowserContext() override; |
| 174 | 174 |
| 175 // Shuts down the storage partitions associated to this browser context. | 175 // Shuts down the storage partitions associated to this browser context. |
| 176 // This must be called before the browser context is actually destroyed | 176 // This must be called before the browser context is actually destroyed |
| 177 // and before a clean-up task for its corresponding IO thread residents (e.g. | 177 // and before a clean-up task for its corresponding IO thread residents (e.g. |
| 178 // ResourceContext) is posted, so that the classes that hung on | 178 // ResourceContext) is posted, so that the classes that hung on |
| 179 // StoragePartition can have time to do necessary cleanups on IO thread. | 179 // StoragePartition can have time to do necessary cleanups on IO thread. |
| 180 void ShutdownStoragePartitions(); | 180 void ShutdownStoragePartitions(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // called only once per partition_path. | 242 // called only once per partition_path. |
| 243 virtual net::URLRequestContextGetter* | 243 virtual net::URLRequestContextGetter* |
| 244 CreateMediaRequestContextForStoragePartition( | 244 CreateMediaRequestContextForStoragePartition( |
| 245 const base::FilePath& partition_path, | 245 const base::FilePath& partition_path, |
| 246 bool in_memory) = 0; | 246 bool in_memory) = 0; |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 } // namespace content | 249 } // namespace content |
| 250 | 250 |
| 251 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 251 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |