OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 template<bool dummyMangle> class MangleBehavior { | 262 template<bool dummyMangle> class MangleBehavior { |
263 public: | 263 public: |
264 template<typename T> explicit MangleBehavior(T id) : m_data(reinterpret_
cast<unsigned long long>(id)) { } | 264 template<typename T> explicit MangleBehavior(T id) : m_data(reinterpret_
cast<unsigned long long>(id)) { } |
265 unsigned long long data() const { return m_data; } | 265 unsigned long long data() const { return m_data; } |
266 private: | 266 private: |
267 unsigned long long m_data; | 267 unsigned long long m_data; |
268 }; | 268 }; |
269 typedef MangleBehavior<false> DontMangle; | 269 typedef MangleBehavior<false> DontMangle; |
270 typedef MangleBehavior<true> ForceMangle; | 270 typedef MangleBehavior<true> ForceMangle; |
271 | 271 |
272 TraceID(const void* id, unsigned* flags) : | 272 TraceID(const void* id, unsigned* flags) |
273 m_data(static_cast<unsigned long long>(reinterpret_cast<unsigned long>(i
d))) | 273 : m_data(static_cast<unsigned long long>(reinterpret_cast<uintptr_t>(id)
)) |
274 { | 274 { |
275 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; | 275 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
276 } | 276 } |
277 TraceID(ForceMangle id, unsigned* flags) : m_data(id.data()) | 277 TraceID(ForceMangle id, unsigned* flags) : m_data(id.data()) |
278 { | 278 { |
279 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; | 279 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; |
280 } | 280 } |
281 TraceID(DontMangle id, unsigned*) : m_data(id.data()) { } | 281 TraceID(DontMangle id, unsigned*) : m_data(id.data()) { } |
282 TraceID(unsigned long long id, unsigned*) : m_data(id) { } | 282 TraceID(unsigned long long id, unsigned*) : m_data(id) { } |
283 TraceID(unsigned long id, unsigned*) : m_data(id) { } | 283 TraceID(unsigned long id, unsigned*) : m_data(id) { } |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 const char* m_categoryGroup; | 611 const char* m_categoryGroup; |
612 const char* m_name; | 612 const char* m_name; |
613 IDType m_id; | 613 IDType m_id; |
614 }; | 614 }; |
615 | 615 |
616 } // namespace TraceEvent | 616 } // namespace TraceEvent |
617 | 617 |
618 } // namespace blink | 618 } // namespace blink |
619 | 619 |
620 #endif | 620 #endif |
OLD | NEW |