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

Unified Diff: base/process/memory.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: base/process/memory.cc
diff --git a/base/process/memory.cc b/base/process/memory.cc
index 8542dc582e641104b69146e2070e2e64c4123ed6..6445ff921a6f474637a935b049d5b635cd6b0bd1 100644
--- a/base/process/memory.cc
+++ b/base/process/memory.cc
@@ -2,10 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/logging.h"
#include "base/process/memory.h"
namespace base {
+namespace {
+
+// Breakpad server already classifies base::`anonymous namespace'::OnNoMemory as
+// out-of-memory crash.
+NOINLINE void OnNoMemory() {
reveman 2015/03/27 05:05:20 We seem to have different implementations of this
Vitaly Buka (NO REVIEWS) 2015/03/27 06:29:13 I guess it's just historical, I see no good reason
reveman 2015/03/27 13:04:50 Looks like the return type of OnNoMemory is differ
+ LOG(FATAL) << "Out of memory.";
+}
+
+} // namespace
+
+void CrashWithOutOfMemory() {
+ OnNoMemory();
+}
+
// Defined in memory_mac.mm for Mac.
#if !defined(OS_MACOSX)

Powered by Google App Engine
This is Rietveld 408576698