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

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

Issue 2923123004: [memory-infra] Add API to ProcessMemoryDump to create ownership edges for base::SharedMemory (Closed)
Patch Set: fix typo. Created 3 years, 6 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
« no previous file with comments | « base/memory/shared_memory_tracker.cc ('k') | base/trace_event/memory_allocator_dump_guid.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 static void SetUseSharedMemoryBasedGUIDsForTesting();
23
19 MemoryAllocatorDumpGuid(); 24 MemoryAllocatorDumpGuid();
20 explicit MemoryAllocatorDumpGuid(uint64_t guid); 25 explicit MemoryAllocatorDumpGuid(uint64_t guid);
21 26
22 // Utility ctor to hash a GUID if the caller prefers a string. The caller 27 // 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 28 // still has to ensure that |guid_str| is unique, per snapshot, within the
24 // global scope of all the traced processes. 29 // global scope of all the traced processes.
25 explicit MemoryAllocatorDumpGuid(const std::string& guid_str); 30 explicit MemoryAllocatorDumpGuid(const std::string& guid_str);
26 31
27 uint64_t ToUint64() const { return guid_; } 32 uint64_t ToUint64() const { return guid_; }
28 33
(...skipping 17 matching lines...) Expand all
46 private: 51 private:
47 uint64_t guid_; 52 uint64_t guid_;
48 53
49 // Deliberately copy-able. 54 // Deliberately copy-able.
50 }; 55 };
51 56
52 } // namespace trace_event 57 } // namespace trace_event
53 } // namespace base 58 } // namespace base
54 59
55 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_ 60 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_
OLDNEW
« no previous file with comments | « base/memory/shared_memory_tracker.cc ('k') | base/trace_event/memory_allocator_dump_guid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698