| Index: ppapi/cpp/dev/trace_event_dev.cc
|
| diff --git a/ppapi/cpp/dev/trace_event_dev.cc b/ppapi/cpp/dev/trace_event_dev.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ec3bbf2d59293c35fa067b2ed579918d09cd8f2d
|
| --- /dev/null
|
| +++ b/ppapi/cpp/dev/trace_event_dev.cc
|
| @@ -0,0 +1,46 @@
|
| +// Copyright (c) 2013 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/cpp/dev/trace_event_dev.h"
|
| +
|
| +#include "ppapi/c/dev/ppb_trace_event_dev.h"
|
| +#include "ppapi/cpp/module.h"
|
| +#include "ppapi/cpp/module_impl.h"
|
| +
|
| +namespace pp {
|
| +
|
| +namespace {
|
| +
|
| +template <> const char* interface_name<PPB_Trace_Event_Dev>() {
|
| + return PPB_TRACE_EVENT_DEV_INTERFACE_0_1;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +const unsigned char* Trace_Events::GetCategoryEnabled(
|
| + const char* category_name) {
|
| + // This casting is due to limitations in PPAPI. It is unable to return
|
| + // a const pointer, and all pointer return types are necessarily void*.
|
| + return reinterpret_cast<const unsigned char*>(
|
| + get_interface<PPB_Trace_Event_Dev>()->GetCategoryEnabled(category_name));
|
| +}
|
| +
|
| +void Trace_Events::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[],
|
| + uint8_t flags) {
|
| + get_interface<PPB_Trace_Event_Dev>()->AddTraceEvent(phase, category_enabled,
|
| + name, id, num_args, arg_names, arg_types, arg_values, flags);
|
| +}
|
| +
|
| +void Trace_Events::SetThreadName(const char* thread_name) {
|
| + get_interface<PPB_Trace_Event_Dev>()->SetThreadName(thread_name);
|
| +}
|
| +
|
| +} // namespace pp
|
|
|