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

Unified Diff: components/previews/previews_data_savings.cc

Issue 2257533003: Adding a previews object, PreviewsDataSavings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bengr comment 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 | « components/previews/previews_data_savings.h ('k') | components/previews/previews_data_savings_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/previews/previews_data_savings.cc
diff --git a/components/previews/previews_data_savings.cc b/components/previews/previews_data_savings.cc
new file mode 100644
index 0000000000000000000000000000000000000000..36cfab85087e72a5329e58fcf06442296dd59f9e
--- /dev/null
+++ b/components/previews/previews_data_savings.cc
@@ -0,0 +1,33 @@
+// 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.
+
+#include "components/previews/previews_data_savings.h"
+
+#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
+#include "components/data_reduction_proxy/core/common/data_savings_recorder.h"
+
+namespace previews {
+
+PreviewsDataSavings::PreviewsDataSavings(
+ data_reduction_proxy::DataSavingsRecorder* data_savings_recorder)
+ : data_savings_recorder_(data_savings_recorder) {
+ DCHECK(data_savings_recorder);
+}
+
+PreviewsDataSavings::~PreviewsDataSavings() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+}
+
+void PreviewsDataSavings::RecordDataSavings(
+ const std::string& fully_qualified_domain_name,
+ int64_t data_used,
+ int64_t original_size) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ data_savings_recorder_->UpdateDataSavings(fully_qualified_domain_name,
+ data_used, original_size);
+}
+
+} // namespace previews
« no previous file with comments | « components/previews/previews_data_savings.h ('k') | components/previews/previews_data_savings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698