Index: components/rappor/recorder/rappor_recorder_impl.cc |
diff --git a/components/rappor/recorder/rappor_recorder_impl.cc b/components/rappor/recorder/rappor_recorder_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..183948a18157bf57b7bf570ceb37bcd40ed518b0 |
--- /dev/null |
+++ b/components/rappor/recorder/rappor_recorder_impl.cc |
@@ -0,0 +1,38 @@ |
+// 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/rappor/recorder/rappor_recorder_impl.h" |
+ |
+#include "components/rappor/rappor_service.h" |
+#include "components/rappor/rappor_utils.h" |
+#include "mojo/public/cpp/bindings/strong_binding.h" |
+ |
+namespace rappor { |
+ |
+RapporRecorderImpl::RapporRecorderImpl(RapporService* rappor_service) |
+ : rappor_service_(rappor_service) {} |
+ |
+RapporRecorderImpl::~RapporRecorderImpl() = default; |
+ |
+// static |
+void RapporRecorderImpl::Create(RapporService* rappor_service, |
+ rappor::mojom::RapporRecorderRequest request) { |
+ mojo::MakeStrongBinding(base::MakeUnique<RapporRecorderImpl>(rappor_service), |
+ std::move(request)); |
+} |
+ |
+void RapporRecorderImpl::RecordRappor(const std::string& metric, |
+ const std::string& sample) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ rappor::SampleString(rappor_service_, metric, |
Alexei Svitkine (slow)
2016/10/07 16:31:58
Nit: Remove rappor:: prefix here and on line 35.
nigeltao1
2016/10/11 23:44:55
Done, and also on line 29.
|
+ rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, sample); |
+} |
+ |
+void RapporRecorderImpl::RecordRapporURL(const std::string& metric, |
+ const GURL& sample) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ rappor::SampleDomainAndRegistryFromGURL(rappor_service_, metric, sample); |
+} |
+ |
+} // namespace rappor |