Chromium Code Reviews| Index: services/tracing/collector_impl.cc |
| diff --git a/services/tracing/collector_impl.cc b/services/tracing/collector_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6ce02e27b3cfa93e26ff79d1614406892c0f8ef6 |
| --- /dev/null |
| +++ b/services/tracing/collector_impl.cc |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2015 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 "services/tracing/collector_impl.h" |
| + |
| +namespace tracing { |
| + |
| +CollectorImpl::CollectorImpl(mojo::InterfaceRequest<TraceDataCollector> request, |
| + TraceDataSink* sink) |
| + : sink_(sink), binding_(this, request.Pass()) { |
| +} |
| + |
| +CollectorImpl::~CollectorImpl() { |
| +} |
| + |
| +void CollectorImpl::Read() { |
| + binding_.WaitForIncomingMethodCall(MojoDeadline(0)); |
|
viettrungluu
2015/04/02 19:54:13
Do you want to warn if this fails or anything like
jamesr
2015/04/06 22:31:04
This could fail for legitimate reasons so I don't
|
| +} |
| + |
| +mojo::Handle CollectorImpl::RawHandleValue() const { |
| + return binding_.handle(); |
| +} |
| + |
| +void CollectorImpl::DataCollected(const mojo::String& json) { |
| + sink_->AddChunk(json.To<std::string>()); |
| +} |
| + |
| +} // namespace tracing |