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 "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "content/browser/appcache/chrome_appcache_service.h" | 15 #include "content/browser/appcache/chrome_appcache_service.h" |
16 #include "content/browser/background_sync/background_sync_context_impl.h" | 16 #include "content/browser/background_sync/background_sync_context_impl.h" |
17 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 17 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
18 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 18 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
19 #include "content/browser/host_zoom_level_context.h" | 19 #include "content/browser/host_zoom_level_context.h" |
20 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 20 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
21 #include "content/browser/media/webrtc/webrtc_identity_store.h" | 21 #include "content/browser/media/webrtc/webrtc_identity_store.h" |
22 #include "content/browser/notifications/platform_notification_context_impl.h" | 22 #include "content/browser/notifications/platform_notification_context_impl.h" |
23 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 23 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
24 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
25 #include "content/common/storage_partition_service.mojom.h" | 25 #include "content/common/storage_partition_service.mojom.h" |
26 #include "content/public/browser/storage_partition.h" | 26 #include "content/public/browser/storage_partition.h" |
27 #include "mojo/public/cpp/bindings/binding_set.h" | 27 #include "mojo/public/cpp/bindings/binding_set.h" |
| 28 #include "net/cookies/cookie_store.h" |
28 #include "storage/browser/quota/special_storage_policy.h" | 29 #include "storage/browser/quota/special_storage_policy.h" |
29 | 30 |
30 namespace content { | 31 namespace content { |
31 | 32 |
32 class StoragePartitionImpl : public StoragePartition, | 33 class StoragePartitionImpl : public StoragePartition, |
33 public mojom::StoragePartitionService { | 34 public mojom::StoragePartitionService { |
34 public: | 35 public: |
35 CONTENT_EXPORT ~StoragePartitionImpl() override; | 36 CONTENT_EXPORT ~StoragePartitionImpl() override; |
36 | 37 |
37 // Quota managed data uses a different bitmask for types than | 38 // Quota managed data uses a different bitmask for types than |
38 // StoragePartition uses. This method generates that mask. | 39 // StoragePartition uses. This method generates that mask. |
39 CONTENT_EXPORT static int GenerateQuotaClientMask(uint32_t remove_mask); | 40 CONTENT_EXPORT static int GenerateQuotaClientMask(uint32_t remove_mask); |
40 | 41 |
| 42 // This creates a CookiePredicate that matches all host (NOT domain) cookies |
| 43 // that match the host of |url|. This is intended to be used with |
| 44 // DeleteAllCreatedBetweenWithPredicateAsync. |
| 45 CONTENT_EXPORT static net::CookieStore::CookiePredicate |
| 46 CreatePredicateForHostCookies(const GURL& url); |
| 47 |
41 CONTENT_EXPORT void OverrideQuotaManagerForTesting( | 48 CONTENT_EXPORT void OverrideQuotaManagerForTesting( |
42 storage::QuotaManager* quota_manager); | 49 storage::QuotaManager* quota_manager); |
43 CONTENT_EXPORT void OverrideSpecialStoragePolicyForTesting( | 50 CONTENT_EXPORT void OverrideSpecialStoragePolicyForTesting( |
44 storage::SpecialStoragePolicy* special_storage_policy); | 51 storage::SpecialStoragePolicy* special_storage_policy); |
45 | 52 |
46 // StoragePartition interface. | 53 // StoragePartition interface. |
47 base::FilePath GetPath() override; | 54 base::FilePath GetPath() override; |
48 net::URLRequestContextGetter* GetURLRequestContext() override; | 55 net::URLRequestContextGetter* GetURLRequestContext() override; |
49 net::URLRequestContextGetter* GetMediaURLRequestContext() override; | 56 net::URLRequestContextGetter* GetMediaURLRequestContext() override; |
50 storage::QuotaManager* GetQuotaManager() override; | 57 storage::QuotaManager* GetQuotaManager() override; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the | 216 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the |
210 // BrowserContext is destroyed, |this| will be destroyed too. | 217 // BrowserContext is destroyed, |this| will be destroyed too. |
211 BrowserContext* browser_context_; | 218 BrowserContext* browser_context_; |
212 | 219 |
213 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 220 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
214 }; | 221 }; |
215 | 222 |
216 } // namespace content | 223 } // namespace content |
217 | 224 |
218 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 225 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
OLD | NEW |