| Index: services/resource_coordinator/tracing/recorder_impl.h
|
| diff --git a/services/resource_coordinator/tracing/recorder_impl.h b/services/resource_coordinator/tracing/recorder_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..43ddfce74633448ff7028147ecfda1509dba1ddb
|
| --- /dev/null
|
| +++ b/services/resource_coordinator/tracing/recorder_impl.h
|
| @@ -0,0 +1,51 @@
|
| +// Copyright 2017 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.
|
| +
|
| +#ifndef SERVICES_RESOURCE_COORDINATOR_TRACING_RECORDER_IMPL_H_
|
| +#define SERVICES_RESOURCE_COORDINATOR_TRACING_RECORDER_IMPL_H_
|
| +
|
| +#include "base/sequenced_task_runner.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
| +#include "services/resource_coordinator/public/interfaces/tracing/tracing.mojom.h"
|
| +
|
| +namespace resource_coordinator {
|
| +namespace tracing {
|
| +
|
| +class RecorderImpl : public mojom::Recorder {
|
| + public:
|
| + RecorderImpl(
|
| + mojom::RecorderRequest request,
|
| + bool is_array,
|
| + const base::Closure& recorder_change_callback,
|
| + const scoped_refptr<base::SequencedTaskRunner>& background_task_runner);
|
| + ~RecorderImpl() override;
|
| +
|
| + std::string& data() { return data_; }
|
| + void clear_data() { data_.clear(); }
|
| + std::set<std::string> category_set() const { return category_set_; }
|
| + bool is_recording() const { return is_recording_; }
|
| + bool is_array() const { return is_array_; }
|
| +
|
| + private:
|
| + // mojom::Recorder
|
| + void AddCategories(const std::string& categories) override;
|
| + void AddChunk(const std::string& chunk) override;
|
| + void AddMetadata(std::unique_ptr<base::DictionaryValue> metadata) override;
|
| +
|
| + void OnConnectionError();
|
| +
|
| + std::string data_;
|
| + bool is_recording_;
|
| + bool is_array_;
|
| + base::Closure recorder_change_callback_;
|
| + scoped_refptr<base::SequencedTaskRunner> background_task_runner_;
|
| + mojo::Binding<mojom::Recorder> binding_;
|
| + std::set<std::string> category_set_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(RecorderImpl);
|
| +};
|
| +
|
| +} // namespace tracing
|
| +} // namespace resource_coordinator
|
| +#endif // SERVICES_RESOURCE_COORDINATOR_TRACING_RECORDER_IMPL_H_
|
|
|