| 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 "base/trace_event/trace_event.h" | 5 #include "base/trace_event/trace_event.h" |
| 6 #include "skia/ext/event_tracer_impl.h" | 6 #include "skia/ext/event_tracer_impl.h" |
| 7 #include "third_party/skia/include/utils/SkEventTracer.h" | 7 #include "third_party/skia/include/utils/SkEventTracer.h" |
| 8 | 8 |
| 9 namespace skia { | 9 namespace skia { |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( | 63 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( |
| 64 categoryEnabledFlag, name, traceEventHandle); | 64 categoryEnabledFlag, name, traceEventHandle); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace skia | 67 } // namespace skia |
| 68 | 68 |
| 69 | 69 |
| 70 void InitSkiaEventTracer() { | 70 void InitSkiaEventTracer() { |
| 71 // Initialize the binding to Skia's tracing events. Skia will | 71 // Initialize the binding to Skia's tracing events. Skia will |
| 72 // take ownership of and clean up the memory allocated here. | 72 // take ownership of and clean up the memory allocated here. |
| 73 SkEventTracer::SetInstance(new skia::SkChromiumEventTracer()); | 73 if (!SkEventTracer::GetInstance()) |
| 74 SkEventTracer::SetInstance(new skia::SkChromiumEventTracer()); |
| 74 } | 75 } |
| OLD | NEW |