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

Side by Side Diff: content/child/child_discardable_shared_memory_manager.h

Issue 952273005: content: Update crash key and discardable memory usage counter in child process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | content/child/child_discardable_shared_memory_manager.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CONTENT_CHILD_CHILD_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ 5 #ifndef CONTENT_CHILD_CHILD_DISCARDABLE_SHARED_MEMORY_MANAGER_H_
6 #define CONTENT_CHILD_CHILD_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ 6 #define CONTENT_CHILD_CHILD_DISCARDABLE_SHARED_MEMORY_MANAGER_H_
7 7
8 #include "base/memory/discardable_memory_shmem_allocator.h" 8 #include "base/memory/discardable_memory_shmem_allocator.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 18 matching lines...) Expand all
29 // Release memory and associated resources that have been purged. 29 // Release memory and associated resources that have been purged.
30 void ReleaseFreeMemory(); 30 void ReleaseFreeMemory();
31 31
32 bool LockSpan(DiscardableSharedMemoryHeap::Span* span); 32 bool LockSpan(DiscardableSharedMemoryHeap::Span* span);
33 void UnlockSpan(DiscardableSharedMemoryHeap::Span* span); 33 void UnlockSpan(DiscardableSharedMemoryHeap::Span* span);
34 void ReleaseSpan(scoped_ptr<DiscardableSharedMemoryHeap::Span> span); 34 void ReleaseSpan(scoped_ptr<DiscardableSharedMemoryHeap::Span> span);
35 35
36 private: 36 private:
37 scoped_ptr<base::DiscardableSharedMemory> 37 scoped_ptr<base::DiscardableSharedMemory>
38 AllocateLockedDiscardableSharedMemory(size_t size); 38 AllocateLockedDiscardableSharedMemory(size_t size);
39 void BytesAllocatedChanged(size_t new_bytes_allocated) const;
39 40
40 mutable base::Lock lock_; 41 mutable base::Lock lock_;
41 DiscardableSharedMemoryHeap heap_; 42 DiscardableSharedMemoryHeap heap_;
42 scoped_refptr<ThreadSafeSender> sender_; 43 scoped_refptr<ThreadSafeSender> sender_;
44 size_t bytes_allocated_;
43 45
44 DISALLOW_COPY_AND_ASSIGN(ChildDiscardableSharedMemoryManager); 46 DISALLOW_COPY_AND_ASSIGN(ChildDiscardableSharedMemoryManager);
45 }; 47 };
46 48
47 } // namespace content 49 } // namespace content
48 50
49 #endif // CONTENT_CHILD_CHILD_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ 51 #endif // CONTENT_CHILD_CHILD_DISCARDABLE_SHARED_MEMORY_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/child_discardable_shared_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698