OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 5 #ifndef WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 6 #define WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <list> | 10 #include <list> |
11 #include <map> | 11 #include <map> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "base/memory/scoped_callback_factory.h" | 16 #include "base/memory/scoped_callback_factory.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "webkit/quota/quota_client.h" | 19 #include "webkit/quota/quota_client.h" |
20 #include "webkit/quota/quota_task.h" | 20 #include "webkit/quota/quota_task.h" |
21 #include "webkit/quota/quota_types.h" | 21 #include "webkit/quota/quota_types.h" |
22 | 22 |
23 class FilePath; | 23 class FilePath; |
24 | 24 |
25 namespace quota { | 25 namespace quota { |
26 | 26 |
27 class QuotaDatabase; | 27 class QuotaDatabase; |
| 28 class QuotaTemporaryStorageEvictor; |
28 class UsageTracker; | 29 class UsageTracker; |
29 | 30 |
30 struct QuotaManagerDeleter; | 31 struct QuotaManagerDeleter; |
31 class QuotaManagerProxy; | 32 class QuotaManagerProxy; |
32 | 33 |
33 // The quota manager class. This class is instantiated per profile and | 34 // The quota manager class. This class is instantiated per profile and |
34 // held by the profile. With the exception of the constructor and the | 35 // held by the profile. With the exception of the constructor and the |
35 // proxy() method, all methods should only be called on the IO thread. | 36 // proxy() method, all methods should only be called on the IO thread. |
36 class QuotaManager : public QuotaTaskObserver, | 37 class QuotaManager : public QuotaTaskObserver, |
37 public base::RefCountedThreadSafe< | 38 public base::RefCountedThreadSafe< |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 bool db_initialized_; | 131 bool db_initialized_; |
131 bool db_disabled_; | 132 bool db_disabled_; |
132 scoped_refptr<base::MessageLoopProxy> io_thread_; | 133 scoped_refptr<base::MessageLoopProxy> io_thread_; |
133 scoped_refptr<base::MessageLoopProxy> db_thread_; | 134 scoped_refptr<base::MessageLoopProxy> db_thread_; |
134 mutable scoped_ptr<QuotaDatabase> database_; | 135 mutable scoped_ptr<QuotaDatabase> database_; |
135 | 136 |
136 QuotaClientList clients_; | 137 QuotaClientList clients_; |
137 | 138 |
138 scoped_ptr<UsageTracker> temporary_usage_tracker_; | 139 scoped_ptr<UsageTracker> temporary_usage_tracker_; |
139 scoped_ptr<UsageTracker> persistent_usage_tracker_; | 140 scoped_ptr<UsageTracker> persistent_usage_tracker_; |
| 141 scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_; |
140 | 142 |
141 UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; | 143 UsageAndQuotaDispatcherTaskMap usage_and_quota_dispatchers_; |
142 | 144 |
143 int64 temporary_global_quota_; | 145 int64 temporary_global_quota_; |
144 QuotaCallbackQueue temporary_global_quota_callbacks_; | 146 QuotaCallbackQueue temporary_global_quota_callbacks_; |
145 | 147 |
146 std::map<std::string, int64> persistent_host_quota_; | 148 std::map<std::string, int64> persistent_host_quota_; |
147 HostQuotaCallbackMap persistent_host_quota_callbacks_; | 149 HostQuotaCallbackMap persistent_host_quota_callbacks_; |
148 | 150 |
149 DISALLOW_COPY_AND_ASSIGN(QuotaManager); | 151 DISALLOW_COPY_AND_ASSIGN(QuotaManager); |
(...skipping 26 matching lines...) Expand all Loading... |
176 QuotaManager* manager_; // only accessed on the io thread | 178 QuotaManager* manager_; // only accessed on the io thread |
177 scoped_refptr<base::MessageLoopProxy> io_thread_; | 179 scoped_refptr<base::MessageLoopProxy> io_thread_; |
178 | 180 |
179 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); | 181 DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); |
180 }; | 182 }; |
181 | 183 |
182 | 184 |
183 } // namespace quota | 185 } // namespace quota |
184 | 186 |
185 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ | 187 #endif // WEBKIT_QUOTA_QUOTA_MANAGER_H_ |
OLD | NEW |