Commit f89ce26c authored by vitalybuka's avatar vitalybuka Committed by Commit bot

Temporary allocation of 20Mb before and after call to ServiceProcessControl::GetHistograms.

BUG=406227

Review URL: https://codereview.chromium.org/510563004

Cr-Commit-Position: refs/heads/master@{#292325}
parent 3bddbe11
...@@ -25,6 +25,22 @@ ...@@ -25,6 +25,22 @@
using content::BrowserThread; 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 implementation.
ServiceProcessControl::ServiceProcessControl() { ServiceProcessControl::ServiceProcessControl() {
} }
...@@ -223,6 +239,7 @@ void ServiceProcessControl::OnHistograms( ...@@ -223,6 +239,7 @@ void ServiceProcessControl::OnHistograms(
} }
void ServiceProcessControl::RunHistogramsCallback() { void ServiceProcessControl::RunHistogramsCallback() {
AllocDebugTest();
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (!histograms_callback_.is_null()) { if (!histograms_callback_.is_null()) {
histograms_callback_.Run(); histograms_callback_.Run();
...@@ -259,6 +276,7 @@ bool ServiceProcessControl::GetCloudPrintProxyInfo( ...@@ -259,6 +276,7 @@ bool ServiceProcessControl::GetCloudPrintProxyInfo(
bool ServiceProcessControl::GetHistograms( bool ServiceProcessControl::GetHistograms(
const base::Closure& histograms_callback, const base::Closure& histograms_callback,
const base::TimeDelta& timeout) { const base::TimeDelta& timeout) {
AllocDebugTest();
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!histograms_callback.is_null()); DCHECK(!histograms_callback.is_null());
histograms_callback_.Reset(); histograms_callback_.Reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment