| 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/common/trace_provider_impl.h" | 5 #include "mojo/common/trace_provider_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "base/trace_event/trace_config.h" | 13 #include "base/trace_event/trace_config.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 #include "mojo/public/cpp/application/application_connection.h" | |
| 16 #include "mojo/public/cpp/application/application_impl.h" | 15 #include "mojo/public/cpp/application/application_impl.h" |
| 17 | 16 |
| 18 namespace mojo { | 17 namespace mojo { |
| 19 | 18 |
| 20 TraceProviderImpl::TraceProviderImpl() | 19 TraceProviderImpl::TraceProviderImpl() |
| 21 : binding_(this), tracing_forced_(false), weak_factory_(this) {} | 20 : binding_(this), tracing_forced_(false), weak_factory_(this) {} |
| 22 | 21 |
| 23 TraceProviderImpl::~TraceProviderImpl() {} | 22 TraceProviderImpl::~TraceProviderImpl() {} |
| 24 | 23 |
| 25 void TraceProviderImpl::Bind(InterfaceRequest<tracing::TraceProvider> request) { | 24 void TraceProviderImpl::Bind(InterfaceRequest<tracing::TraceProvider> request) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // events. Empty string is not a valid chunk to record so skip in this case. | 91 // events. Empty string is not a valid chunk to record so skip in this case. |
| 93 if (!events_str->data().empty()) { | 92 if (!events_str->data().empty()) { |
| 94 recorder_->Record(mojo::String(events_str->data())); | 93 recorder_->Record(mojo::String(events_str->data())); |
| 95 } | 94 } |
| 96 if (!has_more_events) { | 95 if (!has_more_events) { |
| 97 recorder_.reset(); | 96 recorder_.reset(); |
| 98 } | 97 } |
| 99 } | 98 } |
| 100 | 99 |
| 101 } // namespace mojo | 100 } // namespace mojo |
| OLD | NEW |