Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: gin/event_tracer_impl.cc

Issue 707273005: (WIP) Implement V8 Tracing -- DO NOT LAND (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gin/event_tracer_impl.h ('k') | gin/gin.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « gin/event_tracer_impl.h ('k') | gin/gin.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698