OLD | NEW |
(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 |
OLD | NEW |