| OLD | NEW |
| 1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 | 5 |
| 6 | 6 |
| 7 /* XRay -- a simple profiler for Native Client */ | 7 /* XRay -- a simple profiler for Native Client */ |
| 8 | 8 |
| 9 #ifndef XRAY_DISABLE_BROWSER_INTEGRATION | 9 #ifndef XRAY_DISABLE_BROWSER_INTEGRATION |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 struct XRayTimestampPair XRayGenerateTimestampsNow(void) { | 34 struct XRayTimestampPair XRayGenerateTimestampsNow(void) { |
| 35 struct XRayTimestampPair pair; | 35 struct XRayTimestampPair pair; |
| 36 assert(ppb_trace_event_interface); | 36 assert(ppb_trace_event_interface); |
| 37 | 37 |
| 38 XRayGetTSC(&pair.xray); | 38 XRayGetTSC(&pair.xray); |
| 39 pair.pepper = ppb_trace_event_interface->Now(); | 39 pair.pepper = ppb_trace_event_interface->Now(); |
| 40 return pair; | 40 return pair; |
| 41 } | 41 } |
| 42 | 42 |
| 43 /* see chromium/src/base/debug/trace_event.h */ | 43 /* see chromium/src/base/trace_event/trace_event.h */ |
| 44 #define TRACE_VALUE_TYPE_UINT (2) | 44 #define TRACE_VALUE_TYPE_UINT (2) |
| 45 #define TRACE_VALUE_TYPE_DOUBLE (4) | 45 #define TRACE_VALUE_TYPE_DOUBLE (4) |
| 46 #define TRACE_VALUE_TYPE_COPY_STRING (7) | 46 #define TRACE_VALUE_TYPE_COPY_STRING (7) |
| 47 | 47 |
| 48 union TraceValue { | 48 union TraceValue { |
| 49 bool as_bool; | 49 bool as_bool; |
| 50 unsigned long long as_uint; | 50 unsigned long long as_uint; |
| 51 long long as_int; | 51 long long as_int; |
| 52 double as_double; | 52 double as_double; |
| 53 const void* as_pointer; | 53 const void* as_pointer; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 } | 154 } |
| 155 | 155 |
| 156 void XRayRegisterBrowserInterface(PPB_GetInterface interface) { | 156 void XRayRegisterBrowserInterface(PPB_GetInterface interface) { |
| 157 ppb_trace_event_interface = (PPB_Trace_Event_Dev*)interface( | 157 ppb_trace_event_interface = (PPB_Trace_Event_Dev*)interface( |
| 158 PPB_TRACE_EVENT_DEV_INTERFACE); | 158 PPB_TRACE_EVENT_DEV_INTERFACE); |
| 159 assert(ppb_trace_event_interface); | 159 assert(ppb_trace_event_interface); |
| 160 } | 160 } |
| 161 | 161 |
| 162 #endif /* XRAY */ | 162 #endif /* XRAY */ |
| 163 #endif /* XRAY_DISABLE_BROWSER_INTEGRATION */ | 163 #endif /* XRAY_DISABLE_BROWSER_INTEGRATION */ |
| OLD | NEW |