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 "webkit/quota/quota_manager.h" | 5 #include "webkit/quota/quota_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/message_loop_proxy.h" | 15 #include "base/sequenced_task_runner.h" |
| 16 #include "base/single_thread_task_runner.h" |
16 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
17 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
18 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
19 #include "base/time.h" | 20 #include "base/time.h" |
20 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
21 #include "webkit/quota/quota_database.h" | 22 #include "webkit/quota/quota_database.h" |
22 #include "webkit/quota/quota_temporary_storage_evictor.h" | 23 #include "webkit/quota/quota_temporary_storage_evictor.h" |
23 #include "webkit/quota/quota_types.h" | 24 #include "webkit/quota/quota_types.h" |
24 #include "webkit/quota/usage_tracker.h" | 25 #include "webkit/quota/usage_tracker.h" |
25 | 26 |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 } | 1112 } |
1112 | 1113 |
1113 Callback callback_; | 1114 Callback callback_; |
1114 TableEntries entries_; | 1115 TableEntries entries_; |
1115 }; | 1116 }; |
1116 | 1117 |
1117 // QuotaManager --------------------------------------------------------------- | 1118 // QuotaManager --------------------------------------------------------------- |
1118 | 1119 |
1119 QuotaManager::QuotaManager(bool is_incognito, | 1120 QuotaManager::QuotaManager(bool is_incognito, |
1120 const FilePath& profile_path, | 1121 const FilePath& profile_path, |
1121 base::MessageLoopProxy* io_thread, | 1122 base::SingleThreadTaskRunner* io_thread, |
1122 base::MessageLoopProxy* db_thread, | 1123 base::SequencedTaskRunner* db_thread, |
1123 SpecialStoragePolicy* special_storage_policy) | 1124 SpecialStoragePolicy* special_storage_policy) |
1124 : is_incognito_(is_incognito), | 1125 : is_incognito_(is_incognito), |
1125 profile_path_(profile_path), | 1126 profile_path_(profile_path), |
1126 proxy_(new QuotaManagerProxy( | 1127 proxy_(new QuotaManagerProxy( |
1127 ALLOW_THIS_IN_INITIALIZER_LIST(this), io_thread)), | 1128 ALLOW_THIS_IN_INITIALIZER_LIST(this), io_thread)), |
1128 db_disabled_(false), | 1129 db_disabled_(false), |
1129 eviction_disabled_(false), | 1130 eviction_disabled_(false), |
1130 io_thread_(io_thread), | 1131 io_thread_(io_thread), |
1131 db_thread_(db_thread), | 1132 db_thread_(db_thread), |
1132 temporary_quota_initialized_(false), | 1133 temporary_quota_initialized_(false), |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 if (manager_) | 1754 if (manager_) |
1754 manager_->NotifyOriginNoLongerInUse(origin); | 1755 manager_->NotifyOriginNoLongerInUse(origin); |
1755 } | 1756 } |
1756 | 1757 |
1757 QuotaManager* QuotaManagerProxy::quota_manager() const { | 1758 QuotaManager* QuotaManagerProxy::quota_manager() const { |
1758 DCHECK(!io_thread_ || io_thread_->BelongsToCurrentThread()); | 1759 DCHECK(!io_thread_ || io_thread_->BelongsToCurrentThread()); |
1759 return manager_; | 1760 return manager_; |
1760 } | 1761 } |
1761 | 1762 |
1762 QuotaManagerProxy::QuotaManagerProxy( | 1763 QuotaManagerProxy::QuotaManagerProxy( |
1763 QuotaManager* manager, base::MessageLoopProxy* io_thread) | 1764 QuotaManager* manager, base::SingleThreadTaskRunner* io_thread) |
1764 : manager_(manager), io_thread_(io_thread) { | 1765 : manager_(manager), io_thread_(io_thread) { |
1765 } | 1766 } |
1766 | 1767 |
1767 QuotaManagerProxy::~QuotaManagerProxy() { | 1768 QuotaManagerProxy::~QuotaManagerProxy() { |
1768 } | 1769 } |
1769 | 1770 |
1770 } // namespace quota | 1771 } // namespace quota |
OLD | NEW |