OLD | NEW |
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 | 5 |
6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
8 #pragma once | 8 #pragma once |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 unsigned char flags); | 241 unsigned char flags); |
242 static void AddTraceEventEtw(char phase, | 242 static void AddTraceEventEtw(char phase, |
243 const char* name, | 243 const char* name, |
244 const void* id, | 244 const void* id, |
245 const char* extra); | 245 const char* extra); |
246 static void AddTraceEventEtw(char phase, | 246 static void AddTraceEventEtw(char phase, |
247 const char* name, | 247 const char* name, |
248 const void* id, | 248 const void* id, |
249 const std::string& extra); | 249 const std::string& extra); |
250 | 250 |
251 // Mangle |ptr| with a hash based on the process ID so that if |ptr| occurs on | |
252 // more than one process, it will not collide. | |
253 unsigned long long GetInterProcessID(void* ptr) const { | |
254 return static_cast<unsigned long long>(reinterpret_cast<uintptr_t>(ptr)) ^ | |
255 process_id_hash_; | |
256 } | |
257 | |
258 int process_id() const { return process_id_; } | 251 int process_id() const { return process_id_; } |
259 | 252 |
260 // Exposed for unittesting: | 253 // Exposed for unittesting: |
261 | 254 |
262 // Allows deleting our singleton instance. | 255 // Allows deleting our singleton instance. |
263 static void DeleteForTesting(); | 256 static void DeleteForTesting(); |
264 | 257 |
265 // Allows resurrecting our singleton instance post-AtExit processing. | 258 // Allows resurrecting our singleton instance post-AtExit processing. |
266 static void Resurrect(); | 259 static void Resurrect(); |
267 | 260 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 295 |
303 int process_id_; | 296 int process_id_; |
304 | 297 |
305 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 298 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
306 }; | 299 }; |
307 | 300 |
308 } // namespace debug | 301 } // namespace debug |
309 } // namespace base | 302 } // namespace base |
310 | 303 |
311 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 304 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |