| 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 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
| 29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 30 #include "chrome/common/chrome_version_info.h" | 30 #include "chrome/common/chrome_version_info.h" |
| 31 #include "chrome/common/extensions/url_pattern.h" | 31 #include "chrome/common/extensions/url_pattern.h" |
| 32 #include "chrome/common/logging_chrome.h" | 32 #include "chrome/common/logging_chrome.h" |
| 33 #include "chrome/common/nacl_cmd_line.h" | 33 #include "chrome/common/nacl_cmd_line.h" |
| 34 #include "chrome/common/nacl_messages.h" | 34 #include "chrome/common/nacl_messages.h" |
| 35 #include "chrome/common/render_messages.h" | 35 #include "chrome/common/render_messages.h" |
| 36 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
| 37 #include "content/public/browser/browser_child_process_host.h" | 37 #include "content/public/browser/browser_child_process_host.h" |
| 38 #include "content/public/browser/browser_ppapi_host.h" |
| 38 #include "content/public/browser/child_process_data.h" | 39 #include "content/public/browser/child_process_data.h" |
| 39 #include "content/public/browser/pepper_helper.h" | |
| 40 #include "content/public/common/child_process_host.h" | 40 #include "content/public/common/child_process_host.h" |
| 41 #include "ipc/ipc_channel.h" | 41 #include "ipc/ipc_channel.h" |
| 42 #include "ipc/ipc_switches.h" | 42 #include "ipc/ipc_switches.h" |
| 43 #include "native_client/src/shared/imc/nacl_imc.h" | 43 #include "native_client/src/shared/imc/nacl_imc.h" |
| 44 #include "net/base/net_util.h" | 44 #include "net/base/net_util.h" |
| 45 #include "net/base/tcp_listen_socket.h" | 45 #include "net/base/tcp_listen_socket.h" |
| 46 #include "ppapi/proxy/ppapi_messages.h" | 46 #include "ppapi/proxy/ppapi_messages.h" |
| 47 | 47 |
| 48 #if defined(OS_POSIX) | 48 #if defined(OS_POSIX) |
| 49 #include <fcntl.h> | 49 #include <fcntl.h> |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 const IPC::ChannelHandle& channel_handle) { | 749 const IPC::ChannelHandle& channel_handle) { |
| 750 DCHECK(enable_ipc_proxy_); | 750 DCHECK(enable_ipc_proxy_); |
| 751 // If the proxy channel is null, this must be the initial NaCl-Browser IPC | 751 // If the proxy channel is null, this must be the initial NaCl-Browser IPC |
| 752 // channel. | 752 // channel. |
| 753 if (!ipc_proxy_channel_.get()) { | 753 if (!ipc_proxy_channel_.get()) { |
| 754 ipc_proxy_channel_.reset( | 754 ipc_proxy_channel_.reset( |
| 755 new IPC::ChannelProxy(channel_handle, | 755 new IPC::ChannelProxy(channel_handle, |
| 756 IPC::Channel::MODE_CLIENT, | 756 IPC::Channel::MODE_CLIENT, |
| 757 &ipc_plugin_listener_, | 757 &ipc_plugin_listener_, |
| 758 base::MessageLoopProxy::current())); | 758 base::MessageLoopProxy::current())); |
| 759 // Enable PPAPI message dispatching to the browser process. | 759 // Create the browser ppapi host and enable PPAPI message dispatching to the |
| 760 content::EnablePepperSupportForChannel( | 760 // browser process. |
| 761 content::BrowserPpapiHost::CreateExternalPluginProcess( |
| 762 process_.get(), // sender |
| 763 permissions_, |
| 764 process_->GetData().handle, |
| 761 ipc_proxy_channel_.get(), | 765 ipc_proxy_channel_.get(), |
| 762 chrome_render_message_filter_->GetHostResolver()); | 766 chrome_render_message_filter_->GetHostResolver()); |
| 763 // Send a message to create the NaCl-Renderer channel. The handle is just | 767 // Send a message to create the NaCl-Renderer channel. The handle is just |
| 764 // a place holder. | 768 // a place holder. |
| 765 ipc_proxy_channel_->Send( | 769 ipc_proxy_channel_->Send( |
| 766 new PpapiMsg_CreateNaClChannel( | 770 new PpapiMsg_CreateNaClChannel( |
| 767 chrome_render_message_filter_->render_process_id(), | 771 chrome_render_message_filter_->render_process_id(), |
| 768 permissions_, | 772 permissions_, |
| 769 chrome_render_message_filter_->off_the_record(), | 773 chrome_render_message_filter_->off_the_record(), |
| 770 SerializedHandle(SerializedHandle::CHANNEL_HANDLE, | 774 SerializedHandle(SerializedHandle::CHANNEL_HANDLE, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 } else { | 892 } else { |
| 889 NaClStartDebugExceptionHandlerThread( | 893 NaClStartDebugExceptionHandlerThread( |
| 890 process_handle.Take(), info, | 894 process_handle.Take(), info, |
| 891 base::MessageLoopProxy::current(), | 895 base::MessageLoopProxy::current(), |
| 892 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 896 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 893 weak_factory_.GetWeakPtr())); | 897 weak_factory_.GetWeakPtr())); |
| 894 return true; | 898 return true; |
| 895 } | 899 } |
| 896 } | 900 } |
| 897 #endif | 901 #endif |
| OLD | NEW |