| 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 "chrome/browser/nacl_host/nacl_process_host.h" | 5 #include "chrome/browser/nacl_host/nacl_process_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/chrome_version_info.h" | 29 #include "chrome/common/chrome_version_info.h" |
| 30 #include "chrome/common/logging_chrome.h" | 30 #include "chrome/common/logging_chrome.h" |
| 31 #include "chrome/common/nacl_cmd_line.h" | 31 #include "chrome/common/nacl_cmd_line.h" |
| 32 #include "chrome/common/nacl_messages.h" | 32 #include "chrome/common/nacl_messages.h" |
| 33 #include "chrome/common/render_messages.h" | 33 #include "chrome/common/render_messages.h" |
| 34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 35 #include "content/public/browser/browser_child_process_host.h" | 35 #include "content/public/browser/browser_child_process_host.h" |
| 36 #include "content/public/browser/child_process_data.h" | 36 #include "content/public/browser/child_process_data.h" |
| 37 #include "content/public/browser/pepper_helper.h" |
| 37 #include "content/public/common/child_process_host.h" | 38 #include "content/public/common/child_process_host.h" |
| 38 #include "ipc/ipc_channel.h" | 39 #include "ipc/ipc_channel.h" |
| 39 #include "ipc/ipc_switches.h" | 40 #include "ipc/ipc_switches.h" |
| 40 #include "native_client/src/shared/imc/nacl_imc.h" | 41 #include "native_client/src/shared/imc/nacl_imc.h" |
| 41 #include "net/base/net_util.h" | 42 #include "net/base/net_util.h" |
| 42 #include "ppapi/proxy/ppapi_messages.h" | 43 #include "ppapi/proxy/ppapi_messages.h" |
| 43 | 44 |
| 44 #if defined(OS_POSIX) | 45 #if defined(OS_POSIX) |
| 45 #include <fcntl.h> | 46 #include <fcntl.h> |
| 46 | 47 |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 const IPC::ChannelHandle& channel_handle) { | 705 const IPC::ChannelHandle& channel_handle) { |
| 705 DCHECK(enable_ipc_proxy_); | 706 DCHECK(enable_ipc_proxy_); |
| 706 // If the proxy channel is null, this must be the initial NaCl-Browser IPC | 707 // If the proxy channel is null, this must be the initial NaCl-Browser IPC |
| 707 // channel. | 708 // channel. |
| 708 if (!ipc_proxy_channel_.get()) { | 709 if (!ipc_proxy_channel_.get()) { |
| 709 ipc_proxy_channel_.reset( | 710 ipc_proxy_channel_.reset( |
| 710 new IPC::ChannelProxy(channel_handle, | 711 new IPC::ChannelProxy(channel_handle, |
| 711 IPC::Channel::MODE_CLIENT, | 712 IPC::Channel::MODE_CLIENT, |
| 712 &ipc_plugin_listener_, | 713 &ipc_plugin_listener_, |
| 713 base::MessageLoopProxy::current())); | 714 base::MessageLoopProxy::current())); |
| 715 // Enable PPAPI message dispatching to the browser process. |
| 716 content::EnablePepperSupportForChannel( |
| 717 ipc_proxy_channel_.get(), |
| 718 chrome_render_message_filter_->GetHostResolver()); |
| 714 // Send a message to create the NaCl-Renderer channel. The handle is just | 719 // Send a message to create the NaCl-Renderer channel. The handle is just |
| 715 // a place holder. | 720 // a place holder. |
| 716 ipc_proxy_channel_->Send( | 721 ipc_proxy_channel_->Send( |
| 717 new PpapiMsg_CreateNaClChannel( | 722 new PpapiMsg_CreateNaClChannel( |
| 718 chrome_render_message_filter_->render_process_id(), | 723 chrome_render_message_filter_->render_process_id(), |
| 719 chrome_render_message_filter_->off_the_record(), | 724 chrome_render_message_filter_->off_the_record(), |
| 720 SerializedHandle(SerializedHandle::CHANNEL_HANDLE, | 725 SerializedHandle(SerializedHandle::CHANNEL_HANDLE, |
| 721 IPC::InvalidPlatformFileForTransit()))); | 726 IPC::InvalidPlatformFileForTransit()))); |
| 722 } else if (reply_msg_) { | 727 } else if (reply_msg_) { |
| 723 // Otherwise, this must be a renderer channel. | 728 // Otherwise, this must be a renderer channel. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 } else { | 843 } else { |
| 839 NaClStartDebugExceptionHandlerThread( | 844 NaClStartDebugExceptionHandlerThread( |
| 840 process_handle.Take(), info, | 845 process_handle.Take(), info, |
| 841 base::MessageLoopProxy::current(), | 846 base::MessageLoopProxy::current(), |
| 842 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 847 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 843 weak_factory_.GetWeakPtr())); | 848 weak_factory_.GetWeakPtr())); |
| 844 return true; | 849 return true; |
| 845 } | 850 } |
| 846 } | 851 } |
| 847 #endif | 852 #endif |
| OLD | NEW |