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

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

Issue 1437433002: Fix a 64-bit pointer truncation bug found by VC++ 2015 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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 under third_party_mods/chromium or at: 3 // found in the LICENSE file under third_party_mods/chromium or at:
4 // http://src.chromium.org/svn/trunk/src/LICENSE 4 // http://src.chromium.org/svn/trunk/src/LICENSE
5 5
6 #ifndef WEBRTC_BASE_TRACE_EVENT_H_ 6 #ifndef WEBRTC_BASE_TRACE_EVENT_H_
7 #define WEBRTC_BASE_TRACE_EVENT_H_ 7 #define WEBRTC_BASE_TRACE_EVENT_H_
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 : data_(static_cast<unsigned long long>(id)) {} 694 : data_(static_cast<unsigned long long>(id)) {}
695 695
696 unsigned long long data() const { return data_; } 696 unsigned long long data() const { return data_; }
697 697
698 private: 698 private:
699 unsigned long long data_; 699 unsigned long long data_;
700 }; 700 };
701 701
702 explicit TraceID(const void* id, unsigned char* flags) 702 explicit TraceID(const void* id, unsigned char* flags)
703 : data_(static_cast<unsigned long long>( 703 : data_(static_cast<unsigned long long>(
704 reinterpret_cast<unsigned long>(id))) { 704 reinterpret_cast<uintptr_t>(id))) {
705 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; 705 *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
706 } 706 }
707 explicit TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) { 707 explicit TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) {
708 *flags |= TRACE_EVENT_FLAG_MANGLE_ID; 708 *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
709 } 709 }
710 explicit TraceID(unsigned long long id, unsigned char* flags) 710 explicit TraceID(unsigned long long id, unsigned char* flags)
711 : data_(id) { (void)flags; } 711 : data_(id) { (void)flags; }
712 explicit TraceID(unsigned long id, unsigned char* flags) 712 explicit TraceID(unsigned long id, unsigned char* flags)
713 : data_(id) { (void)flags; } 713 : data_(id) { (void)flags; }
714 explicit TraceID(unsigned int id, unsigned char* flags) 714 explicit TraceID(unsigned int id, unsigned char* flags)
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 const char* name; 907 const char* name;
908 }; 908 };
909 Data* p_data_; 909 Data* p_data_;
910 Data data_; 910 Data data_;
911 }; 911 };
912 912
913 } // namespace trace_event_internal 913 } // namespace trace_event_internal
914 } // namespace webrtc 914 } // namespace webrtc
915 915
916 #endif // WEBRTC_BASE_TRACE_EVENT_H_ 916 #endif // WEBRTC_BASE_TRACE_EVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698