Chromium Code Reviews| Index: base/trace_event/memory_dump_manager.cc |
| diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc |
| index 1e4d8229aef0b2a69ae9cf9f51f6547dc64203da..5f84d9033db94af21dad6ea20063f63fd82960fa 100644 |
| --- a/base/trace_event/memory_dump_manager.cc |
| +++ b/base/trace_event/memory_dump_manager.cc |
| @@ -317,12 +317,19 @@ void MemoryDumpManager::CreateProcessDump(const MemoryDumpRequestArgs& args, |
| bool MemoryDumpManager::InvokeDumpProviderLocked(MemoryDumpProvider* mdp, |
| ProcessMemoryDump* pmd) { |
| lock_.AssertAcquired(); |
| + const int kMaxFailuresCount = 3; |
|
Primiano Tucci (use gerrit)
2015/06/10 23:37:07
+consecutive
ssid
2015/06/12 14:37:00
Done.
|
| bool dump_successful = mdp->OnMemoryDump(pmd); |
| if (!dump_successful) { |
| LOG(ERROR) << "The memory dumper failed, possibly due to sandboxing " |
|
Primiano Tucci (use gerrit)
2015/06/10 23:37:07
you want to give this message only if it fails N t
ssid
2015/06/12 14:37:00
Done.
|
| "(crbug.com/461788), disabling it for current process. Try " |
| "restarting chrome with the --no-sandbox switch."; |
| - dump_providers_.find(mdp)->second.disabled = true; |
| + |
| + // Disable the MDP if it fails kMaxFailuresCount times consecutively. |
| + dump_providers_.find(mdp)->second.failures++; |
|
Primiano Tucci (use gerrit)
2015/06/10 23:37:07
Let's just lookup once, and keep the ptr to the md
ssid
2015/06/12 14:37:00
Done.
|
| + if (dump_providers_.find(mdp)->second.failures >= kMaxFailuresCount) |
| + dump_providers_.find(mdp)->second.disabled = true; |
| + } else { |
| + dump_providers_.find(mdp)->second.failures = 0; |
| } |
| return dump_successful; |
| } |
| @@ -396,7 +403,7 @@ void MemoryDumpManager::OnTraceLogDisabled() { |
| MemoryDumpManager::MemoryDumpProviderInfo::MemoryDumpProviderInfo( |
| const scoped_refptr<SingleThreadTaskRunner>& task_runner) |
| - : task_runner(task_runner), disabled(false) { |
| + : task_runner(task_runner), failures(0), disabled(false) { |
| } |
| MemoryDumpManager::MemoryDumpProviderInfo::~MemoryDumpProviderInfo() { |
| } |