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

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

Issue 1321733004: Use the site engagement eviction policy for temporary storage eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_eviction_policy
Patch Set: Created 5 years, 3 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
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/browser/storage_partition_impl.h" 5 #include "content/browser/storage_partition_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/sequenced_task_runner.h" 11 #include "base/sequenced_task_runner.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "content/browser/browser_main_loop.h" 14 #include "content/browser/browser_main_loop.h"
15 #include "content/browser/fileapi/browser_file_system_helper.h" 15 #include "content/browser/fileapi/browser_file_system_helper.h"
16 #include "content/browser/geofencing/geofencing_manager.h" 16 #include "content/browser/geofencing/geofencing_manager.h"
17 #include "content/browser/gpu/shader_disk_cache.h" 17 #include "content/browser/gpu/shader_disk_cache.h"
18 #include "content/browser/host_zoom_map_impl.h" 18 #include "content/browser/host_zoom_map_impl.h"
19 #include "content/browser/navigator_connect/navigator_connect_context_impl.h" 19 #include "content/browser/navigator_connect/navigator_connect_context_impl.h"
20 #include "content/browser/notifications/platform_notification_context_impl.h" 20 #include "content/browser/notifications/platform_notification_context_impl.h"
21 #include "content/common/dom_storage/dom_storage_types.h" 21 #include "content/common/dom_storage/dom_storage_types.h"
22 #include "content/public/browser/browser_context.h" 22 #include "content/public/browser/browser_context.h"
23 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
24 #include "content/public/browser/content_browser_client.h"
24 #include "content/public/browser/dom_storage_context.h" 25 #include "content/public/browser/dom_storage_context.h"
25 #include "content/public/browser/indexed_db_context.h" 26 #include "content/public/browser/indexed_db_context.h"
26 #include "content/public/browser/local_storage_usage_info.h" 27 #include "content/public/browser/local_storage_usage_info.h"
27 #include "content/public/browser/session_storage_usage_info.h" 28 #include "content/public/browser/session_storage_usage_info.h"
29 #include "content/public/common/content_client.h"
28 #include "net/base/completion_callback.h" 30 #include "net/base/completion_callback.h"
29 #include "net/base/net_errors.h" 31 #include "net/base/net_errors.h"
30 #include "net/cookies/cookie_monster.h" 32 #include "net/cookies/cookie_monster.h"
31 #include "net/url_request/url_request_context.h" 33 #include "net/url_request/url_request_context.h"
32 #include "net/url_request/url_request_context_getter.h" 34 #include "net/url_request/url_request_context_getter.h"
33 #include "storage/browser/database/database_tracker.h" 35 #include "storage/browser/database/database_tracker.h"
34 #include "storage/browser/quota/quota_manager.h" 36 #include "storage/browser/quota/quota_manager.h"
35 37
36 namespace content { 38 namespace content {
37 39
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 // unittests where a UI thread might not have been created. 416 // unittests where a UI thread might not have been created.
415 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || 417 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
416 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); 418 !BrowserThread::IsMessageLoopValid(BrowserThread::UI));
417 419
418 // All of the clients have to be created and registered with the 420 // All of the clients have to be created and registered with the
419 // QuotaManager prior to the QuotaManger being used. We do them 421 // QuotaManager prior to the QuotaManger being used. We do them
420 // all together here prior to handing out a reference to anything 422 // all together here prior to handing out a reference to anything
421 // that utilizes the QuotaManager. 423 // that utilizes the QuotaManager.
422 scoped_refptr<storage::QuotaManager> quota_manager = 424 scoped_refptr<storage::QuotaManager> quota_manager =
423 new storage::QuotaManager( 425 new storage::QuotaManager(
424 in_memory, 426 in_memory, partition_path,
425 partition_path,
426 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), 427 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(),
427 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(), 428 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get(),
428 context->GetSpecialStoragePolicy()); 429 context->GetSpecialStoragePolicy(),
430 GetContentClient()->browser()->GetTemporaryStorageEvictionPolicy(
431 context));
429 432
430 // Each consumer is responsible for registering its QuotaClient during 433 // Each consumer is responsible for registering its QuotaClient during
431 // its construction. 434 // its construction.
432 scoped_refptr<storage::FileSystemContext> filesystem_context = 435 scoped_refptr<storage::FileSystemContext> filesystem_context =
433 CreateFileSystemContext( 436 CreateFileSystemContext(
434 context, partition_path, in_memory, quota_manager->proxy()); 437 context, partition_path, in_memory, quota_manager->proxy());
435 438
436 scoped_refptr<storage::DatabaseTracker> database_tracker = 439 scoped_refptr<storage::DatabaseTracker> database_tracker =
437 new storage::DatabaseTracker(partition_path, 440 new storage::DatabaseTracker(partition_path,
438 in_memory, 441 in_memory,
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 net::URLRequestContextGetter* url_request_context) { 909 net::URLRequestContextGetter* url_request_context) {
907 url_request_context_ = url_request_context; 910 url_request_context_ = url_request_context;
908 } 911 }
909 912
910 void StoragePartitionImpl::SetMediaURLRequestContext( 913 void StoragePartitionImpl::SetMediaURLRequestContext(
911 net::URLRequestContextGetter* media_url_request_context) { 914 net::URLRequestContextGetter* media_url_request_context) {
912 media_url_request_context_ = media_url_request_context; 915 media_url_request_context_ = media_url_request_context;
913 } 916 }
914 917
915 } // namespace content 918 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698