| 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 "services/dart/dart_tracing.h" | 5 #include "services/dart/dart_tracing.h" |
| 6 | 6 |
| 7 #include "dart/runtime/include/dart_tools_api.h" | 7 #include "dart/runtime/include/dart_tools_api.h" |
| 8 #include "mojo/public/cpp/application/application_impl.h" | 8 #include "mojo/public/cpp/application/application_impl.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 void DartTimelineController::Enable(const mojo::String& categories) { | 12 void DartTimelineController::Enable(const mojo::String& categories) { |
| 13 // TODO(johnmccutchan): Respect |categories|. | 13 if (categories == mojo::String("Dart")) { |
| 14 EnableAll(); | 14 Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_DART); |
| 15 } else { |
| 16 // TODO(johnmccutchan): Respect |categories|. |
| 17 EnableAll(); |
| 18 } |
| 15 } | 19 } |
| 16 | 20 |
| 17 void DartTimelineController::EnableAll() { | 21 void DartTimelineController::EnableAll() { |
| 18 Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL | | 22 Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL | |
| 19 DART_TIMELINE_STREAM_VM); | 23 DART_TIMELINE_STREAM_VM); |
| 20 } | 24 } |
| 21 | 25 |
| 22 void DartTimelineController::Disable() { | 26 void DartTimelineController::Disable() { |
| 23 Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_DISABLE); | 27 Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_DISABLE); |
| 24 } | 28 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 connection->AddService(this); | 131 connection->AddService(this); |
| 128 } | 132 } |
| 129 | 133 |
| 130 void DartTracingImpl::Create( | 134 void DartTracingImpl::Create( |
| 131 mojo::ApplicationConnection* connection, | 135 mojo::ApplicationConnection* connection, |
| 132 mojo::InterfaceRequest<tracing::TraceProvider> request) { | 136 mojo::InterfaceRequest<tracing::TraceProvider> request) { |
| 133 provider_impl_.Bind(request.Pass()); | 137 provider_impl_.Bind(request.Pass()); |
| 134 } | 138 } |
| 135 | 139 |
| 136 } // namespace dart | 140 } // namespace dart |
| OLD | NEW |