OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/services/tracing/tracing_app.h" | 5 #include "mojo/services/tracing/tracing_app.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "mojo/application/public/cpp/application_connection.h" |
9 #include "mojo/services/tracing/trace_data_sink.h" | 10 #include "mojo/services/tracing/trace_data_sink.h" |
10 #include "third_party/mojo/src/mojo/public/cpp/application/application_connectio
n.h" | |
11 | 11 |
12 namespace tracing { | 12 namespace tracing { |
13 | 13 |
14 class CollectorImpl : public TraceDataCollector { | 14 class CollectorImpl : public TraceDataCollector { |
15 public: | 15 public: |
16 CollectorImpl(mojo::InterfaceRequest<TraceDataCollector> request, | 16 CollectorImpl(mojo::InterfaceRequest<TraceDataCollector> request, |
17 TraceDataSink* sink) | 17 TraceDataSink* sink) |
18 : sink_(sink), binding_(this, request.Pass()) {} | 18 : sink_(sink), binding_(this, request.Pass()) {} |
19 | 19 |
20 ~CollectorImpl() override {} | 20 ~CollectorImpl() override {} |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 base::Bind(&TracingApp::AllDataCollected, base::Unretained(this)), | 80 base::Bind(&TracingApp::AllDataCollected, base::Unretained(this)), |
81 base::TimeDelta::FromSeconds(1)); | 81 base::TimeDelta::FromSeconds(1)); |
82 } | 82 } |
83 | 83 |
84 void TracingApp::AllDataCollected() { | 84 void TracingApp::AllDataCollected() { |
85 collector_impls_.clear(); | 85 collector_impls_.clear(); |
86 sink_->Flush(); | 86 sink_->Flush(); |
87 } | 87 } |
88 | 88 |
89 } // namespace tracing | 89 } // namespace tracing |
OLD | NEW |