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

Side by Side Diff: base/memory/shared_memory_handle.cc

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: (rebase) Created 3 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
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | base/memory/shared_memory_mac.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "base/memory/shared_memory_handle.h" 5 #include "base/memory/shared_memory_handle.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) = 9 SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) =
10 default; 10 default;
11 11
12 SharedMemoryHandle& SharedMemoryHandle::operator=( 12 SharedMemoryHandle& SharedMemoryHandle::operator=(
13 const SharedMemoryHandle& handle) = default; 13 const SharedMemoryHandle& handle) = default;
14 14
15 base::UnguessableToken SharedMemoryHandle::GetGUID() const { 15 base::UnguessableToken SharedMemoryHandle::GetGUID() const {
16 return guid_; 16 return guid_;
17 } 17 }
18 18
19 size_t SharedMemoryHandle::GetSize() const { 19 size_t SharedMemoryHandle::GetSize() const {
20 return size_; 20 return size_;
21 } 21 }
22 22
23 std::string SharedMemoryHandle::GetGUIDNameForTracing() const {
24 return "shared_memory/" + GetGUID().ToString();
25 }
26
27 trace_event::MemoryAllocatorDumpGuid SharedMemoryHandle::GetGUIDForTracing()
28 const {
29 auto name = GetGUIDNameForTracing();
30 if (name.empty())
31 return base::trace_event::MemoryAllocatorDumpGuid();
32 return base::trace_event::MemoryAllocatorDumpGuid(name);
33 }
34
23 } // namespace base 35 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | base/memory/shared_memory_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698