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

Side by Side Diff: base/trace_event/trace_event.h

Issue 1997153002: libchrome: Several upstreamable fixes from libchrome Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Addressed feedback Created 4 years, 7 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
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 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_
6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ 6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_
7 7
8 // This header file defines implementation details of how the trace macros in 8 // This header file defines implementation details of how the trace macros in
9 // trace_event_common.h collect and store trace events. Anything not 9 // trace_event_common.h collect and store trace events. Anything not
10 // implementation-specific should go in trace_event_common.h instead of here. 10 // implementation-specific should go in trace_event_common.h instead of here.
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 unsigned long long raw_id_; 467 unsigned long long raw_id_;
468 }; 468 };
469 TraceID(const void* raw_id, unsigned int* flags) 469 TraceID(const void* raw_id, unsigned int* flags)
470 : raw_id_(static_cast<unsigned long long>( 470 : raw_id_(static_cast<unsigned long long>(
471 reinterpret_cast<uintptr_t>(raw_id))) { 471 reinterpret_cast<uintptr_t>(raw_id))) {
472 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; 472 *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
473 } 473 }
474 TraceID(ForceMangle raw_id, unsigned int* flags) : raw_id_(raw_id.raw_id()) { 474 TraceID(ForceMangle raw_id, unsigned int* flags) : raw_id_(raw_id.raw_id()) {
475 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; 475 *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
476 } 476 }
477 TraceID(DontMangle maybe_scoped_id, unsigned int* flags) 477 TraceID(DontMangle maybe_scoped_id, unsigned int* /*flags*/)
478 : scope_(maybe_scoped_id.scope()), raw_id_(maybe_scoped_id.raw_id()) { 478 : scope_(maybe_scoped_id.scope()), raw_id_(maybe_scoped_id.raw_id()) {}
479 }
480 TraceID(unsigned long long raw_id, unsigned int* flags) : raw_id_(raw_id) { 479 TraceID(unsigned long long raw_id, unsigned int* flags) : raw_id_(raw_id) {
481 (void)flags; 480 (void)flags;
482 } 481 }
483 TraceID(unsigned long raw_id, unsigned int* flags) : raw_id_(raw_id) { 482 TraceID(unsigned long raw_id, unsigned int* flags) : raw_id_(raw_id) {
484 (void)flags; 483 (void)flags;
485 } 484 }
486 TraceID(unsigned int raw_id, unsigned int* flags) : raw_id_(raw_id) { 485 TraceID(unsigned int raw_id, unsigned int* flags) : raw_id_(raw_id) {
487 (void)flags; 486 (void)flags;
488 } 487 }
489 TraceID(unsigned short raw_id, unsigned int* flags) : raw_id_(raw_id) { 488 TraceID(unsigned short raw_id, unsigned int* flags) : raw_id_(raw_id) {
490 (void)flags; 489 (void)flags;
491 } 490 }
492 TraceID(unsigned char raw_id, unsigned int* flags) : raw_id_(raw_id) { 491 TraceID(unsigned char raw_id, unsigned int* flags) : raw_id_(raw_id) {
493 (void)flags; 492 (void)flags;
494 } 493 }
495 TraceID(long long raw_id, unsigned int* flags) 494 TraceID(long long raw_id, unsigned int* flags)
496 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; } 495 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; }
497 TraceID(long raw_id, unsigned int* flags) 496 TraceID(long raw_id, unsigned int* flags)
498 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; } 497 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; }
499 TraceID(int raw_id, unsigned int* flags) 498 TraceID(int raw_id, unsigned int* flags)
500 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; } 499 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; }
501 TraceID(short raw_id, unsigned int* flags) 500 TraceID(short raw_id, unsigned int* flags)
502 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; } 501 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; }
503 TraceID(signed char raw_id, unsigned int* flags) 502 TraceID(signed char raw_id, unsigned int* flags)
504 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; } 503 : raw_id_(static_cast<unsigned long long>(raw_id)) { (void)flags; }
505 TraceID(WithScope scoped_id, unsigned int* flags) 504 TraceID(WithScope scoped_id, unsigned int* /*flags*/)
506 : scope_(scoped_id.scope()), raw_id_(scoped_id.raw_id()) {} 505 : scope_(scoped_id.scope()), raw_id_(scoped_id.raw_id()) {}
507 506
508 unsigned long long raw_id() const { return raw_id_; } 507 unsigned long long raw_id() const { return raw_id_; }
509 const char* scope() const { return scope_; } 508 const char* scope() const { return scope_; }
510 509
511 private: 510 private:
512 const char* scope_ = nullptr; 511 const char* scope_ = nullptr;
513 unsigned long long raw_id_; 512 unsigned long long raw_id_;
514 }; 513 };
515 514
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 const char* name_; 1082 const char* name_;
1084 IDType id_; 1083 IDType id_;
1085 1084
1086 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); 1085 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject);
1087 }; 1086 };
1088 1087
1089 } // namespace trace_event 1088 } // namespace trace_event
1090 } // namespace base 1089 } // namespace base
1091 1090
1092 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ 1091 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698