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

Unified Diff: ppapi/thunk/ppb_trace_event_thunk.cc

Issue 11464005: Add trace event Pepper API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Feedback Created 8 years 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
Index: ppapi/thunk/ppb_trace_event_thunk.cc
diff --git a/ppapi/thunk/ppb_trace_event_thunk.cc b/ppapi/thunk/ppb_trace_event_thunk.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e06dfa04585811f36b864c9512da42166a8b6df2
--- /dev/null
+++ b/ppapi/thunk/ppb_trace_event_thunk.cc
@@ -0,0 +1,61 @@
+// Copyright (c) 2012 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 "ppapi/c/dev/ppb_trace_event_dev.h"
+#include "ppapi/shared_impl/ppb_trace_event_shared.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_instance_api.h"
+#include "ppapi/thunk/thunk.h"
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+void* GetCategoryEnabled(const char* category_name) {
+ return ppapi::PPB_Trace_Event_Shared::GetCategoryEnabled(category_name);
+}
+
+int32_t AddTraceEvent(int8_t phase,
+ const void* category_enabled,
+ const char* name,
+ uint64_t id,
+ uint32_t num_args,
+ const char* arg_names[],
+ const uint8_t arg_types[],
+ const uint64_t arg_values[],
+ int32_t threshold_begin_id,
+ int64_t threshold,
+ uint8_t flags) {
+ return ppapi::PPB_Trace_Event_Shared::AddTraceEvent(phase,
+ category_enabled,
+ name,
+ id,
+ num_args,
+ arg_names,
+ arg_types,
+ arg_values,
+ threshold_begin_id,
+ threshold,
+ flags);
+}
+
+void SetThreadName(const char* thread_name) {
+ return ppapi::PPB_Trace_Event_Shared::SetThreadName(thread_name);
+}
+
+const PPB_Trace_Event_Dev g_ppb_trace_event_thunk = {
+ &GetCategoryEnabled,
+ &AddTraceEvent,
+ &SetThreadName,
+};
+
+} // namespace
+
+const PPB_Trace_Event_Dev_0_1* GetPPB_Trace_Event_Dev_0_1_Thunk() {
+ return &g_ppb_trace_event_thunk;
+}
+
+} // namespace thunk
+} // namespace ppapi
« ppapi/shared_impl/ppb_trace_event_shared.cc ('K') | « ppapi/thunk/ppb_instance_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698