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/indexed_db/indexed_db_context_impl.h" | 26 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
26 #include "content/browser/notifications/platform_notification_context_impl.h" | 27 #include "content/browser/notifications/platform_notification_context_impl.h" |
27 #include "content/browser/payments/payment_app_context_impl.h" | 28 #include "content/browser/payments/payment_app_context_impl.h" |
28 #include "content/browser/push_messaging/push_messaging_context.h" | 29 #include "content/browser/push_messaging/push_messaging_context.h" |
29 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 30 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
30 #include "content/browser/url_loader_factory_getter.h" | 31 #include "content/browser/url_loader_factory_getter.h" |
31 #include "content/common/content_export.h" | 32 #include "content/common/content_export.h" |
32 #include "content/common/network_service.mojom.h" | 33 #include "content/common/network_service.mojom.h" |
33 #include "content/common/storage_partition_service.mojom.h" | 34 #include "content/common/storage_partition_service.mojom.h" |
34 #include "content/public/browser/storage_partition.h" | 35 #include "content/public/browser/storage_partition.h" |
35 #include "mojo/public/cpp/bindings/binding_set.h" | 36 #include "mojo/public/cpp/bindings/binding_set.h" |
36 #include "net/cookies/cookie_store.h" | 37 #include "net/cookies/cookie_store.h" |
37 #include "storage/browser/quota/special_storage_policy.h" | 38 #include "storage/browser/quota/special_storage_policy.h" |
38 | 39 |
39 #if !defined(OS_ANDROID) | 40 #if !defined(OS_ANDROID) |
40 #include "content/browser/host_zoom_level_context.h" | 41 #include "content/browser/host_zoom_level_context.h" |
41 #endif | 42 #endif |
42 | 43 |
43 namespace content { | 44 namespace content { |
| 45 class BlobURLLoaderFactory; |
44 | 46 |
45 class CONTENT_EXPORT StoragePartitionImpl | 47 class CONTENT_EXPORT StoragePartitionImpl |
46 : public StoragePartition, | 48 : public StoragePartition, |
47 public NON_EXPORTED_BASE(mojom::StoragePartitionService) { | 49 public NON_EXPORTED_BASE(mojom::StoragePartitionService) { |
48 public: | 50 public: |
49 // It is guaranteed that storage partitions are destructed before the | 51 // It is guaranteed that storage partitions are destructed before the |
50 // browser context starts shutting down its corresponding IO thread residents | 52 // browser context starts shutting down its corresponding IO thread residents |
51 // (e.g. resource context). | 53 // (e.g. resource context). |
52 ~StoragePartitionImpl() override; | 54 ~StoragePartitionImpl() override; |
53 | 55 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 const base::Callback<bool(const GURL&)>& url_matcher, | 111 const base::Callback<bool(const GURL&)>& url_matcher, |
110 const base::Closure& callback) override; | 112 const base::Closure& callback) override; |
111 void Flush() override; | 113 void Flush() override; |
112 void ClearBluetoothAllowedDevicesMapForTesting() override; | 114 void ClearBluetoothAllowedDevicesMapForTesting() override; |
113 | 115 |
114 BackgroundFetchContext* GetBackgroundFetchContext(); | 116 BackgroundFetchContext* GetBackgroundFetchContext(); |
115 BackgroundSyncContext* GetBackgroundSyncContext(); | 117 BackgroundSyncContext* GetBackgroundSyncContext(); |
116 PaymentAppContextImpl* GetPaymentAppContext(); | 118 PaymentAppContextImpl* GetPaymentAppContext(); |
117 BroadcastChannelProvider* GetBroadcastChannelProvider(); | 119 BroadcastChannelProvider* GetBroadcastChannelProvider(); |
118 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); | 120 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); |
| 121 BlobURLLoaderFactory* GetBlobURLLoaderFactory(); |
119 | 122 |
120 // mojom::StoragePartitionService interface. | 123 // mojom::StoragePartitionService interface. |
121 void OpenLocalStorage( | 124 void OpenLocalStorage( |
122 const url::Origin& origin, | 125 const url::Origin& origin, |
123 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; | 126 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; |
124 | 127 |
125 // Returns the NetworkContext associated with this storage partition. Only | 128 // Returns the NetworkContext associated with this storage partition. Only |
126 // used when the network service is enabled. | 129 // used when the network service is enabled. |
127 mojom::NetworkContext* network_context() { return network_context_.get(); } | 130 mojom::NetworkContext* network_context() { return network_context_.get(); } |
128 | 131 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 243 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
241 #if !defined(OS_ANDROID) | 244 #if !defined(OS_ANDROID) |
242 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; | 245 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; |
243 #endif // !defined(OS_ANDROID) | 246 #endif // !defined(OS_ANDROID) |
244 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; | 247 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; |
245 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 248 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
246 scoped_refptr<BackgroundSyncContext> background_sync_context_; | 249 scoped_refptr<BackgroundSyncContext> background_sync_context_; |
247 scoped_refptr<PaymentAppContextImpl> payment_app_context_; | 250 scoped_refptr<PaymentAppContextImpl> payment_app_context_; |
248 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; | 251 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; |
249 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; | 252 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; |
| 253 scoped_refptr<BlobURLLoaderFactory> blob_url_loader_factory_; |
250 | 254 |
251 mojo::BindingSet<mojom::StoragePartitionService> bindings_; | 255 mojo::BindingSet<mojom::StoragePartitionService> bindings_; |
252 mojom::NetworkContextPtr network_context_; | 256 mojom::NetworkContextPtr network_context_; |
253 | 257 |
254 // Raw pointer that should always be valid. The BrowserContext owns the | 258 // Raw pointer that should always be valid. The BrowserContext owns the |
255 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the | 259 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the |
256 // BrowserContext is destroyed, |this| will be destroyed too. | 260 // BrowserContext is destroyed, |this| will be destroyed too. |
257 BrowserContext* browser_context_; | 261 BrowserContext* browser_context_; |
258 | 262 |
259 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; | 263 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; |
260 | 264 |
261 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 265 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
262 }; | 266 }; |
263 | 267 |
264 } // namespace content | 268 } // namespace content |
265 | 269 |
266 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 270 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
OLD | NEW |