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

Unified Diff: chrome/browser/browsing_data/site_data_counter.h

Issue 2092663002: Add a counter to calculate the total size of site data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove an accidentally added file. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data/site_data_counter.h
diff --git a/chrome/browser/browsing_data/site_data_counter.h b/chrome/browser/browsing_data/site_data_counter.h
new file mode 100644
index 0000000000000000000000000000000000000000..a685b889f8b4de5a699041dc09aab97e6f51b49f
--- /dev/null
+++ b/chrome/browser/browsing_data/site_data_counter.h
@@ -0,0 +1,39 @@
+// 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_SITE_DATA_COUNTER_H_
+#define CHROME_BROWSER_BROWSING_DATA_SITE_DATA_COUNTER_H_
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/browsing_data/browsing_data_counter.h"
+#include "chrome/browser/browsing_data/site_data_size_collector.h"
+
+class SiteDataCounter: public BrowsingDataCounter {
+ public:
+ SiteDataCounter();
+ ~SiteDataCounter() override;
+
+ // BrowsingDataCounter:
+ const std::string& GetPrefName() const override;
+
+ private:
+ // BrowsingDataCounter:
+ void Count() override;
+
+ void OnSiteDataSizeFetched(int64_t size);
+
+ const std::string pref_name_;
+ std::unique_ptr<SiteDataSizeCollector> collector_;
+ base::WeakPtrFactory<SiteDataCounter> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(SiteDataCounter);
+};
+
+#endif // CHROME_BROWSER_BROWSING_DATA_SITE_DATA_COUNTER_H_

Powered by Google App Engine
This is Rietveld 408576698