1// Copyright (c) 2012 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.
4
5#include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h"
6
7#include "content/child/child_process.h"
8#include "content/common/sandbox_util.h"
9
10namespace content {
11
12PepperProxyChannelDelegateImpl::~PepperProxyChannelDelegateImpl() {}
13
14base::MessageLoopProxy* PepperProxyChannelDelegateImpl::GetIPCMessageLoop() {
15  // This is called only in the renderer so we know we have a child process.
16  DCHECK(ChildProcess::current()) << "Must be in the renderer.";
17  return ChildProcess::current()->io_message_loop_proxy();
18}
19
20base::WaitableEvent* PepperProxyChannelDelegateImpl::GetShutdownEvent() {
21  DCHECK(ChildProcess::current()) << "Must be in the renderer.";
22  return ChildProcess::current()->GetShutDownEvent();
23}
24
25IPC::PlatformFileForTransit
26PepperProxyChannelDelegateImpl::ShareHandleWithRemote(
27    base::PlatformFile handle,
28    base::ProcessId remote_pid,
29    bool should_close_source) {
30  return BrokerGetFileHandleForProcess(handle, remote_pid, should_close_source);
31}
32
33}  // namespace content
34