Index: gin/event_tracer_impl.cc |
diff --git a/skia/ext/event_tracer_impl.cc b/gin/event_tracer_impl.cc |
similarity index 73% |
copy from skia/ext/event_tracer_impl.cc |
copy to gin/event_tracer_impl.cc |
index 53ddf2b8c3fc077e677352a5e32c50af77fcdfdb..295eb6366c1061a6fb127f885e9d4b150adf39ad 100644 |
--- a/skia/ext/event_tracer_impl.cc |
+++ b/gin/event_tracer_impl.cc |
@@ -1,17 +1,17 @@ |
// Copyright 2014 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include <v8-tracing.h> |
#include "base/debug/trace_event.h" |
-#include "skia/ext/event_tracer_impl.h" |
-#include "third_party/skia/include/utils/SkEventTracer.h" |
+#include "event_tracer_impl.h" |
-namespace skia { |
+namespace gin { |
-class SkChromiumEventTracer: public SkEventTracer { |
+class ChromiumEventTracer: public v8::EventTracer { |
const uint8_t* getCategoryGroupEnabled(const char* name) override; |
const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag) override; |
- SkEventTracer::Handle addTraceEvent(char phase, |
+ EventTracer::Handle addTraceEvent(char phase, |
const uint8_t* categoryEnabledFlag, |
const char* name, |
uint64_t id, |
@@ -22,22 +22,22 @@ class SkChromiumEventTracer: public SkEventTracer { |
uint8_t flags) override; |
void updateTraceEventDuration(const uint8_t* categoryEnabledFlag, |
const char* name, |
- SkEventTracer::Handle handle) override; |
+ EventTracer::Handle handle) override; |
}; |
const uint8_t* |
- SkChromiumEventTracer::getCategoryGroupEnabled(const char* name) { |
+ ChromiumEventTracer::getCategoryGroupEnabled(const char* name) { |
return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(name); |
} |
-const char* SkChromiumEventTracer::getCategoryGroupName( |
+const char* ChromiumEventTracer::getCategoryGroupName( |
const uint8_t* categoryEnabledFlag) { |
return base::debug::TraceLog::GetCategoryGroupName( |
- categoryEnabledFlag); |
+ categoryEnabledFlag); |
} |
-SkEventTracer::Handle |
- SkChromiumEventTracer::addTraceEvent(char phase, |
+v8::EventTracer::Handle |
+ ChromiumEventTracer::addTraceEvent(char phase, |
const uint8_t* categoryEnabledFlag, |
const char* name, |
uint64_t id, |
@@ -49,27 +49,27 @@ SkEventTracer::Handle |
base::debug::TraceEventHandle handle = TRACE_EVENT_API_ADD_TRACE_EVENT( |
phase, categoryEnabledFlag, name, id, numArgs, argNames, |
argTypes, (const long long unsigned int*) argValues, NULL, flags); |
- SkEventTracer::Handle result; |
+ EventTracer::Handle result; |
memcpy(&result, &handle, sizeof(result)); |
return result; |
} |
void |
- SkChromiumEventTracer::updateTraceEventDuration( |
+ ChromiumEventTracer::updateTraceEventDuration( |
const uint8_t* categoryEnabledFlag, |
const char *name, |
- SkEventTracer::Handle handle) { |
+ EventTracer::Handle handle) { |
base::debug::TraceEventHandle traceEventHandle; |
memcpy(&traceEventHandle, &handle, sizeof(handle)); |
TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( |
categoryEnabledFlag, name, traceEventHandle); |
} |
-} // namespace skia |
+} // namespace gin |
-void InitSkiaEventTracer() { |
- // Initialize the binding to Skia's tracing events. Skia will |
+void InitV8EventTracer() { |
+ // Initialize the binding to ia's tracing events. ia will |
// take ownership of and clean up the memory allocated here. |
- SkEventTracer::SetInstance(new skia::SkChromiumEventTracer()); |
+ v8::EventTracer::SetInstance(new gin::ChromiumEventTracer()); |
} |