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/browser/media/webrtc_identity_store.h" |
14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
15 #include "content/public/browser/storage_partition.h" | 16 #include "content/public/browser/storage_partition.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 class StoragePartitionImpl : public StoragePartition { | 20 class StoragePartitionImpl : public StoragePartition { |
20 public: | 21 public: |
21 CONTENT_EXPORT virtual ~StoragePartitionImpl(); | 22 CONTENT_EXPORT virtual ~StoragePartitionImpl(); |
22 | 23 |
23 // StoragePartition interface. | 24 // StoragePartition interface. |
(...skipping 10 matching lines...) Expand all Loading... |
34 uint32 storage_mask, | 35 uint32 storage_mask, |
35 const GURL& storage_origin, | 36 const GURL& storage_origin, |
36 net::URLRequestContextGetter* request_context_getter) OVERRIDE; | 37 net::URLRequestContextGetter* request_context_getter) OVERRIDE; |
37 virtual void AsyncClearData(uint32 storage_mask) OVERRIDE; | 38 virtual void AsyncClearData(uint32 storage_mask) OVERRIDE; |
38 virtual void AsyncClearDataBetween( | 39 virtual void AsyncClearDataBetween( |
39 uint32 storage_mask, | 40 uint32 storage_mask, |
40 const base::Time& begin, | 41 const base::Time& begin, |
41 const base::Time& end, | 42 const base::Time& end, |
42 const base::Closure& callback) OVERRIDE; | 43 const base::Closure& callback) OVERRIDE; |
43 | 44 |
| 45 WebRTCIdentityStore* GetWebRTCIdentityStore(); |
| 46 |
44 private: | 47 private: |
45 friend class StoragePartitionImplMap; | 48 friend class StoragePartitionImplMap; |
46 FRIEND_TEST_ALL_PREFIXES(StoragePartitionShaderClearTest, ClearShaderCache); | 49 FRIEND_TEST_ALL_PREFIXES(StoragePartitionShaderClearTest, ClearShaderCache); |
47 | 50 |
48 // The |partition_path| is the absolute path to the root of this | 51 // The |partition_path| is the absolute path to the root of this |
49 // StoragePartition's on-disk storage. | 52 // StoragePartition's on-disk storage. |
50 // | 53 // |
51 // If |in_memory| is true, the |partition_path| is (ab)used as a way of | 54 // If |in_memory| is true, the |partition_path| is (ab)used as a way of |
52 // distinguishing different in-memory partitions, but nothing is persisted | 55 // distinguishing different in-memory partitions, but nothing is persisted |
53 // on to disk. | 56 // on to disk. |
54 static StoragePartitionImpl* Create(BrowserContext* context, | 57 static StoragePartitionImpl* Create(BrowserContext* context, |
55 bool in_memory, | 58 bool in_memory, |
56 const base::FilePath& profile_path); | 59 const base::FilePath& profile_path); |
57 | 60 |
58 CONTENT_EXPORT StoragePartitionImpl( | 61 CONTENT_EXPORT StoragePartitionImpl( |
59 const base::FilePath& partition_path, | 62 const base::FilePath& partition_path, |
60 quota::QuotaManager* quota_manager, | 63 quota::QuotaManager* quota_manager, |
61 ChromeAppCacheService* appcache_service, | 64 ChromeAppCacheService* appcache_service, |
62 fileapi::FileSystemContext* filesystem_context, | 65 fileapi::FileSystemContext* filesystem_context, |
63 webkit_database::DatabaseTracker* database_tracker, | 66 webkit_database::DatabaseTracker* database_tracker, |
64 DOMStorageContextImpl* dom_storage_context, | 67 DOMStorageContextImpl* dom_storage_context, |
65 IndexedDBContextImpl* indexed_db_context); | 68 IndexedDBContextImpl* indexed_db_context, |
| 69 scoped_ptr<WebRTCIdentityStore> webrtc_identity_store); |
66 | 70 |
67 // Used by StoragePartitionImplMap. | 71 // Used by StoragePartitionImplMap. |
68 // | 72 // |
69 // TODO(ajwong): These should be taken in the constructor and in Create() but | 73 // TODO(ajwong): These should be taken in the constructor and in Create() but |
70 // because the URLRequestContextGetter still lives in Profile with a tangled | 74 // because the URLRequestContextGetter still lives in Profile with a tangled |
71 // initialization, if we try to retrieve the URLRequestContextGetter() | 75 // initialization, if we try to retrieve the URLRequestContextGetter() |
72 // before the default StoragePartition is created, we end up reentering the | 76 // before the default StoragePartition is created, we end up reentering the |
73 // construction and double-initializing. For now, we retain the legacy | 77 // construction and double-initializing. For now, we retain the legacy |
74 // behavior while allowing StoragePartitionImpl to expose these accessors by | 78 // behavior while allowing StoragePartitionImpl to expose these accessors by |
75 // letting StoragePartitionImplMap call these two private settings at the | 79 // letting StoragePartitionImplMap call these two private settings at the |
76 // appropriate time. These should move back into the constructor once | 80 // appropriate time. These should move back into the constructor once |
77 // URLRequestContextGetter's lifetime is sorted out. We should also move the | 81 // URLRequestContextGetter's lifetime is sorted out. We should also move the |
78 // PostCreateInitialization() out of StoragePartitionImplMap. | 82 // PostCreateInitialization() out of StoragePartitionImplMap. |
79 void SetURLRequestContext(net::URLRequestContextGetter* url_request_context); | 83 void SetURLRequestContext(net::URLRequestContextGetter* url_request_context); |
80 void SetMediaURLRequestContext( | 84 void SetMediaURLRequestContext( |
81 net::URLRequestContextGetter* media_url_request_context); | 85 net::URLRequestContextGetter* media_url_request_context); |
82 | 86 |
83 base::FilePath partition_path_; | 87 base::FilePath partition_path_; |
84 scoped_refptr<net::URLRequestContextGetter> url_request_context_; | 88 scoped_refptr<net::URLRequestContextGetter> url_request_context_; |
85 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; | 89 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; |
86 scoped_refptr<quota::QuotaManager> quota_manager_; | 90 scoped_refptr<quota::QuotaManager> quota_manager_; |
87 scoped_refptr<ChromeAppCacheService> appcache_service_; | 91 scoped_refptr<ChromeAppCacheService> appcache_service_; |
88 scoped_refptr<fileapi::FileSystemContext> filesystem_context_; | 92 scoped_refptr<fileapi::FileSystemContext> filesystem_context_; |
89 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 93 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
90 scoped_refptr<DOMStorageContextImpl> dom_storage_context_; | 94 scoped_refptr<DOMStorageContextImpl> dom_storage_context_; |
91 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; | 95 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; |
| 96 scoped_ptr<WebRTCIdentityStore> webrtc_identity_store_; |
92 | 97 |
93 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 98 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
94 }; | 99 }; |
95 | 100 |
96 } // namespace content | 101 } // namespace content |
97 | 102 |
98 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 103 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
OLD | NEW |