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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "content/browser/appcache/chrome_appcache_service.h" | 11 #include "content/browser/appcache/chrome_appcache_service.h" |
12 #include "content/browser/dom_storage/dom_storage_context_impl.h" | 12 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
13 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 13 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 14 #include "content/common/content_export.h" |
14 #include "content/public/browser/storage_partition.h" | 15 #include "content/public/browser/storage_partition.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 class StoragePartitionImpl : public StoragePartition { | 19 class StoragePartitionImpl : public StoragePartition { |
19 public: | 20 public: |
20 virtual ~StoragePartitionImpl(); | 21 CONTENT_EXPORT virtual ~StoragePartitionImpl(); |
21 | 22 |
22 // StoragePartition interface. | 23 // StoragePartition interface. |
23 virtual base::FilePath GetPath() OVERRIDE; | 24 virtual base::FilePath GetPath() OVERRIDE; |
24 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; | 25 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; |
25 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE; | 26 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE; |
26 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; | 27 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; |
27 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; | 28 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; |
28 virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE; | 29 virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE; |
29 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; | 30 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; |
30 virtual DOMStorageContextImpl* GetDOMStorageContext() OVERRIDE; | 31 virtual DOMStorageContextImpl* GetDOMStorageContext() OVERRIDE; |
31 virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE; | 32 virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE; |
32 virtual void AsyncClearDataForOrigin( | 33 virtual void AsyncClearDataForOrigin( |
33 uint32 storage_mask, | 34 uint32 storage_mask, |
34 const GURL& storage_origin, | 35 const GURL& storage_origin, |
35 net::URLRequestContextGetter* request_context_getter) OVERRIDE; | 36 net::URLRequestContextGetter* request_context_getter) OVERRIDE; |
36 virtual void AsyncClearData(uint32 storage_mask) OVERRIDE; | 37 virtual void AsyncClearData(uint32 storage_mask) OVERRIDE; |
| 38 virtual void AsyncClearDataBetween( |
| 39 uint32 storage_mask, |
| 40 const base::Time& begin, |
| 41 const base::Time& end, |
| 42 const base::Closure& callback) OVERRIDE; |
37 | 43 |
38 private: | 44 private: |
39 friend class StoragePartitionImplMap; | 45 friend class StoragePartitionImplMap; |
| 46 FRIEND_TEST_ALL_PREFIXES(StoragePartitionShaderClearTest, ClearShaderCache); |
40 | 47 |
41 // The |partition_path| is the absolute path to the root of this | 48 // The |partition_path| is the absolute path to the root of this |
42 // StoragePartition's on-disk storage. | 49 // StoragePartition's on-disk storage. |
43 // | 50 // |
44 // If |in_memory| is true, the |partition_path| is (ab)used as a way of | 51 // If |in_memory| is true, the |partition_path| is (ab)used as a way of |
45 // distinguishing different in-memory partitions, but nothing is persisted | 52 // distinguishing different in-memory partitions, but nothing is persisted |
46 // on to disk. | 53 // on to disk. |
47 static StoragePartitionImpl* Create(BrowserContext* context, | 54 static StoragePartitionImpl* Create(BrowserContext* context, |
48 bool in_memory, | 55 bool in_memory, |
49 const base::FilePath& profile_path); | 56 const base::FilePath& profile_path); |
50 | 57 |
51 StoragePartitionImpl( | 58 CONTENT_EXPORT StoragePartitionImpl( |
52 const base::FilePath& partition_path, | 59 const base::FilePath& partition_path, |
53 quota::QuotaManager* quota_manager, | 60 quota::QuotaManager* quota_manager, |
54 ChromeAppCacheService* appcache_service, | 61 ChromeAppCacheService* appcache_service, |
55 fileapi::FileSystemContext* filesystem_context, | 62 fileapi::FileSystemContext* filesystem_context, |
56 webkit_database::DatabaseTracker* database_tracker, | 63 webkit_database::DatabaseTracker* database_tracker, |
57 DOMStorageContextImpl* dom_storage_context, | 64 DOMStorageContextImpl* dom_storage_context, |
58 IndexedDBContextImpl* indexed_db_context); | 65 IndexedDBContextImpl* indexed_db_context); |
59 | 66 |
60 // Used by StoragePartitionImplMap. | 67 // Used by StoragePartitionImplMap. |
61 // | 68 // |
(...skipping 20 matching lines...) Expand all Loading... |
82 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 89 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
83 scoped_refptr<DOMStorageContextImpl> dom_storage_context_; | 90 scoped_refptr<DOMStorageContextImpl> dom_storage_context_; |
84 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; | 91 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; |
85 | 92 |
86 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 93 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
87 }; | 94 }; |
88 | 95 |
89 } // namespace content | 96 } // namespace content |
90 | 97 |
91 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 98 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
OLD | NEW |