OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 5 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
6 | 6 |
7 #include "ipc/ipc_message_macros.h" | 7 #include "ipc/ipc_message_macros.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
11 BrowserPpapiHostImpl::BrowserPpapiHostImpl( | 11 BrowserPpapiHostImpl::BrowserPpapiHostImpl( |
12 IPC::Sender* sender, | 12 IPC::Sender* sender, |
13 const ppapi::PpapiPermissions& permissions) | 13 const ppapi::PpapiPermissions& permissions) |
14 : host_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 14 : host_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
15 ppapi_host_(sender, &host_factory_, permissions) { | 15 ppapi_host_(sender, &host_factory_, permissions), |
| 16 plugin_process_handle_(base::kNullProcessHandle) { |
16 } | 17 } |
17 | 18 |
18 BrowserPpapiHostImpl::~BrowserPpapiHostImpl() { | 19 BrowserPpapiHostImpl::~BrowserPpapiHostImpl() { |
19 } | 20 } |
20 | 21 |
21 bool BrowserPpapiHostImpl::OnMessageReceived(const IPC::Message& msg) { | 22 bool BrowserPpapiHostImpl::OnMessageReceived(const IPC::Message& msg) { |
22 /* TODO(brettw) when we add messages, here, the code should look like this: | 23 /* TODO(brettw) when we add messages, here, the code should look like this: |
23 bool handled = true; | 24 bool handled = true; |
24 IPC_BEGIN_MESSAGE_MAP(BrowserPpapiHostImpl, msg) | 25 IPC_BEGIN_MESSAGE_MAP(BrowserPpapiHostImpl, msg) |
25 // Add necessary message handlers here. | 26 // Add necessary message handlers here. |
26 IPC_MESSAGE_UNHANDLED(handled = ppapi_host_.OnMessageReceived(msg)) | 27 IPC_MESSAGE_UNHANDLED(handled = ppapi_host_.OnMessageReceived(msg)) |
27 IPC_END_MESSAGE_MAP(); | 28 IPC_END_MESSAGE_MAP(); |
28 return handled; | 29 return handled; |
29 */ | 30 */ |
30 return ppapi_host_.OnMessageReceived(msg); | 31 return ppapi_host_.OnMessageReceived(msg); |
31 } | 32 } |
32 | 33 |
33 ppapi::host::PpapiHost* BrowserPpapiHostImpl::GetPpapiHost() { | 34 ppapi::host::PpapiHost* BrowserPpapiHostImpl::GetPpapiHost() { |
34 return &ppapi_host_; | 35 return &ppapi_host_; |
35 } | 36 } |
36 | 37 |
| 38 base::ProcessHandle BrowserPpapiHostImpl::GetPluginProcessHandle() const { |
| 39 // Handle should previously have been set before use. |
| 40 DCHECK(plugin_process_handle_ != base::kNullProcessHandle); |
| 41 return plugin_process_handle_; |
| 42 } |
| 43 |
37 } // namespace content | 44 } // namespace content |
OLD | NEW |