Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: services/tracing/collector_impl.cc

Issue 1055703002: Gather trace data by waiting on handles with a fixed timeout (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "services/tracing/collector_impl.h"
6
7 namespace tracing {
8
9 CollectorImpl::CollectorImpl(mojo::InterfaceRequest<TraceDataCollector> request,
10 TraceDataSink* sink)
11 : sink_(sink), binding_(this, request.Pass()) {
12 }
13
14 CollectorImpl::~CollectorImpl() {
15 }
16
17 void CollectorImpl::Read() {
18 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
19 }
20
21 mojo::Handle CollectorImpl::RawHandleValue() const {
22 return binding_.handle();
23 }
24
25 void CollectorImpl::DataCollected(const mojo::String& json) {
26 sink_->AddChunk(json.To<std::string>());
27 }
28
29 } // namespace tracing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698