| 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/tracing/public/cpp/provider.h" | 5 #include "services/tracing/public/cpp/provider.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "base/threading/platform_thread.h" | 15 #include "base/threading/platform_thread.h" |
| 16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "base/trace_event/trace_config.h" | 18 #include "base/trace_event/trace_config.h" |
| 19 #include "base/trace_event/trace_event.h" | 19 #include "base/trace_event/trace_event.h" |
| 20 #include "services/shell/public/cpp/connection.h" | 20 #include "services/service_manager/public/cpp/connection.h" |
| 21 #include "services/shell/public/cpp/connector.h" | 21 #include "services/service_manager/public/cpp/connector.h" |
| 22 #include "services/tracing/public/cpp/switches.h" | 22 #include "services/tracing/public/cpp/switches.h" |
| 23 | 23 |
| 24 namespace tracing { | 24 namespace tracing { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Controls access to |g_tracing_singleton_created|, which can be accessed from | 27 // Controls access to |g_tracing_singleton_created|, which can be accessed from |
| 28 // different threads. | 28 // different threads. |
| 29 base::LazyInstance<base::Lock>::Leaky g_singleton_lock = | 29 base::LazyInstance<base::Lock>::Leaky g_singleton_lock = |
| 30 LAZY_INSTANCE_INITIALIZER; | 30 LAZY_INSTANCE_INITIALIZER; |
| 31 | 31 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // events. Empty string is not a valid chunk to record so skip in this case. | 137 // events. Empty string is not a valid chunk to record so skip in this case. |
| 138 if (!events_str->data().empty()) { | 138 if (!events_str->data().empty()) { |
| 139 recorder_->Record(mojo::String(events_str->data())); | 139 recorder_->Record(mojo::String(events_str->data())); |
| 140 } | 140 } |
| 141 if (!has_more_events) { | 141 if (!has_more_events) { |
| 142 recorder_.reset(); | 142 recorder_.reset(); |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace tracing | 146 } // namespace tracing |
| OLD | NEW |