OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 #include "mojo/services/tracing/trace_recorder_impl.h" | |
6 | |
7 #include <utility> | |
8 | |
9 namespace tracing { | |
10 | |
11 TraceRecorderImpl::TraceRecorderImpl( | |
12 mojo::InterfaceRequest<TraceRecorder> request, | |
13 TraceDataSink* sink) | |
14 : sink_(sink), binding_(this, std::move(request)) {} | |
15 | |
16 TraceRecorderImpl::~TraceRecorderImpl() { | |
17 } | |
18 | |
19 void TraceRecorderImpl::TryRead() { | |
20 binding_.WaitForIncomingMethodCall(MojoDeadline(0)); | |
21 } | |
22 | |
23 mojo::Handle TraceRecorderImpl::TraceRecorderHandle() const { | |
24 return binding_.handle(); | |
25 } | |
26 | |
27 void TraceRecorderImpl::Record(const mojo::String& json) { | |
28 sink_->AddChunk(json.To<std::string>()); | |
29 } | |
30 | |
31 } // namespace tracing | |
OLD | NEW |