OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/public/cpp/tracing_impl.h" | 5 #include "services/tracing/public/cpp/tracing_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
12 #include "base/trace_event/trace_event_impl.h" | 12 #include "base/trace_event/trace_event_impl.h" |
13 #include "services/shell/public/cpp/connector.h" | 13 #include "services/shell/public/cpp/connector.h" |
14 | 14 |
15 #ifdef NDEBUG | 15 #ifdef NDEBUG |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "mojo/services/tracing/public/cpp/switches.h" | 17 #include "services/tracing/public/cpp/switches.h" |
18 #endif | 18 #endif |
19 | 19 |
20 namespace mojo { | 20 namespace mojo { |
21 namespace { | 21 namespace { |
22 | 22 |
23 // Controls access to |g_tracing_singleton_created|, which can be accessed from | 23 // Controls access to |g_tracing_singleton_created|, which can be accessed from |
24 // different threads. | 24 // different threads. |
25 base::LazyInstance<base::Lock>::Leaky g_singleton_lock = | 25 base::LazyInstance<base::Lock>::Leaky g_singleton_lock = |
26 LAZY_INSTANCE_INITIALIZER; | 26 LAZY_INSTANCE_INITIALIZER; |
27 | 27 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 provider_impl_.ForceEnableTracing(); | 65 provider_impl_.ForceEnableTracing(); |
66 #endif | 66 #endif |
67 } | 67 } |
68 | 68 |
69 void TracingImpl::Create(Connection* connection, | 69 void TracingImpl::Create(Connection* connection, |
70 InterfaceRequest<tracing::TraceProvider> request) { | 70 InterfaceRequest<tracing::TraceProvider> request) { |
71 provider_impl_.Bind(std::move(request)); | 71 provider_impl_.Bind(std::move(request)); |
72 } | 72 } |
73 | 73 |
74 } // namespace mojo | 74 } // namespace mojo |
OLD | NEW |