Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/message_loop/message_loop_proxy.h" | |
| 14 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
| 15 #include "storage/common/quota/quota_types.h" | 14 #include "storage/common/quota/quota_types.h" |
| 16 | 15 |
| 16 | |
| 17 namespace base { | |
| 18 class SingleThreadTaskRunner; | |
| 19 } // namespace base | |
|
Bernhard Bauer
2015/04/29 10:31:34
Nit: Two spaces before the comment.
Pranay
2015/05/04 03:28:21
Done.
Pranay
2015/05/04 03:30:31
Done.
| |
| 20 | |
| 17 class BrowsingDataQuotaHelper; | 21 class BrowsingDataQuotaHelper; |
| 18 class Profile; | 22 class Profile; |
| 19 | 23 |
| 20 struct BrowsingDataQuotaHelperDeleter { | 24 struct BrowsingDataQuotaHelperDeleter { |
| 21 static void Destruct(const BrowsingDataQuotaHelper* helper); | 25 static void Destruct(const BrowsingDataQuotaHelper* helper); |
| 22 }; | 26 }; |
| 23 | 27 |
| 24 // This class is an interface class to bridge between Cookies Tree and Unified | 28 // This class is an interface class to bridge between Cookies Tree and Unified |
| 25 // Quota System. This class provides a way to get usage and quota information | 29 // Quota System. This class provides a way to get usage and quota information |
| 26 // through the instance. | 30 // through the instance. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 typedef std::list<QuotaInfo> QuotaInfoArray; | 64 typedef std::list<QuotaInfo> QuotaInfoArray; |
| 61 typedef base::Callback<void(const QuotaInfoArray&)> FetchResultCallback; | 65 typedef base::Callback<void(const QuotaInfoArray&)> FetchResultCallback; |
| 62 | 66 |
| 63 static BrowsingDataQuotaHelper* Create(Profile* profile); | 67 static BrowsingDataQuotaHelper* Create(Profile* profile); |
| 64 | 68 |
| 65 virtual void StartFetching(const FetchResultCallback& callback) = 0; | 69 virtual void StartFetching(const FetchResultCallback& callback) = 0; |
| 66 | 70 |
| 67 virtual void RevokeHostQuota(const std::string& host) = 0; | 71 virtual void RevokeHostQuota(const std::string& host) = 0; |
| 68 | 72 |
| 69 protected: | 73 protected: |
| 70 explicit BrowsingDataQuotaHelper(base::MessageLoopProxy* io_thread_); | 74 explicit BrowsingDataQuotaHelper(base::SingleThreadTaskRunner* io_thread_); |
| 71 virtual ~BrowsingDataQuotaHelper(); | 75 virtual ~BrowsingDataQuotaHelper(); |
| 72 | 76 |
| 73 private: | 77 private: |
| 74 friend class base::DeleteHelper<BrowsingDataQuotaHelper>; | 78 friend class base::DeleteHelper<BrowsingDataQuotaHelper>; |
| 75 friend struct BrowsingDataQuotaHelperDeleter; | 79 friend struct BrowsingDataQuotaHelperDeleter; |
| 76 scoped_refptr<base::MessageLoopProxy> io_thread_; | 80 scoped_refptr<base::SingleThreadTaskRunner> io_thread_; |
| 77 | 81 |
| 78 DISALLOW_COPY_AND_ASSIGN(BrowsingDataQuotaHelper); | 82 DISALLOW_COPY_AND_ASSIGN(BrowsingDataQuotaHelper); |
| 79 }; | 83 }; |
| 80 | 84 |
| 81 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_ | 85 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_ |
| OLD | NEW |