Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Side by Side Diff: chrome/browser/browsing_data/cache_counter.h

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed deps Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/browsing_data/browsing_data_counter.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "components/browsing_data/counters/browsing_data_counter.h"
12 13
13 class CacheCounter: public BrowsingDataCounter { 14 class CacheCounter: public BrowsingDataCounter {
14 public: 15 public:
15 CacheCounter(); 16 explicit CacheCounter(Profile* profile);
16 ~CacheCounter() override; 17 ~CacheCounter() override;
17 18
18 const std::string& GetPrefName() const override;
19
20 // Whether this counter awaits the calculation result callback. 19 // Whether this counter awaits the calculation result callback.
21 // Used only for testing. 20 // Used only for testing.
22 bool Pending(); 21 bool Pending();
23 22
24 private: 23 private:
25 const std::string pref_name_; 24 Profile* profile_;
26 bool pending_; 25 bool pending_;
27 26
28 base::WeakPtrFactory<CacheCounter> weak_ptr_factory_; 27 base::WeakPtrFactory<CacheCounter> weak_ptr_factory_;
29 28
30 void Count() override; 29 void Count() override;
31 void OnCacheSizeCalculated(int64_t bytes); 30 void OnCacheSizeCalculated(int64_t bytes);
32 }; 31 };
33 32
34 #endif // CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_ 33 #endif // CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698