Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: content/browser/storage_partition_impl.h

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/browser/appcache/chrome_appcache_service.h" 18 #include "content/browser/appcache/chrome_appcache_service.h"
18 #include "content/browser/background_sync/background_sync_context.h" 19 #include "content/browser/background_sync/background_sync_context.h"
19 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" 20 #include "content/browser/broadcast_channel/broadcast_channel_provider.h"
20 #include "content/browser/cache_storage/cache_storage_context_impl.h" 21 #include "content/browser/cache_storage/cache_storage_context_impl.h"
21 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 22 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
22 #include "content/browser/host_zoom_level_context.h" 23 #include "content/browser/host_zoom_level_context.h"
23 #include "content/browser/indexed_db/indexed_db_context_impl.h" 24 #include "content/browser/indexed_db/indexed_db_context_impl.h"
24 #include "content/browser/notifications/platform_notification_context_impl.h" 25 #include "content/browser/notifications/platform_notification_context_impl.h"
25 #include "content/browser/payments/payment_app_context_impl.h" 26 #include "content/browser/payments/payment_app_context_impl.h"
26 #include "content/browser/push_messaging/push_messaging_context.h" 27 #include "content/browser/push_messaging/push_messaging_context.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // StoragePartition's on-disk-storage. 159 // StoragePartition's on-disk-storage.
159 // 160 //
160 // If |in_memory| is true, the |relative_partition_path| is (ab)used as a way 161 // If |in_memory| is true, the |relative_partition_path| is (ab)used as a way
161 // of distinguishing different in-memory partitions, but nothing is persisted 162 // of distinguishing different in-memory partitions, but nothing is persisted
162 // on to disk. 163 // on to disk.
163 static std::unique_ptr<StoragePartitionImpl> Create( 164 static std::unique_ptr<StoragePartitionImpl> Create(
164 BrowserContext* context, 165 BrowserContext* context,
165 bool in_memory, 166 bool in_memory,
166 const base::FilePath& relative_partition_path); 167 const base::FilePath& relative_partition_path);
167 168
168 StoragePartitionImpl( 169 StoragePartitionImpl(BrowserContext* browser_context,
169 BrowserContext* browser_context, 170 const base::FilePath& partition_path,
170 const base::FilePath& partition_path, 171 storage::SpecialStoragePolicy* special_storage_policy);
171 storage::QuotaManager* quota_manager,
172 ChromeAppCacheService* appcache_service,
173 storage::FileSystemContext* filesystem_context,
174 storage::DatabaseTracker* database_tracker,
175 DOMStorageContextWrapper* dom_storage_context,
176 IndexedDBContextImpl* indexed_db_context,
177 CacheStorageContextImpl* cache_storage_context,
178 ServiceWorkerContextWrapper* service_worker_context,
179 PushMessagingContext* push_messaging_context,
180 storage::SpecialStoragePolicy* special_storage_policy,
181 HostZoomLevelContext* host_zoom_level_context,
182 PlatformNotificationContextImpl* platform_notification_context,
183 BackgroundSyncContext* background_sync_context,
184 PaymentAppContextImpl* payment_app_context,
185 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider);
186 172
187 // We will never have both remove_origin be populated and a cookie_matcher. 173 // We will never have both remove_origin be populated and a cookie_matcher.
188 void ClearDataImpl(uint32_t remove_mask, 174 void ClearDataImpl(uint32_t remove_mask,
189 uint32_t quota_storage_remove_mask, 175 uint32_t quota_storage_remove_mask,
190 const GURL& remove_origin, 176 const GURL& remove_origin,
191 const OriginMatcherFunction& origin_matcher, 177 const OriginMatcherFunction& origin_matcher,
192 const CookieMatcherFunction& cookie_matcher, 178 const CookieMatcherFunction& cookie_matcher,
193 net::URLRequestContextGetter* rq_context, 179 net::URLRequestContextGetter* rq_context,
194 const base::Time begin, 180 const base::Time begin,
195 const base::Time end, 181 const base::Time end,
196 const base::Closure& callback); 182 const base::Closure& callback);
197 183
198 // Used by StoragePartitionImplMap. 184 // Used by StoragePartitionImplMap.
199 // 185 //
200 // TODO(ajwong): These should be taken in the constructor and in Create() but 186 // TODO(ajwong): These should be taken in the constructor and in Create() but
201 // because the URLRequestContextGetter still lives in Profile with a tangled 187 // because the URLRequestContextGetter still lives in Profile with a tangled
202 // initialization, if we try to retrieve the URLRequestContextGetter() 188 // initialization, if we try to retrieve the URLRequestContextGetter()
203 // before the default StoragePartition is created, we end up reentering the 189 // before the default StoragePartition is created, we end up reentering the
204 // construction and double-initializing. For now, we retain the legacy 190 // construction and double-initializing. For now, we retain the legacy
205 // behavior while allowing StoragePartitionImpl to expose these accessors by 191 // behavior while allowing StoragePartitionImpl to expose these accessors by
206 // letting StoragePartitionImplMap call these two private settings at the 192 // letting StoragePartitionImplMap call these two private settings at the
207 // appropriate time. These should move back into the constructor once 193 // appropriate time. These should move back into the constructor once
208 // URLRequestContextGetter's lifetime is sorted out. We should also move the 194 // URLRequestContextGetter's lifetime is sorted out. We should also move the
209 // PostCreateInitialization() out of StoragePartitionImplMap. 195 // PostCreateInitialization() out of StoragePartitionImplMap.
210 void SetURLRequestContext( 196 void SetURLRequestContext(
211 net::URLRequestContextGetter* url_request_context); 197 net::URLRequestContextGetter* url_request_context);
212 void SetMediaURLRequestContext( 198 void SetMediaURLRequestContext(
213 net::URLRequestContextGetter* media_url_request_context); 199 net::URLRequestContextGetter* media_url_request_context);
214 200
201 // Function used by the quota system to ask the embedder for the
202 // storage configuration info.
203 void GetQuotaSettings(const storage::OptionalQuotaSettingsCallback& callback);
204
215 base::FilePath partition_path_; 205 base::FilePath partition_path_;
216 scoped_refptr<net::URLRequestContextGetter> url_request_context_; 206 scoped_refptr<net::URLRequestContextGetter> url_request_context_;
217 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; 207 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_;
218 scoped_refptr<storage::QuotaManager> quota_manager_; 208 scoped_refptr<storage::QuotaManager> quota_manager_;
219 scoped_refptr<ChromeAppCacheService> appcache_service_; 209 scoped_refptr<ChromeAppCacheService> appcache_service_;
220 scoped_refptr<storage::FileSystemContext> filesystem_context_; 210 scoped_refptr<storage::FileSystemContext> filesystem_context_;
221 scoped_refptr<storage::DatabaseTracker> database_tracker_; 211 scoped_refptr<storage::DatabaseTracker> database_tracker_;
222 scoped_refptr<DOMStorageContextWrapper> dom_storage_context_; 212 scoped_refptr<DOMStorageContextWrapper> dom_storage_context_;
223 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; 213 scoped_refptr<IndexedDBContextImpl> indexed_db_context_;
224 scoped_refptr<CacheStorageContextImpl> cache_storage_context_; 214 scoped_refptr<CacheStorageContextImpl> cache_storage_context_;
225 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; 215 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
226 scoped_refptr<PushMessagingContext> push_messaging_context_; 216 scoped_refptr<PushMessagingContext> push_messaging_context_;
227 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; 217 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_;
228 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; 218 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_;
229 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; 219 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_;
230 scoped_refptr<BackgroundSyncContext> background_sync_context_; 220 scoped_refptr<BackgroundSyncContext> background_sync_context_;
231 scoped_refptr<PaymentAppContextImpl> payment_app_context_; 221 scoped_refptr<PaymentAppContextImpl> payment_app_context_;
232 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; 222 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_;
233 223
234 mojo::BindingSet<mojom::StoragePartitionService> bindings_; 224 mojo::BindingSet<mojom::StoragePartitionService> bindings_;
235 225
236 // Raw pointer that should always be valid. The BrowserContext owns the 226 // Raw pointer that should always be valid. The BrowserContext owns the
237 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the 227 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the
238 // BrowserContext is destroyed, |this| will be destroyed too. 228 // BrowserContext is destroyed, |this| will be destroyed too.
239 BrowserContext* browser_context_; 229 BrowserContext* browser_context_;
240 230
231 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_;
232
241 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); 233 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl);
242 }; 234 };
243 235
244 } // namespace content 236 } // namespace content
245 237
246 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ 238 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698