| 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 #ifndef COMPONENTS_RAPPOR_RAPPOR_RECORDER_IMPL_H_ | 5 #ifndef COMPONENTS_RAPPOR_RAPPOR_RECORDER_IMPL_H_ |
| 6 #define COMPONENTS_RAPPOR_RAPPOR_RECORDER_IMPL_H_ | 6 #define COMPONENTS_RAPPOR_RAPPOR_RECORDER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/threading/thread_checker.h" | 8 #include "base/threading/thread_checker.h" |
| 9 #include "components/rappor/public/interfaces/rappor_recorder.mojom.h" | 9 #include "components/rappor/public/interfaces/rappor_recorder.mojom.h" |
| 10 | 10 |
| 11 class GURL; | 11 class GURL; |
| 12 | 12 |
| 13 namespace service_manager { |
| 14 struct BindSourceInfo; |
| 15 } |
| 16 |
| 13 namespace rappor { | 17 namespace rappor { |
| 14 | 18 |
| 15 class RapporServiceImpl; | 19 class RapporServiceImpl; |
| 16 | 20 |
| 17 // Records aggregate, privacy-preserving samples from the renderers. | 21 // Records aggregate, privacy-preserving samples from the renderers. |
| 18 // See https://www.chromium.org/developers/design-documents/rappor | 22 // See https://www.chromium.org/developers/design-documents/rappor |
| 19 class RapporRecorderImpl : public mojom::RapporRecorder { | 23 class RapporRecorderImpl : public mojom::RapporRecorder { |
| 20 public: | 24 public: |
| 21 explicit RapporRecorderImpl(RapporServiceImpl* rappor_service); | 25 explicit RapporRecorderImpl(RapporServiceImpl* rappor_service); |
| 22 ~RapporRecorderImpl() override; | 26 ~RapporRecorderImpl() override; |
| 23 | 27 |
| 24 static void Create(RapporServiceImpl* rappor_service, | 28 static void Create(RapporServiceImpl* rappor_service, |
| 29 const service_manager::BindSourceInfo& source_info, |
| 25 mojom::RapporRecorderRequest request); | 30 mojom::RapporRecorderRequest request); |
| 26 | 31 |
| 27 private: | 32 private: |
| 28 // rappor::mojom::RapporRecorder: | 33 // rappor::mojom::RapporRecorder: |
| 29 void RecordRappor(const std::string& metric, | 34 void RecordRappor(const std::string& metric, |
| 30 const std::string& sample) override; | 35 const std::string& sample) override; |
| 31 void RecordRapporURL(const std::string& metric, const GURL& sample) override; | 36 void RecordRapporURL(const std::string& metric, const GURL& sample) override; |
| 32 | 37 |
| 33 RapporServiceImpl* rappor_service_; | 38 RapporServiceImpl* rappor_service_; |
| 34 base::ThreadChecker thread_checker_; | 39 base::ThreadChecker thread_checker_; |
| 35 | 40 |
| 36 DISALLOW_COPY_AND_ASSIGN(RapporRecorderImpl); | 41 DISALLOW_COPY_AND_ASSIGN(RapporRecorderImpl); |
| 37 }; | 42 }; |
| 38 | 43 |
| 39 } // namespace rappor | 44 } // namespace rappor |
| 40 | 45 |
| 41 #endif // COMPONENTS_RAPPOR_RAPPOR_RECORDER_IMPL_H_ | 46 #endif // COMPONENTS_RAPPOR_RAPPOR_RECORDER_IMPL_H_ |
| OLD | NEW |