| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MEMORY_ALLOCATOR_DUMP_GUID_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_ |
| 6 #define BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/base_export.h" | 12 #include "base/base_export.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 namespace trace_event { | 15 namespace trace_event { |
| 16 | 16 |
| 17 class BASE_EXPORT MemoryAllocatorDumpGuid { | 17 class BASE_EXPORT MemoryAllocatorDumpGuid { |
| 18 public: | 18 public: |
| 19 // If the clients of base::SharedMemory should use the global dump guid(s) |
| 20 // created by SharedMemoryTracker. |
| 21 static bool UseSharedMemoryBasedGUIDs(); |
| 22 |
| 19 MemoryAllocatorDumpGuid(); | 23 MemoryAllocatorDumpGuid(); |
| 20 explicit MemoryAllocatorDumpGuid(uint64_t guid); | 24 explicit MemoryAllocatorDumpGuid(uint64_t guid); |
| 21 | 25 |
| 22 // Utility ctor to hash a GUID if the caller prefers a string. The caller | 26 // Utility ctor to hash a GUID if the caller prefers a string. The caller |
| 23 // still has to ensure that |guid_str| is unique, per snapshot, within the | 27 // still has to ensure that |guid_str| is unique, per snapshot, within the |
| 24 // global scope of all the traced processes. | 28 // global scope of all the traced processes. |
| 25 explicit MemoryAllocatorDumpGuid(const std::string& guid_str); | 29 explicit MemoryAllocatorDumpGuid(const std::string& guid_str); |
| 26 | 30 |
| 27 uint64_t ToUint64() const { return guid_; } | 31 uint64_t ToUint64() const { return guid_; } |
| 28 | 32 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 46 private: | 50 private: |
| 47 uint64_t guid_; | 51 uint64_t guid_; |
| 48 | 52 |
| 49 // Deliberately copy-able. | 53 // Deliberately copy-able. |
| 50 }; | 54 }; |
| 51 | 55 |
| 52 } // namespace trace_event | 56 } // namespace trace_event |
| 53 } // namespace base | 57 } // namespace base |
| 54 | 58 |
| 55 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_ | 59 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_ |
| OLD | NEW |