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

Unified Diff: ios/chrome/browser/browsing_data/cache_counter.h

Issue 2354643002: Add a cache counter for iOS. (Closed)
Patch Set: Forgot |next_step_| Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/browsing_data/cache_counter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/browsing_data/cache_counter.h
diff --git a/chrome/browser/browsing_data/cache_counter.h b/ios/chrome/browser/browsing_data/cache_counter.h
similarity index 51%
copy from chrome/browser/browsing_data/cache_counter.h
copy to ios/chrome/browser/browsing_data/cache_counter.h
index b8963ef366185dec680741693053adc22ad0f7e2..9945e05ad3f81579cadb511485e240a976b5ac75 100644
--- a/chrome/browser/browsing_data/cache_counter.h
+++ b/ios/chrome/browser/browsing_data/cache_counter.h
@@ -1,36 +1,40 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_
-#define CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_
-
-#include <stdint.h>
+#ifndef IOS_CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_
+#define IOS_CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_
#include "base/memory/weak_ptr.h"
#include "components/browsing_data/core/counters/browsing_data_counter.h"
-class Profile;
+namespace web {
+class BrowserState;
+}
class CacheCounter : public browsing_data::BrowsingDataCounter {
public:
- explicit CacheCounter(Profile* profile);
+ explicit CacheCounter(web::BrowserState* browser_state);
~CacheCounter() override;
// Whether this counter awaits the calculation result callback.
// Used only for testing.
- bool Pending();
+ bool pending() { return pending_; }
+ // BrowsingDataCounter implementation.
const char* GetPrefName() const override;
private:
- Profile* profile_;
+ // BrowsingDataCounter implementation.
+ void Count() override;
+
+ void OnCacheSizeCalculated(int result_bytes);
+
bool pending_;
- base::WeakPtrFactory<CacheCounter> weak_ptr_factory_;
+ web::BrowserState* browser_state_;
- void Count() override;
- void OnCacheSizeCalculated(int64_t bytes);
+ base::WeakPtrFactory<CacheCounter> weak_ptr_factory_;
};
-#endif // CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_
+#endif // IOS_CHROME_BROWSER_BROWSING_DATA_CACHE_COUNTER_H_
« no previous file with comments | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/browsing_data/cache_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698