Commit 527e2da9 authored by reveman's avatar reveman Committed by Commit bot

content: Add valid handle check to...

content: Add valid handle check to ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory.

This check allows us to distinguish between allocation failure
on the browser side and failure to map the memory in the child
process.

BUG=460995

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

Cr-Commit-Position: refs/heads/master@{#317746}
parent b7f2b2f5
...@@ -187,6 +187,7 @@ ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory( ...@@ -187,6 +187,7 @@ ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory(
sender_->Send( sender_->Send(
new ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory( new ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory(
size, &handle)); size, &handle));
CHECK(base::SharedMemory::IsHandleValid(handle));
scoped_ptr<base::DiscardableSharedMemory> memory( scoped_ptr<base::DiscardableSharedMemory> memory(
new base::DiscardableSharedMemory(handle)); new base::DiscardableSharedMemory(handle));
CHECK(memory->Map(size)); CHECK(memory->Map(size));
......
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