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 #include "content/browser/storage_partition_impl.h" | 5 #include "content/browser/storage_partition_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "content/browser/browser_main_loop.h" | 17 #include "content/browser/browser_main_loop.h" |
| 18 #include "content/browser/browsing_data/storage_partition_http_cache_data_remove
r.h" |
18 #include "content/browser/fileapi/browser_file_system_helper.h" | 19 #include "content/browser/fileapi/browser_file_system_helper.h" |
19 #include "content/browser/gpu/shader_cache_factory.h" | 20 #include "content/browser/gpu/shader_cache_factory.h" |
20 #include "content/browser/host_zoom_map_impl.h" | 21 #include "content/browser/host_zoom_map_impl.h" |
21 #include "content/browser/notifications/platform_notification_context_impl.h" | 22 #include "content/browser/notifications/platform_notification_context_impl.h" |
22 #include "content/common/dom_storage/dom_storage_types.h" | 23 #include "content/common/dom_storage/dom_storage_types.h" |
23 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
25 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
26 #include "content/public/browser/dom_storage_context.h" | 27 #include "content/public/browser/dom_storage_context.h" |
27 #include "content/public/browser/indexed_db_context.h" | 28 #include "content/public/browser/indexed_db_context.h" |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 uint32_t quota_storage_remove_mask, | 871 uint32_t quota_storage_remove_mask, |
871 const OriginMatcherFunction& origin_matcher, | 872 const OriginMatcherFunction& origin_matcher, |
872 const CookieMatcherFunction& cookie_matcher, | 873 const CookieMatcherFunction& cookie_matcher, |
873 const base::Time begin, | 874 const base::Time begin, |
874 const base::Time end, | 875 const base::Time end, |
875 const base::Closure& callback) { | 876 const base::Closure& callback) { |
876 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), origin_matcher, | 877 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), origin_matcher, |
877 cookie_matcher, GetURLRequestContext(), begin, end, callback); | 878 cookie_matcher, GetURLRequestContext(), begin, end, callback); |
878 } | 879 } |
879 | 880 |
| 881 void StoragePartitionImpl::ClearHttpAndMediaCaches( |
| 882 const base::Time begin, |
| 883 const base::Time end, |
| 884 const base::Callback<bool(const GURL&)>& url_matcher, |
| 885 const base::Closure& callback) { |
| 886 // StoragePartitionHttpCacheDataRemover deletes itself when it is done. |
| 887 if (url_matcher.is_null()) { |
| 888 StoragePartitionHttpCacheDataRemover::CreateForRange(this, begin, end) |
| 889 ->Remove(callback); |
| 890 } else { |
| 891 StoragePartitionHttpCacheDataRemover::CreateForURLsAndRange( |
| 892 this, url_matcher, begin, end) |
| 893 ->Remove(callback); |
| 894 } |
| 895 } |
| 896 |
880 void StoragePartitionImpl::Flush() { | 897 void StoragePartitionImpl::Flush() { |
881 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 898 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
882 if (GetDOMStorageContext()) | 899 if (GetDOMStorageContext()) |
883 GetDOMStorageContext()->Flush(); | 900 GetDOMStorageContext()->Flush(); |
884 } | 901 } |
885 | 902 |
886 void StoragePartitionImpl::ClearBluetoothAllowedDevicesMapForTesting() { | 903 void StoragePartitionImpl::ClearBluetoothAllowedDevicesMapForTesting() { |
887 bluetooth_allowed_devices_map_->Clear(); | 904 bluetooth_allowed_devices_map_->Clear(); |
888 } | 905 } |
889 | 906 |
(...skipping 26 matching lines...) Expand all Loading... |
916 media_url_request_context_ = media_url_request_context; | 933 media_url_request_context_ = media_url_request_context; |
917 } | 934 } |
918 | 935 |
919 void StoragePartitionImpl::GetQuotaSettings( | 936 void StoragePartitionImpl::GetQuotaSettings( |
920 const storage::OptionalQuotaSettingsCallback& callback) { | 937 const storage::OptionalQuotaSettingsCallback& callback) { |
921 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, | 938 GetContentClient()->browser()->GetQuotaSettings(browser_context_, this, |
922 callback); | 939 callback); |
923 } | 940 } |
924 | 941 |
925 } // namespace content | 942 } // namespace content |
OLD | NEW |