Chromium Code Reviews| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "ppapi/thunk/thunk.h" | 10 #include "ppapi/thunk/thunk.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 const char* arg_names[], | 71 const char* arg_names[], |
| 72 const uint8_t arg_types[], | 72 const uint8_t arg_types[], |
| 73 const uint64_t arg_values[], | 73 const uint64_t arg_values[], |
| 74 uint8_t flags) { | 74 uint8_t flags) { |
| 75 base::trace_event::TraceLog::GetInstance() | 75 base::trace_event::TraceLog::GetInstance() |
| 76 ->AddTraceEventWithThreadIdAndTimestamp( | 76 ->AddTraceEventWithThreadIdAndTimestamp( |
| 77 phase, | 77 phase, |
| 78 static_cast<const unsigned char*>(category_enabled), | 78 static_cast<const unsigned char*>(category_enabled), |
| 79 name, | 79 name, |
| 80 id, | 80 id, |
| 81 trace_event_internal::kNoId, | |
| 82 thread_id, | 81 thread_id, |
|
dsinclair
2015/07/21 18:11:49
This file shouldn't need to change yet right? We a
yuhaoz
2015/07/21 18:22:34
Right that's why I removed the kNoId. fmeawad@ for
dsinclair
2015/07/21 18:32:50
Just add the context_id into the overloaded versio
| |
| 83 base::TraceTicks::FromInternalValue(timestamp), | 82 base::TraceTicks::FromInternalValue(timestamp), |
| 84 num_args, | 83 num_args, |
| 85 arg_names, | 84 arg_names, |
| 86 arg_types, | 85 arg_types, |
| 87 // This cast is necessary for LP64 systems, where uint64_t is defined as | 86 // This cast is necessary for LP64 systems, where uint64_t is defined as |
|
vmpstr
2015/07/21 18:03:41
You'll probably need to rewrap the comment to be 8
| |
| 88 // an unsigned long int, but trace_event internals are hermetic and | 87 // an unsigned long int, but trace_event internals are hermetic and |
| 89 // accepts an |unsigned long long*|. The pointer types are compatible but | 88 // accepts an |unsigned long long*|. The pointer types are compatible but |
| 90 // the compiler throws an error without an explicit cast. | 89 // the compiler throws an error without an explicit cast. |
| 91 reinterpret_cast<const unsigned long long*>(arg_values), | 90 reinterpret_cast<const unsigned long long*>(arg_values), |
| 92 NULL, | 91 NULL, |
| 93 flags); | 92 flags); |
| 94 } | 93 } |
| 95 | 94 |
| 96 // static | 95 // static |
| 97 int64_t TraceEventImpl::Now() { | 96 int64_t TraceEventImpl::Now() { |
| 98 return base::TraceTicks::Now().ToInternalValue(); | 97 return base::TraceTicks::Now().ToInternalValue(); |
| 99 } | 98 } |
| 100 | 99 |
| 101 // static | 100 // static |
| 102 void TraceEventImpl::SetThreadName(const char* thread_name) { | 101 void TraceEventImpl::SetThreadName(const char* thread_name) { |
| 103 base::PlatformThread::SetName(thread_name); | 102 base::PlatformThread::SetName(thread_name); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 126 const PPB_Trace_Event_Dev_0_1* GetPPB_Trace_Event_Dev_0_1_Thunk() { | 125 const PPB_Trace_Event_Dev_0_1* GetPPB_Trace_Event_Dev_0_1_Thunk() { |
| 127 return &g_ppb_trace_event_thunk_0_1; | 126 return &g_ppb_trace_event_thunk_0_1; |
| 128 } | 127 } |
| 129 | 128 |
| 130 const PPB_Trace_Event_Dev_0_2* GetPPB_Trace_Event_Dev_0_2_Thunk() { | 129 const PPB_Trace_Event_Dev_0_2* GetPPB_Trace_Event_Dev_0_2_Thunk() { |
| 131 return &g_ppb_trace_event_thunk_0_2; | 130 return &g_ppb_trace_event_thunk_0_2; |
| 132 } | 131 } |
| 133 | 132 |
| 134 } // namespace thunk | 133 } // namespace thunk |
| 135 } // namespace ppapi | 134 } // namespace ppapi |
| OLD | NEW |