1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/child/child_discardable_shared_memory_manager.h"
7 #include "base/memory/discardable_shared_memory.h"
8 #include "content/child/child_thread.h"
9 #include "content/common/child_process_messages.h"
13 ChildDiscardableSharedMemoryManager::ChildDiscardableSharedMemoryManager(
14 ThreadSafeSender
* sender
)
18 ChildDiscardableSharedMemoryManager::~ChildDiscardableSharedMemoryManager() {
21 scoped_ptr
<base::DiscardableSharedMemory
>
22 ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableSharedMemory(
24 TRACE_EVENT1("renderer",
25 "ChildDiscardableSharedMemoryManager::"
26 "AllocateLockedDiscardableSharedMemory",
30 base::SharedMemoryHandle handle
= base::SharedMemory::NULLHandle();
32 new ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory(
34 scoped_ptr
<base::DiscardableSharedMemory
> memory(
35 new base::DiscardableSharedMemory(handle
));
36 CHECK(memory
->Map(size
));
40 } // namespace content