OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/rappor/rappor_recorder_impl.h" | 5 #include "components/rappor/rappor_recorder_impl.h" |
6 | 6 |
7 #include "components/rappor/rappor_service.h" | 7 #include "components/rappor/public/rappor_utils.h" |
8 #include "components/rappor/rappor_utils.h" | 8 #include "components/rappor/rappor_service_impl.h" |
9 #include "mojo/public/cpp/bindings/strong_binding.h" | 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
10 | 10 |
11 namespace rappor { | 11 namespace rappor { |
12 | 12 |
13 RapporRecorderImpl::RapporRecorderImpl(RapporService* rappor_service) | 13 RapporRecorderImpl::RapporRecorderImpl(RapporServiceImpl* rappor_service) |
14 : rappor_service_(rappor_service) {} | 14 : rappor_service_(rappor_service) {} |
15 | 15 |
16 RapporRecorderImpl::~RapporRecorderImpl() = default; | 16 RapporRecorderImpl::~RapporRecorderImpl() = default; |
17 | 17 |
18 // static | 18 // static |
19 void RapporRecorderImpl::Create(RapporService* rappor_service, | 19 void RapporRecorderImpl::Create(RapporServiceImpl* rappor_service, |
20 mojom::RapporRecorderRequest request) { | 20 mojom::RapporRecorderRequest request) { |
21 mojo::MakeStrongBinding(base::MakeUnique<RapporRecorderImpl>(rappor_service), | 21 mojo::MakeStrongBinding(base::MakeUnique<RapporRecorderImpl>(rappor_service), |
22 std::move(request)); | 22 std::move(request)); |
23 } | 23 } |
24 | 24 |
25 void RapporRecorderImpl::RecordRappor(const std::string& metric, | 25 void RapporRecorderImpl::RecordRappor(const std::string& metric, |
26 const std::string& sample) { | 26 const std::string& sample) { |
27 DCHECK(thread_checker_.CalledOnValidThread()); | 27 DCHECK(thread_checker_.CalledOnValidThread()); |
28 SampleString(rappor_service_, metric, ETLD_PLUS_ONE_RAPPOR_TYPE, sample); | 28 SampleString(rappor_service_, metric, ETLD_PLUS_ONE_RAPPOR_TYPE, sample); |
29 } | 29 } |
30 | 30 |
31 void RapporRecorderImpl::RecordRapporURL(const std::string& metric, | 31 void RapporRecorderImpl::RecordRapporURL(const std::string& metric, |
32 const GURL& sample) { | 32 const GURL& sample) { |
33 DCHECK(thread_checker_.CalledOnValidThread()); | 33 DCHECK(thread_checker_.CalledOnValidThread()); |
34 SampleDomainAndRegistryFromGURL(rappor_service_, metric, sample); | 34 SampleDomainAndRegistryFromGURL(rappor_service_, metric, sample); |
35 } | 35 } |
36 | 36 |
37 } // namespace rappor | 37 } // namespace rappor |
OLD | NEW |