OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "webkit/browser/quota/quota_manager.h" | 5 #include "webkit/browser/quota/quota_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <functional> | 9 #include <functional> |
10 #include <set> | 10 #include <set> |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 bool AppendEntry(const OriginInfoTableEntry& entry) { | 790 bool AppendEntry(const OriginInfoTableEntry& entry) { |
791 entries_.push_back(entry); | 791 entries_.push_back(entry); |
792 return true; | 792 return true; |
793 } | 793 } |
794 | 794 |
795 OriginInfoTableEntries entries_; | 795 OriginInfoTableEntries entries_; |
796 }; | 796 }; |
797 | 797 |
798 // QuotaManager --------------------------------------------------------------- | 798 // QuotaManager --------------------------------------------------------------- |
799 | 799 |
800 QuotaManager::QuotaManager(bool is_incognito, | 800 QuotaManager::QuotaManager( |
801 const base::FilePath& profile_path, | 801 bool is_incognito, |
802 base::SingleThreadTaskRunner* io_thread, | 802 const base::FilePath& profile_path, |
803 base::SequencedTaskRunner* db_thread, | 803 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, |
804 SpecialStoragePolicy* special_storage_policy) | 804 const scoped_refptr<base::SequencedTaskRunner>& db_thread, |
805 : is_incognito_(is_incognito), | 805 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy) |
806 profile_path_(profile_path), | 806 : is_incognito_(is_incognito), |
807 proxy_(new QuotaManagerProxy( | 807 profile_path_(profile_path), |
808 this, io_thread)), | 808 proxy_(new QuotaManagerProxy(this, io_thread)), |
809 db_disabled_(false), | 809 db_disabled_(false), |
810 eviction_disabled_(false), | 810 eviction_disabled_(false), |
811 io_thread_(io_thread), | 811 io_thread_(io_thread), |
812 db_thread_(db_thread), | 812 db_thread_(db_thread), |
813 temporary_quota_initialized_(false), | 813 temporary_quota_initialized_(false), |
814 temporary_quota_override_(-1), | 814 temporary_quota_override_(-1), |
815 desired_available_space_(-1), | 815 desired_available_space_(-1), |
816 special_storage_policy_(special_storage_policy), | 816 special_storage_policy_(special_storage_policy), |
817 get_disk_space_fn_(&CallSystemGetAmountOfFreeDiskSpace), | 817 get_disk_space_fn_(&CallSystemGetAmountOfFreeDiskSpace), |
818 storage_monitor_(new StorageMonitor(this)), | 818 storage_monitor_(new StorageMonitor(this)), |
819 weak_factory_(this) { | 819 weak_factory_(this) { |
820 } | 820 } |
821 | 821 |
822 void QuotaManager::GetUsageInfo(const GetUsageInfoCallback& callback) { | 822 void QuotaManager::GetUsageInfo(const GetUsageInfoCallback& callback) { |
823 LazyInitialize(); | 823 LazyInitialize(); |
824 GetUsageInfoTask* get_usage_info = new GetUsageInfoTask(this, callback); | 824 GetUsageInfoTask* get_usage_info = new GetUsageInfoTask(this, callback); |
825 get_usage_info->Start(); | 825 get_usage_info->Start(); |
826 } | 826 } |
827 | 827 |
828 void QuotaManager::GetUsageAndQuotaForWebApps( | 828 void QuotaManager::GetUsageAndQuotaForWebApps( |
829 const GURL& origin, | 829 const GURL& origin, |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 // |database_|, therefore we can be sure that database_ is alive when this | 1622 // |database_|, therefore we can be sure that database_ is alive when this |
1623 // task runs. | 1623 // task runs. |
1624 base::PostTaskAndReplyWithResult( | 1624 base::PostTaskAndReplyWithResult( |
1625 db_thread_.get(), | 1625 db_thread_.get(), |
1626 from_here, | 1626 from_here, |
1627 base::Bind(task, base::Unretained(database_.get())), | 1627 base::Bind(task, base::Unretained(database_.get())), |
1628 reply); | 1628 reply); |
1629 } | 1629 } |
1630 | 1630 |
1631 } // namespace storage | 1631 } // namespace storage |
OLD | NEW |