OLD | NEW |
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_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ | 5 #ifndef CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
6 #define CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ | 6 #define CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 ~HostDiscardableSharedMemoryManager() override; | 34 ~HostDiscardableSharedMemoryManager() override; |
35 | 35 |
36 // Returns a singleton instance. | 36 // Returns a singleton instance. |
37 static HostDiscardableSharedMemoryManager* current(); | 37 static HostDiscardableSharedMemoryManager* current(); |
38 | 38 |
39 // Overridden from base::DiscardableMemoryAllocator: | 39 // Overridden from base::DiscardableMemoryAllocator: |
40 scoped_ptr<base::DiscardableMemory> AllocateLockedDiscardableMemory( | 40 scoped_ptr<base::DiscardableMemory> AllocateLockedDiscardableMemory( |
41 size_t size) override; | 41 size_t size) override; |
42 | 42 |
43 // Overridden from base::trace_event::MemoryDumpProvider: | 43 // Overridden from base::trace_event::MemoryDumpProvider: |
44 bool OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) override; | 44 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 45 base::trace_event::ProcessMemoryDump* pmd) override; |
45 | 46 |
46 // This allocates a discardable memory segment for |process_handle|. | 47 // This allocates a discardable memory segment for |process_handle|. |
47 // A valid shared memory handle is returned on success. | 48 // A valid shared memory handle is returned on success. |
48 void AllocateLockedDiscardableSharedMemoryForChild( | 49 void AllocateLockedDiscardableSharedMemoryForChild( |
49 base::ProcessHandle process_handle, | 50 base::ProcessHandle process_handle, |
50 int child_process_id, | 51 int child_process_id, |
51 size_t size, | 52 size_t size, |
52 DiscardableSharedMemoryId id, | 53 DiscardableSharedMemoryId id, |
53 base::SharedMemoryHandle* shared_memory_handle); | 54 base::SharedMemoryHandle* shared_memory_handle); |
54 | 55 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 129 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
129 bool enforce_memory_policy_pending_; | 130 bool enforce_memory_policy_pending_; |
130 base::WeakPtrFactory<HostDiscardableSharedMemoryManager> weak_ptr_factory_; | 131 base::WeakPtrFactory<HostDiscardableSharedMemoryManager> weak_ptr_factory_; |
131 | 132 |
132 DISALLOW_COPY_AND_ASSIGN(HostDiscardableSharedMemoryManager); | 133 DISALLOW_COPY_AND_ASSIGN(HostDiscardableSharedMemoryManager); |
133 }; | 134 }; |
134 | 135 |
135 } // namespace content | 136 } // namespace content |
136 | 137 |
137 #endif // CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ | 138 #endif // CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
OLD | NEW |