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

Side by Side Diff: ppapi/shared_impl/ppb_trace_event_impl.cc

Issue 13590005: Add a ConvertableToTraceFormat type to the trace framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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 | « content/renderer/render_thread_impl.cc ('k') | webkit/glue/webkitplatformsupport_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | webkit/glue/webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698