| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 namespace storage { | 47 namespace storage { |
| 48 class SpecialStoragePolicy; | 48 class SpecialStoragePolicy; |
| 49 } | 49 } |
| 50 | 50 |
| 51 namespace content { | 51 namespace content { |
| 52 | 52 |
| 53 class BackgroundSyncController; | 53 class BackgroundSyncController; |
| 54 class BlobHandle; | 54 class BlobHandle; |
| 55 class BrowserPluginGuestManager; | 55 class BrowserPluginGuestManager; |
| 56 class BrowsingDataRemover; |
| 57 class BrowsingDataRemoverDelegate; |
| 56 class DownloadManager; | 58 class DownloadManager; |
| 57 class DownloadManagerDelegate; | 59 class DownloadManagerDelegate; |
| 58 class PermissionManager; | 60 class PermissionManager; |
| 59 class PushMessagingService; | 61 class PushMessagingService; |
| 60 class ResourceContext; | 62 class ResourceContext; |
| 61 class ServiceManagerConnection; | 63 class ServiceManagerConnection; |
| 62 class SiteInstance; | 64 class SiteInstance; |
| 63 class StoragePartition; | 65 class StoragePartition; |
| 64 class SSLHostStateDelegate; | 66 class SSLHostStateDelegate; |
| 65 | 67 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 // thread. | 80 // thread. |
| 79 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { | 81 class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { |
| 80 public: | 82 public: |
| 81 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); | 83 static DownloadManager* GetDownloadManager(BrowserContext* browser_context); |
| 82 | 84 |
| 83 // Returns BrowserContext specific external mount points. It may return | 85 // Returns BrowserContext specific external mount points. It may return |
| 84 // nullptr if the context doesn't have any BrowserContext specific external | 86 // nullptr if the context doesn't have any BrowserContext specific external |
| 85 // mount points. Currenty, non-nullptr value is returned only on ChromeOS. | 87 // mount points. Currenty, non-nullptr value is returned only on ChromeOS. |
| 86 static storage::ExternalMountPoints* GetMountPoints(BrowserContext* context); | 88 static storage::ExternalMountPoints* GetMountPoints(BrowserContext* context); |
| 87 | 89 |
| 88 static content::StoragePartition* GetStoragePartition( | 90 // Returns a BrowsingDataRemover that can schedule data deletion tasks |
| 89 BrowserContext* browser_context, SiteInstance* site_instance); | 91 // for this |context|. |
| 90 static content::StoragePartition* GetStoragePartitionForSite( | 92 static BrowsingDataRemover* GetBrowsingDataRemover(BrowserContext* context); |
| 91 BrowserContext* browser_context, const GURL& site); | 93 |
| 94 static StoragePartition* GetStoragePartition(BrowserContext* browser_context, |
| 95 SiteInstance* site_instance); |
| 96 static StoragePartition* GetStoragePartitionForSite( |
| 97 BrowserContext* browser_context, |
| 98 const GURL& site); |
| 92 using StoragePartitionCallback = base::Callback<void(StoragePartition*)>; | 99 using StoragePartitionCallback = base::Callback<void(StoragePartition*)>; |
| 93 static void ForEachStoragePartition( | 100 static void ForEachStoragePartition( |
| 94 BrowserContext* browser_context, | 101 BrowserContext* browser_context, |
| 95 const StoragePartitionCallback& callback); | 102 const StoragePartitionCallback& callback); |
| 96 static void AsyncObliterateStoragePartition( | 103 static void AsyncObliterateStoragePartition( |
| 97 BrowserContext* browser_context, | 104 BrowserContext* browser_context, |
| 98 const GURL& site, | 105 const GURL& site, |
| 99 const base::Closure& on_gc_required); | 106 const base::Closure& on_gc_required); |
| 100 | 107 |
| 101 // This function clears the contents of |active_paths| but does not take | 108 // This function clears the contents of |active_paths| but does not take |
| 102 // ownership of the pointer. | 109 // ownership of the pointer. |
| 103 static void GarbageCollectStoragePartitions( | 110 static void GarbageCollectStoragePartitions( |
| 104 BrowserContext* browser_context, | 111 BrowserContext* browser_context, |
| 105 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, | 112 std::unique_ptr<base::hash_set<base::FilePath>> active_paths, |
| 106 const base::Closure& done); | 113 const base::Closure& done); |
| 107 | 114 |
| 108 static content::StoragePartition* GetDefaultStoragePartition( | 115 static StoragePartition* GetDefaultStoragePartition( |
| 109 BrowserContext* browser_context); | 116 BrowserContext* browser_context); |
| 110 | 117 |
| 111 using BlobCallback = base::Callback<void(std::unique_ptr<BlobHandle>)>; | 118 using BlobCallback = base::Callback<void(std::unique_ptr<BlobHandle>)>; |
| 112 | 119 |
| 113 // |callback| returns a nullptr scoped_ptr on failure. | 120 // |callback| returns a nullptr scoped_ptr on failure. |
| 114 static void CreateMemoryBackedBlob(BrowserContext* browser_context, | 121 static void CreateMemoryBackedBlob(BrowserContext* browser_context, |
| 115 const char* data, size_t length, | 122 const char* data, size_t length, |
| 116 const BlobCallback& callback); | 123 const BlobCallback& callback); |
| 117 | 124 |
| 118 // |callback| returns a nullptr scoped_ptr on failure. | 125 // |callback| returns a nullptr scoped_ptr on failure. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; | 226 virtual SSLHostStateDelegate* GetSSLHostStateDelegate() = 0; |
| 220 | 227 |
| 221 // Returns the PermissionManager associated with that context if any, nullptr | 228 // Returns the PermissionManager associated with that context if any, nullptr |
| 222 // otherwise. | 229 // otherwise. |
| 223 virtual PermissionManager* GetPermissionManager() = 0; | 230 virtual PermissionManager* GetPermissionManager() = 0; |
| 224 | 231 |
| 225 // Returns the BackgroundSyncController associated with that context if any, | 232 // Returns the BackgroundSyncController associated with that context if any, |
| 226 // nullptr otherwise. | 233 // nullptr otherwise. |
| 227 virtual BackgroundSyncController* GetBackgroundSyncController() = 0; | 234 virtual BackgroundSyncController* GetBackgroundSyncController() = 0; |
| 228 | 235 |
| 236 // Returns the BrowsingDataRemoverDelegate for this context. This will be |
| 237 // called once per context. It's valid to return nullptr. |
| 238 virtual BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate(); |
| 239 |
| 229 // Creates the main net::URLRequestContextGetter. It's called only once. | 240 // Creates the main net::URLRequestContextGetter. It's called only once. |
| 230 virtual net::URLRequestContextGetter* CreateRequestContext( | 241 virtual net::URLRequestContextGetter* CreateRequestContext( |
| 231 ProtocolHandlerMap* protocol_handlers, | 242 ProtocolHandlerMap* protocol_handlers, |
| 232 URLRequestInterceptorScopedVector request_interceptors) = 0; | 243 URLRequestInterceptorScopedVector request_interceptors) = 0; |
| 233 | 244 |
| 234 // Creates the net::URLRequestContextGetter for a StoragePartition. It's | 245 // Creates the net::URLRequestContextGetter for a StoragePartition. It's |
| 235 // called only once per partition_path. | 246 // called only once per partition_path. |
| 236 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | 247 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 237 const base::FilePath& partition_path, | 248 const base::FilePath& partition_path, |
| 238 bool in_memory, | 249 bool in_memory, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 265 // 2) The embedder saves its salt across restarts. | 276 // 2) The embedder saves its salt across restarts. |
| 266 static std::string CreateRandomMediaDeviceIDSalt(); | 277 static std::string CreateRandomMediaDeviceIDSalt(); |
| 267 | 278 |
| 268 private: | 279 private: |
| 269 const std::string media_device_id_salt_; | 280 const std::string media_device_id_salt_; |
| 270 }; | 281 }; |
| 271 | 282 |
| 272 } // namespace content | 283 } // namespace content |
| 273 | 284 |
| 274 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ | 285 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_CONTEXT_H_ |
| OLD | NEW |