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

Unified Diff: content/child/child_discardable_shared_memory_manager.cc

Issue 1039043002: Add base::TerminateBecauseOutOfMemory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Thu Mar 26 16:12:29 PDT 2015 Created 5 years, 9 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
Index: content/child/child_discardable_shared_memory_manager.cc
diff --git a/content/child/child_discardable_shared_memory_manager.cc b/content/child/child_discardable_shared_memory_manager.cc
index 14dfe97e7df975420594e4de8ed44e358451f88d..afab4356a70519b20113c0805528004883db0975 100644
--- a/content/child/child_discardable_shared_memory_manager.cc
+++ b/content/child/child_discardable_shared_memory_manager.cc
@@ -10,6 +10,7 @@
#include "base/memory/discardable_memory.h"
#include "base/memory/discardable_shared_memory.h"
#include "base/metrics/histogram.h"
+#include "base/process/memory.h"
#include "base/process/process_metrics.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
@@ -267,7 +268,8 @@ ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory(
CHECK(base::SharedMemory::IsHandleValid(handle));
reveman 2015/03/27 05:05:20 This is an OOM error too. You can just remove this
Vitaly Buka (NO REVIEWS) 2015/03/27 06:29:14 Done.
scoped_ptr<base::DiscardableSharedMemory> memory(
new base::DiscardableSharedMemory(handle));
- CHECK(memory->Map(size));
+ if (!memory->Map(size))
+ base::CrashWithOutOfMemory();
return memory.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698