OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_CACHE_COUNTER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
9 #include "chrome/browser/browsing_data/browsing_data_counter.h" | 11 #include "chrome/browser/browsing_data/browsing_data_counter.h" |
10 | 12 |
11 class CacheCounter: public BrowsingDataCounter { | 13 class CacheCounter: public BrowsingDataCounter { |
12 public: | 14 public: |
13 CacheCounter(); | 15 CacheCounter(); |
14 ~CacheCounter() override; | 16 ~CacheCounter() override; |
15 | 17 |
16 const std::string& GetPrefName() const override; | 18 const std::string& GetPrefName() const override; |
17 | 19 |
18 // Whether this counter awaits the calculation result callback. | 20 // Whether this counter awaits the calculation result callback. |
19 // Used only for testing. | 21 // Used only for testing. |
20 bool Pending(); | 22 bool Pending(); |
21 | 23 |
22 private: | 24 private: |
23 const std::string pref_name_; | 25 const std::string pref_name_; |
24 bool pending_; | 26 bool pending_; |
25 | 27 |
26 base::WeakPtrFactory<CacheCounter> weak_ptr_factory_; | 28 base::WeakPtrFactory<CacheCounter> weak_ptr_factory_; |
27 | 29 |
28 void Count() override; | 30 void Count() override; |
29 void OnCacheSizeCalculated(int64 bytes); | 31 void OnCacheSizeCalculated(int64_t bytes); |
30 }; | 32 }; |
31 | 33 |
32 #endif // CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ | 34 #endif // CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ |
OLD | NEW |