OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_RESOURCE_COORDINATOR_TRACING_RECORDER_IMPL_H_ |
| 6 #define SERVICES_RESOURCE_COORDINATOR_TRACING_RECORDER_IMPL_H_ |
| 7 |
| 8 #include "base/sequenced_task_runner.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "services/resource_coordinator/public/interfaces/tracing/tracing.mojom.
h" |
| 11 |
| 12 namespace resource_coordinator { |
| 13 namespace tracing { |
| 14 |
| 15 class RecorderImpl : public mojom::Recorder { |
| 16 public: |
| 17 RecorderImpl( |
| 18 mojom::RecorderRequest request, |
| 19 bool is_array, |
| 20 const base::Closure& recorder_change_callback, |
| 21 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner); |
| 22 ~RecorderImpl() override; |
| 23 |
| 24 std::string& data() { return data_; } |
| 25 void clear_data() { data_.clear(); } |
| 26 std::set<std::string> category_set() const { return category_set_; } |
| 27 bool is_recording() const { return is_recording_; } |
| 28 bool is_array() const { return is_array_; } |
| 29 |
| 30 private: |
| 31 // mojom::Recorder |
| 32 void AddCategories(const std::string& categories) override; |
| 33 void AddChunk(const std::string& chunk) override; |
| 34 void AddMetadata(std::unique_ptr<base::DictionaryValue> metadata) override; |
| 35 |
| 36 void OnConnectionError(); |
| 37 |
| 38 std::string data_; |
| 39 bool is_recording_; |
| 40 bool is_array_; |
| 41 base::Closure recorder_change_callback_; |
| 42 scoped_refptr<base::SequencedTaskRunner> background_task_runner_; |
| 43 mojo::Binding<mojom::Recorder> binding_; |
| 44 std::set<std::string> category_set_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(RecorderImpl); |
| 47 }; |
| 48 |
| 49 } // namespace tracing |
| 50 } // namespace resource_coordinator |
| 51 #endif // SERVICES_RESOURCE_COORDINATOR_TRACING_RECORDER_IMPL_H_ |
OLD | NEW |