Chromium Code Reviews| Index: content/child/child_shared_bitmap_manager.cc |
| diff --git a/content/child/child_shared_bitmap_manager.cc b/content/child/child_shared_bitmap_manager.cc |
| index 3374f4a98ba32a39e14e78a68751bf81792ebfed..bd2ca2ee6c7248dd223ceadf16967d5983fa553f 100644 |
| --- a/content/child/child_shared_bitmap_manager.cc |
| +++ b/content/child/child_shared_bitmap_manager.cc |
| @@ -111,8 +111,11 @@ ChildSharedBitmapManager::AllocateSharedMemoryBitmap(const gfx::Size& size) { |
| bool send_success = |
| sender_->Send(new ChildProcessHostMsg_SyncAllocateSharedBitmap( |
| memory_size, id, &handle)); |
| - if (!send_success) |
| - return nullptr; |
| + if (!send_success) { |
| + // Callers of this method are not prepared to handle failures during |
| + // shutdown. Exit immediately. https://crbug.com/615121. |
| + exit(EXIT_SUCCESS); |
|
Avi (use Gerrit)
2016/06/01 21:07:38
/base/process/memory.h's TerminateBecauseOutOfMemo
erikchen
2016/06/01 21:10:46
That is both inaccurate, as this is not an OOM, an
|
| + } |
| memory = base::WrapUnique(new base::SharedMemory(handle, false)); |
| if (!memory->Map(memory_size)) |
| CollectMemoryUsageAndDie(size, memory_size); |
| @@ -121,10 +124,13 @@ ChildSharedBitmapManager::AllocateSharedMemoryBitmap(const gfx::Size& size) { |
| memory = ChildThreadImpl::AllocateSharedMemory(memory_size, sender_.get(), |
| &out_of_memory); |
| if (!memory) { |
| - if (out_of_memory) |
| + if (out_of_memory) { |
| CollectMemoryUsageAndDie(size, memory_size); |
| - else |
| - return nullptr; |
| + } else { |
| + // Callers of this method are not prepared to handle failures during |
| + // shutdown. Exit immediately. https://crbug.com/615121. |
| + exit(EXIT_SUCCESS); |
| + } |
| } |
| if (!memory->Map(memory_size)) |