| 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 <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 int quota_client_mask = 0; | 205 int quota_client_mask = 0; |
| 206 | 206 |
| 207 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS) | 207 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS) |
| 208 quota_client_mask |= storage::QuotaClient::kFileSystem; | 208 quota_client_mask |= storage::QuotaClient::kFileSystem; |
| 209 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_WEBSQL) | 209 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_WEBSQL) |
| 210 quota_client_mask |= storage::QuotaClient::kDatabase; | 210 quota_client_mask |= storage::QuotaClient::kDatabase; |
| 211 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_APPCACHE) | 211 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_APPCACHE) |
| 212 quota_client_mask |= storage::QuotaClient::kAppcache; | 212 quota_client_mask |= storage::QuotaClient::kAppcache; |
| 213 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_INDEXEDDB) | 213 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_INDEXEDDB) |
| 214 quota_client_mask |= storage::QuotaClient::kIndexedDatabase; | 214 quota_client_mask |= storage::QuotaClient::kIndexedDatabase; |
| 215 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_SERVICE_WORKERS) { | 215 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_SERVICE_WORKERS) |
| 216 quota_client_mask |= storage::QuotaClient::kServiceWorker; | 216 quota_client_mask |= storage::QuotaClient::kServiceWorker; |
| 217 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_CACHE_STORAGE) |
| 217 quota_client_mask |= storage::QuotaClient::kServiceWorkerCache; | 218 quota_client_mask |= storage::QuotaClient::kServiceWorkerCache; |
| 218 } | |
| 219 | |
| 220 | 219 |
| 221 return quota_client_mask; | 220 return quota_client_mask; |
| 222 } | 221 } |
| 223 | 222 |
| 224 // Helper for deleting quota managed data from a partition. | 223 // Helper for deleting quota managed data from a partition. |
| 225 // | 224 // |
| 226 // Most of the operations in this class are done on IO thread. | 225 // Most of the operations in this class are done on IO thread. |
| 227 struct StoragePartitionImpl::QuotaManagedDataDeletionHelper { | 226 struct StoragePartitionImpl::QuotaManagedDataDeletionHelper { |
| 228 QuotaManagedDataDeletionHelper(uint32 remove_mask, | 227 QuotaManagedDataDeletionHelper(uint32 remove_mask, |
| 229 uint32 quota_storage_remove_mask, | 228 uint32 quota_storage_remove_mask, |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 BrowserThread::IO, FROM_HERE, | 782 BrowserThread::IO, FROM_HERE, |
| 784 base::Bind(&ClearCookiesOnIOThread, | 783 base::Bind(&ClearCookiesOnIOThread, |
| 785 make_scoped_refptr(rq_context), begin, end, storage_origin, | 784 make_scoped_refptr(rq_context), begin, end, storage_origin, |
| 786 decrement_callback)); | 785 decrement_callback)); |
| 787 } | 786 } |
| 788 | 787 |
| 789 if (remove_mask & REMOVE_DATA_MASK_INDEXEDDB || | 788 if (remove_mask & REMOVE_DATA_MASK_INDEXEDDB || |
| 790 remove_mask & REMOVE_DATA_MASK_WEBSQL || | 789 remove_mask & REMOVE_DATA_MASK_WEBSQL || |
| 791 remove_mask & REMOVE_DATA_MASK_APPCACHE || | 790 remove_mask & REMOVE_DATA_MASK_APPCACHE || |
| 792 remove_mask & REMOVE_DATA_MASK_FILE_SYSTEMS || | 791 remove_mask & REMOVE_DATA_MASK_FILE_SYSTEMS || |
| 793 remove_mask & REMOVE_DATA_MASK_SERVICE_WORKERS) { | 792 remove_mask & REMOVE_DATA_MASK_SERVICE_WORKERS || |
| 793 remove_mask & REMOVE_DATA_MASK_CACHE_STORAGE) { |
| 794 IncrementTaskCountOnUI(); | 794 IncrementTaskCountOnUI(); |
| 795 BrowserThread::PostTask( | 795 BrowserThread::PostTask( |
| 796 BrowserThread::IO, FROM_HERE, | 796 BrowserThread::IO, FROM_HERE, |
| 797 base::Bind(&DataDeletionHelper::ClearQuotaManagedDataOnIOThread, | 797 base::Bind(&DataDeletionHelper::ClearQuotaManagedDataOnIOThread, |
| 798 base::Unretained(this), | 798 base::Unretained(this), |
| 799 make_scoped_refptr(quota_manager), | 799 make_scoped_refptr(quota_manager), |
| 800 begin, | 800 begin, |
| 801 storage_origin, | 801 storage_origin, |
| 802 make_scoped_refptr(special_storage_policy), | 802 make_scoped_refptr(special_storage_policy), |
| 803 origin_matcher, | 803 origin_matcher, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 net::URLRequestContextGetter* url_request_context) { | 906 net::URLRequestContextGetter* url_request_context) { |
| 907 url_request_context_ = url_request_context; | 907 url_request_context_ = url_request_context; |
| 908 } | 908 } |
| 909 | 909 |
| 910 void StoragePartitionImpl::SetMediaURLRequestContext( | 910 void StoragePartitionImpl::SetMediaURLRequestContext( |
| 911 net::URLRequestContextGetter* media_url_request_context) { | 911 net::URLRequestContextGetter* media_url_request_context) { |
| 912 media_url_request_context_ = media_url_request_context; | 912 media_url_request_context_ = media_url_request_context; |
| 913 } | 913 } |
| 914 | 914 |
| 915 } // namespace content | 915 } // namespace content |
| OLD | NEW |