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> |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 base::Closure decrement_callback = base::Bind( | 650 base::Closure decrement_callback = base::Bind( |
651 &QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO, | 651 &QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO, |
652 base::Unretained(this)); | 652 base::Unretained(this)); |
653 | 653 |
654 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_PERSISTENT) { | 654 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_PERSISTENT) { |
655 IncrementTaskCountOnIO(); | 655 IncrementTaskCountOnIO(); |
656 // Ask the QuotaManager for all origins with persistent quota modified | 656 // Ask the QuotaManager for all origins with persistent quota modified |
657 // within the user-specified timeframe, and deal with the resulting set in | 657 // within the user-specified timeframe, and deal with the resulting set in |
658 // ClearQuotaManagedOriginsOnIOThread(). | 658 // ClearQuotaManagedOriginsOnIOThread(). |
659 quota_manager->GetOriginsModifiedSince( | 659 quota_manager->GetOriginsModifiedSince( |
660 storage::kStorageTypePersistent, | 660 storage::kStorageTypePersistent, begin, |
661 begin, | |
662 base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, | 661 base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, |
663 base::Unretained(this), | 662 base::Unretained(this), base::RetainedRef(quota_manager), |
664 quota_manager, | 663 special_storage_policy, origin_matcher, decrement_callback)); |
665 special_storage_policy, | |
666 origin_matcher, | |
667 decrement_callback)); | |
668 } | 664 } |
669 | 665 |
670 // Do the same for temporary quota. | 666 // Do the same for temporary quota. |
671 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_TEMPORARY) { | 667 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_TEMPORARY) { |
672 IncrementTaskCountOnIO(); | 668 IncrementTaskCountOnIO(); |
673 quota_manager->GetOriginsModifiedSince( | 669 quota_manager->GetOriginsModifiedSince( |
674 storage::kStorageTypeTemporary, | 670 storage::kStorageTypeTemporary, begin, |
675 begin, | |
676 base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, | 671 base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, |
677 base::Unretained(this), | 672 base::Unretained(this), base::RetainedRef(quota_manager), |
678 quota_manager, | 673 special_storage_policy, origin_matcher, decrement_callback)); |
679 special_storage_policy, | |
680 origin_matcher, | |
681 decrement_callback)); | |
682 } | 674 } |
683 | 675 |
684 // Do the same for syncable quota. | 676 // Do the same for syncable quota. |
685 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_SYNCABLE) { | 677 if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_SYNCABLE) { |
686 IncrementTaskCountOnIO(); | 678 IncrementTaskCountOnIO(); |
687 quota_manager->GetOriginsModifiedSince( | 679 quota_manager->GetOriginsModifiedSince( |
688 storage::kStorageTypeSyncable, | 680 storage::kStorageTypeSyncable, begin, |
689 begin, | |
690 base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, | 681 base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread, |
691 base::Unretained(this), | 682 base::Unretained(this), base::RetainedRef(quota_manager), |
692 quota_manager, | 683 special_storage_policy, origin_matcher, decrement_callback)); |
693 special_storage_policy, | |
694 origin_matcher, | |
695 decrement_callback)); | |
696 } | 684 } |
697 | 685 |
698 DecrementTaskCountOnIO(); | 686 DecrementTaskCountOnIO(); |
699 } | 687 } |
700 | 688 |
701 void | 689 void |
702 StoragePartitionImpl::QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread( | 690 StoragePartitionImpl::QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread( |
703 storage::QuotaManager* quota_manager, | 691 storage::QuotaManager* quota_manager, |
704 const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy, | 692 const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy, |
705 const StoragePartition::OriginMatcherFunction& origin_matcher, | 693 const StoragePartition::OriginMatcherFunction& origin_matcher, |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 net::URLRequestContextGetter* url_request_context) { | 904 net::URLRequestContextGetter* url_request_context) { |
917 url_request_context_ = url_request_context; | 905 url_request_context_ = url_request_context; |
918 } | 906 } |
919 | 907 |
920 void StoragePartitionImpl::SetMediaURLRequestContext( | 908 void StoragePartitionImpl::SetMediaURLRequestContext( |
921 net::URLRequestContextGetter* media_url_request_context) { | 909 net::URLRequestContextGetter* media_url_request_context) { |
922 media_url_request_context_ = media_url_request_context; | 910 media_url_request_context_ = media_url_request_context; |
923 } | 911 } |
924 | 912 |
925 } // namespace content | 913 } // namespace content |
OLD | NEW |