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 #ifndef WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 5 #ifndef WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
6 #define WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 6 #define WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 public base::RefCountedThreadSafe<QuotaManager, QuotaManagerDeleter> { | 115 public base::RefCountedThreadSafe<QuotaManager, QuotaManagerDeleter> { |
116 public: | 116 public: |
117 typedef base::Callback<void(QuotaStatusCode, | 117 typedef base::Callback<void(QuotaStatusCode, |
118 int64 /* usage */, | 118 int64 /* usage */, |
119 int64 /* quota */)> | 119 int64 /* quota */)> |
120 GetUsageAndQuotaCallback; | 120 GetUsageAndQuotaCallback; |
121 | 121 |
122 static const int64 kIncognitoDefaultQuotaLimit; | 122 static const int64 kIncognitoDefaultQuotaLimit; |
123 static const int64 kNoLimit; | 123 static const int64 kNoLimit; |
124 | 124 |
125 QuotaManager(bool is_incognito, | 125 QuotaManager( |
126 const base::FilePath& profile_path, | 126 bool is_incognito, |
127 base::SingleThreadTaskRunner* io_thread, | 127 const base::FilePath& profile_path, |
128 base::SequencedTaskRunner* db_thread, | 128 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, |
129 SpecialStoragePolicy* special_storage_policy); | 129 const scoped_refptr<base::SequencedTaskRunner>& db_thread, |
| 130 const scoped_refptr<SpecialStoragePolicy>& special_storage_policy); |
130 | 131 |
131 // Returns a proxy object that can be used on any thread. | 132 // Returns a proxy object that can be used on any thread. |
132 QuotaManagerProxy* proxy() { return proxy_.get(); } | 133 QuotaManagerProxy* proxy() { return proxy_.get(); } |
133 | 134 |
134 // Called by clients or webapps. Returns usage per host. | 135 // Called by clients or webapps. Returns usage per host. |
135 void GetUsageInfo(const GetUsageInfoCallback& callback); | 136 void GetUsageInfo(const GetUsageInfoCallback& callback); |
136 | 137 |
137 // Called by Web Apps. | 138 // Called by Web Apps. |
138 // This method is declared as virtual to allow test code to override it. | 139 // This method is declared as virtual to allow test code to override it. |
139 virtual void GetUsageAndQuotaForWebApps( | 140 virtual void GetUsageAndQuotaForWebApps( |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 451 |
451 struct QuotaManagerDeleter { | 452 struct QuotaManagerDeleter { |
452 static void Destruct(const QuotaManager* manager) { | 453 static void Destruct(const QuotaManager* manager) { |
453 manager->DeleteOnCorrectThread(); | 454 manager->DeleteOnCorrectThread(); |
454 } | 455 } |
455 }; | 456 }; |
456 | 457 |
457 } // namespace storage | 458 } // namespace storage |
458 | 459 |
459 #endif // WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_H_ | 460 #endif // WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_H_ |
OLD | NEW |