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

Unified Diff: content/common/discardable_shared_memory_heap.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/discardable_shared_memory_heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/discardable_shared_memory_heap.cc
diff --git a/content/common/discardable_shared_memory_heap.cc b/content/common/discardable_shared_memory_heap.cc
index c854a96b042d86192c93d5aa9a6ce053005771ce..fc00ea300b95df236d885c68e7d93527b73d7bd2 100644
--- a/content/common/discardable_shared_memory_heap.cc
+++ b/content/common/discardable_shared_memory_heap.cc
@@ -142,7 +142,8 @@ DiscardableSharedMemoryHeap::SearchFreeList(size_t blocks) {
return best ? Carve(best, blocks) : nullptr;
}
-void DiscardableSharedMemoryHeap::ReleaseFreeMemory() {
+size_t DiscardableSharedMemoryHeap::ReleaseFreeMemory() {
+ size_t bytes_released = 0;
size_t i = 0;
// Release memory for all non-resident segments.
@@ -155,12 +156,16 @@ void DiscardableSharedMemoryHeap::ReleaseFreeMemory() {
continue;
}
+ bytes_released += shared_memory->mapped_size();
+
// Release the memory and unregistering all associated spans.
ReleaseMemory(shared_memory);
std::swap(shared_memory_segments_[i], shared_memory_segments_.back());
shared_memory_segments_.pop_back();
}
+
+ return bytes_released;
}
scoped_ptr<DiscardableSharedMemoryHeap::Span>
« no previous file with comments | « content/common/discardable_shared_memory_heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698