| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/shared_impl/ppb_trace_event_impl.h" | 5 #include "ppapi/shared_impl/ppb_trace_event_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
| 9 | 9 |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const uint8_t arg_types[], | 36 const uint8_t arg_types[], |
| 37 const uint64_t arg_values[], | 37 const uint64_t arg_values[], |
| 38 uint8_t flags) { | 38 uint8_t flags) { |
| 39 base::debug::TraceLog::GetInstance()->AddTraceEvent(phase, | 39 base::debug::TraceLog::GetInstance()->AddTraceEvent(phase, |
| 40 static_cast<const unsigned char*>(category_enabled), name, id, num_args, | 40 static_cast<const unsigned char*>(category_enabled), name, id, num_args, |
| 41 arg_names, arg_types, | 41 arg_names, arg_types, |
| 42 // This cast is necessary for LP64 systems, where uint64_t is defined as | 42 // This cast is necessary for LP64 systems, where uint64_t is defined as |
| 43 // an unsigned long int, but trace_event internals are hermetic and | 43 // an unsigned long int, but trace_event internals are hermetic and |
| 44 // accepts an |unsigned long long*|. The pointer types are compatible but | 44 // accepts an |unsigned long long*|. The pointer types are compatible but |
| 45 // the compiler throws an error without an explicit cast. | 45 // the compiler throws an error without an explicit cast. |
| 46 reinterpret_cast<const unsigned long long*>(arg_values), flags); | 46 reinterpret_cast<const unsigned long long*>(arg_values), NULL, flags); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // static | 49 // static |
| 50 void TraceEventImpl::SetThreadName(const char* thread_name) { | 50 void TraceEventImpl::SetThreadName(const char* thread_name) { |
| 51 base::PlatformThread::SetName(thread_name); | 51 base::PlatformThread::SetName(thread_name); |
| 52 } | 52 } |
| 53 | 53 |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 const PPB_Trace_Event_Dev g_ppb_trace_event_thunk = { | 56 const PPB_Trace_Event_Dev g_ppb_trace_event_thunk = { |
| 57 &TraceEventImpl::GetCategoryEnabled, | 57 &TraceEventImpl::GetCategoryEnabled, |
| 58 &TraceEventImpl::AddTraceEvent, | 58 &TraceEventImpl::AddTraceEvent, |
| 59 &TraceEventImpl::SetThreadName, | 59 &TraceEventImpl::SetThreadName, |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace ppapi | 62 } // namespace ppapi |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| 65 | 65 |
| 66 namespace ppapi { | 66 namespace ppapi { |
| 67 namespace thunk { | 67 namespace thunk { |
| 68 | 68 |
| 69 const PPB_Trace_Event_Dev_0_1* GetPPB_Trace_Event_Dev_0_1_Thunk() { | 69 const PPB_Trace_Event_Dev_0_1* GetPPB_Trace_Event_Dev_0_1_Thunk() { |
| 70 return &g_ppb_trace_event_thunk; | 70 return &g_ppb_trace_event_thunk; |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace thunk | 73 } // namespace thunk |
| 74 } // namespace ppapi | 74 } // namespace ppapi |
| OLD | NEW |