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

Side by Side Diff: ppapi/cpp/dev/trace_event_dev.cc

Issue 12212198: Add C++ Trace Event support to PPAPI/NaCl SDK (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: brettw feedback Created 7 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « ppapi/cpp/dev/trace_event_dev.h ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/cpp/dev/trace_event_dev.h"
6
7 #include "ppapi/c/dev/ppb_trace_event_dev.h"
8 #include "ppapi/cpp/module.h"
9 #include "ppapi/cpp/module_impl.h"
10
11 namespace pp {
12
13 namespace {
14
15 template <> const char* interface_name<PPB_Trace_Event_Dev>() {
16 return PPB_TRACE_EVENT_DEV_INTERFACE_0_1;
17 }
18
19 } // namespace
20
21 const unsigned char* Trace_Events::GetCategoryEnabled(
22 const char* category_name) {
23 // This casting is due to limitations in PPAPI. It is unable to return
24 // a const pointer, and all pointer return types are necessarily void*.
25 return reinterpret_cast<const unsigned char*>(
26 get_interface<PPB_Trace_Event_Dev>()->GetCategoryEnabled(category_name));
27 }
28
29 void Trace_Events::AddTraceEvent(int8_t phase,
30 const void* category_enabled,
31 const char* name,
32 uint64_t id,
33 uint32_t num_args,
34 const char* arg_names[],
35 const uint8_t arg_types[],
36 const uint64_t arg_values[],
37 uint8_t flags) {
38 get_interface<PPB_Trace_Event_Dev>()->AddTraceEvent(phase, category_enabled,
39 name, id, num_args, arg_names, arg_types, arg_values, flags);
40 }
41
42 void Trace_Events::SetThreadName(const char* thread_name) {
43 get_interface<PPB_Trace_Event_Dev>()->SetThreadName(thread_name);
44 }
45
46 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/trace_event_dev.h ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698