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> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 DISALLOW_COPY_AND_ASSIGN(CacheResult); | 35 DISALLOW_COPY_AND_ASSIGN(CacheResult); |
36 }; | 36 }; |
37 | 37 |
38 explicit CacheCounter(Profile* profile); | 38 explicit CacheCounter(Profile* profile); |
39 ~CacheCounter() override; | 39 ~CacheCounter() override; |
40 | 40 |
41 const char* GetPrefName() const override; | 41 const char* GetPrefName() const override; |
42 | 42 |
43 private: | 43 private: |
44 void Count() override; | 44 void Count() override; |
45 void OnCacheSizeCalculated(int64_t bytes, bool is_upper_limit); | 45 void OnCacheSizeCalculated(int64_t cache_bytes, bool is_upper_limit); |
| 46 void OnOfflinePageSizeCalculated(int64_t cache_bytes, |
| 47 bool is_upper_limit, |
| 48 int64_t cached_offline_page_size); |
46 void FetchEstimate( | 49 void FetchEstimate( |
47 base::WeakPtr<browsing_data::ConditionalCacheCountingHelper>); | 50 base::WeakPtr<browsing_data::ConditionalCacheCountingHelper>); |
48 | 51 |
49 Profile* profile_; | 52 Profile* profile_; |
50 bool pending_; | 53 bool pending_; |
51 | 54 |
52 base::WeakPtrFactory<CacheCounter> weak_ptr_factory_; | 55 base::WeakPtrFactory<CacheCounter> weak_ptr_factory_; |
53 | 56 |
54 }; | 57 }; |
55 | 58 |
56 #endif // CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ | 59 #endif // CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ |
OLD | NEW |