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_BROWSER_STORAGE_PARTITION_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "content/browser/appcache/chrome_appcache_service.h" | 18 #include "content/browser/appcache/chrome_appcache_service.h" |
19 #include "content/browser/background_fetch/background_fetch_context.h" | 19 #include "content/browser/background_fetch/background_fetch_context.h" |
20 #include "content/browser/background_sync/background_sync_context.h" | 20 #include "content/browser/background_sync/background_sync_context.h" |
| 21 #include "content/browser/blob_storage/blob_url_loader_factory.h" |
21 #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h" | 22 #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h" |
22 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" | 23 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" |
23 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 24 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
24 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 25 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
25 #include "content/browser/host_zoom_level_context.h" | 26 #include "content/browser/host_zoom_level_context.h" |
26 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 27 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
27 #include "content/browser/notifications/platform_notification_context_impl.h" | 28 #include "content/browser/notifications/platform_notification_context_impl.h" |
28 #include "content/browser/payments/payment_app_context_impl.h" | 29 #include "content/browser/payments/payment_app_context_impl.h" |
29 #include "content/browser/push_messaging/push_messaging_context.h" | 30 #include "content/browser/push_messaging/push_messaging_context.h" |
30 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 31 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
31 #include "content/browser/url_loader_factory_getter.h" | 32 #include "content/browser/url_loader_factory_getter.h" |
32 #include "content/common/content_export.h" | 33 #include "content/common/content_export.h" |
33 #include "content/common/network_service.mojom.h" | 34 #include "content/common/network_service.mojom.h" |
34 #include "content/common/storage_partition_service.mojom.h" | 35 #include "content/common/storage_partition_service.mojom.h" |
35 #include "content/public/browser/storage_partition.h" | 36 #include "content/public/browser/storage_partition.h" |
36 #include "mojo/public/cpp/bindings/binding_set.h" | 37 #include "mojo/public/cpp/bindings/binding_set.h" |
37 #include "net/cookies/cookie_store.h" | 38 #include "net/cookies/cookie_store.h" |
38 #include "storage/browser/quota/special_storage_policy.h" | 39 #include "storage/browser/quota/special_storage_policy.h" |
39 | 40 |
40 namespace content { | 41 namespace content { |
| 42 class BlobURLLoaderFactory; |
41 | 43 |
42 class CONTENT_EXPORT StoragePartitionImpl | 44 class CONTENT_EXPORT StoragePartitionImpl |
43 : public StoragePartition, | 45 : public StoragePartition, |
44 public NON_EXPORTED_BASE(mojom::StoragePartitionService) { | 46 public NON_EXPORTED_BASE(mojom::StoragePartitionService) { |
45 public: | 47 public: |
46 // It is guaranteed that storage partitions are destructed before the | 48 // It is guaranteed that storage partitions are destructed before the |
47 // browser context starts shutting down its corresponding IO thread residents | 49 // browser context starts shutting down its corresponding IO thread residents |
48 // (e.g. resource context). | 50 // (e.g. resource context). |
49 ~StoragePartitionImpl() override; | 51 ~StoragePartitionImpl() override; |
50 | 52 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 const base::Callback<bool(const GURL&)>& url_matcher, | 106 const base::Callback<bool(const GURL&)>& url_matcher, |
105 const base::Closure& callback) override; | 107 const base::Closure& callback) override; |
106 void Flush() override; | 108 void Flush() override; |
107 void ClearBluetoothAllowedDevicesMapForTesting() override; | 109 void ClearBluetoothAllowedDevicesMapForTesting() override; |
108 | 110 |
109 BackgroundFetchContext* GetBackgroundFetchContext(); | 111 BackgroundFetchContext* GetBackgroundFetchContext(); |
110 BackgroundSyncContext* GetBackgroundSyncContext(); | 112 BackgroundSyncContext* GetBackgroundSyncContext(); |
111 PaymentAppContextImpl* GetPaymentAppContext(); | 113 PaymentAppContextImpl* GetPaymentAppContext(); |
112 BroadcastChannelProvider* GetBroadcastChannelProvider(); | 114 BroadcastChannelProvider* GetBroadcastChannelProvider(); |
113 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); | 115 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); |
| 116 BlobURLLoaderFactory* GetBlobURLLoaderFactory(); |
114 | 117 |
115 // mojom::StoragePartitionService interface. | 118 // mojom::StoragePartitionService interface. |
116 void OpenLocalStorage( | 119 void OpenLocalStorage( |
117 const url::Origin& origin, | 120 const url::Origin& origin, |
118 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; | 121 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; |
119 | 122 |
120 // Returns the NetworkContext associated with this storage partition. Only | 123 // Returns the NetworkContext associated with this storage partition. Only |
121 // used when the network service is enabled. | 124 // used when the network service is enabled. |
122 mojom::NetworkContext* network_context() { return network_context_.get(); } | 125 mojom::NetworkContext* network_context() { return network_context_.get(); } |
123 | 126 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 236 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
234 scoped_refptr<PushMessagingContext> push_messaging_context_; | 237 scoped_refptr<PushMessagingContext> push_messaging_context_; |
235 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 238 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
236 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; | 239 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; |
237 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; | 240 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; |
238 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 241 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
239 scoped_refptr<BackgroundSyncContext> background_sync_context_; | 242 scoped_refptr<BackgroundSyncContext> background_sync_context_; |
240 scoped_refptr<PaymentAppContextImpl> payment_app_context_; | 243 scoped_refptr<PaymentAppContextImpl> payment_app_context_; |
241 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; | 244 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; |
242 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; | 245 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; |
| 246 scoped_refptr<BlobURLLoaderFactory> blob_url_loader_factory_; |
243 | 247 |
244 mojo::BindingSet<mojom::StoragePartitionService> bindings_; | 248 mojo::BindingSet<mojom::StoragePartitionService> bindings_; |
245 mojom::NetworkContextPtr network_context_; | 249 mojom::NetworkContextPtr network_context_; |
246 | 250 |
247 // Raw pointer that should always be valid. The BrowserContext owns the | 251 // Raw pointer that should always be valid. The BrowserContext owns the |
248 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the | 252 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the |
249 // BrowserContext is destroyed, |this| will be destroyed too. | 253 // BrowserContext is destroyed, |this| will be destroyed too. |
250 BrowserContext* browser_context_; | 254 BrowserContext* browser_context_; |
251 | 255 |
252 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; | 256 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; |
253 | 257 |
254 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 258 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
255 }; | 259 }; |
256 | 260 |
257 } // namespace content | 261 } // namespace content |
258 | 262 |
259 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 263 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
OLD | NEW |