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

Unified Diff: chrome/browser/service_process/service_process_control.cc

Issue 510563004: Temporary allocation of 20Mb before and after call to ServiceProcessControl::GetHistograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wed Aug 27 20:23:59 PDT 2014 Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/service_process/service_process_control.cc
diff --git a/chrome/browser/service_process/service_process_control.cc b/chrome/browser/service_process/service_process_control.cc
index 193f1f08d97614e22ee4f5970f431b72e176dda8..c6eae8471ef531c31cda327e979838a51e61f6af 100644
--- a/chrome/browser/service_process/service_process_control.cc
+++ b/chrome/browser/service_process/service_process_control.cc
@@ -25,6 +25,22 @@
using content::BrowserThread;
+namespace {
+
+// Test: On Mac, launchd_msg_send tries to allocate a 10MB buffer, but doesn't
+// handle errors and makes ugly crash dumps when close to OOM.
+// TODO(vitalybuka): Remove after few Canary builds.
+// See http://crbug.com/406227
+void AllocDebugTest() {
+#if defined(OS_MACOSX)
+ void* buffer = malloc(20 * 1024 * 1024);
+ CHECK(buffer);
+ free(buffer);
+#endif // OS_MACOSX
+}
+
+} // namespace
+
// ServiceProcessControl implementation.
ServiceProcessControl::ServiceProcessControl() {
}
@@ -223,6 +239,7 @@ void ServiceProcessControl::OnHistograms(
}
void ServiceProcessControl::RunHistogramsCallback() {
+ AllocDebugTest();
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!histograms_callback_.is_null()) {
histograms_callback_.Run();
@@ -259,6 +276,7 @@ bool ServiceProcessControl::GetCloudPrintProxyInfo(
bool ServiceProcessControl::GetHistograms(
const base::Closure& histograms_callback,
const base::TimeDelta& timeout) {
+ AllocDebugTest();
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!histograms_callback.is_null());
histograms_callback_.Reset();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698