| 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 const IPC::ChannelHandle& channel_handle) { | 752 const IPC::ChannelHandle& channel_handle) { |
| 753 DCHECK(enable_ipc_proxy_); | 753 DCHECK(enable_ipc_proxy_); |
| 754 // If the proxy channel is null, this must be the initial NaCl-Browser IPC | 754 // If the proxy channel is null, this must be the initial NaCl-Browser IPC |
| 755 // channel. | 755 // channel. |
| 756 if (!ipc_proxy_channel_.get()) { | 756 if (!ipc_proxy_channel_.get()) { |
| 757 ipc_proxy_channel_.reset( | 757 ipc_proxy_channel_.reset( |
| 758 new IPC::ChannelProxy(channel_handle, | 758 new IPC::ChannelProxy(channel_handle, |
| 759 IPC::Channel::MODE_CLIENT, | 759 IPC::Channel::MODE_CLIENT, |
| 760 &ipc_plugin_listener_, | 760 &ipc_plugin_listener_, |
| 761 base::MessageLoopProxy::current())); | 761 base::MessageLoopProxy::current())); |
| 762 // Enable PPAPI message dispatching to the browser process. | 762 // Create the browser ppapi host and enable PPAPI message dispatching to the |
| 763 content::EnablePepperSupportForChannel( | 763 // browser process. |
| 764 content::BrowserPpapiHost::CreateExternalPluginProcess( |
| 765 process_.get(), // sender |
| 766 permissions_, |
| 767 process_->GetData().handle, |
| 764 ipc_proxy_channel_.get(), | 768 ipc_proxy_channel_.get(), |
| 765 chrome_render_message_filter_->GetHostResolver(), | 769 chrome_render_message_filter_->GetHostResolver(), |
| 766 chrome_render_message_filter_->render_process_id(), | 770 chrome_render_message_filter_->render_process_id(), |
| 767 render_view_id_); | 771 render_view_id_); |
| 768 // Send a message to create the NaCl-Renderer channel. The handle is just | 772 // Send a message to create the NaCl-Renderer channel. The handle is just |
| 769 // a place holder. | 773 // a place holder. |
| 770 ipc_proxy_channel_->Send( | 774 ipc_proxy_channel_->Send( |
| 771 new PpapiMsg_CreateNaClChannel( | 775 new PpapiMsg_CreateNaClChannel( |
| 772 chrome_render_message_filter_->render_process_id(), | 776 chrome_render_message_filter_->render_process_id(), |
| 773 permissions_, | 777 permissions_, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 } else { | 897 } else { |
| 894 NaClStartDebugExceptionHandlerThread( | 898 NaClStartDebugExceptionHandlerThread( |
| 895 process_handle.Take(), info, | 899 process_handle.Take(), info, |
| 896 base::MessageLoopProxy::current(), | 900 base::MessageLoopProxy::current(), |
| 897 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 901 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 898 weak_factory_.GetWeakPtr())); | 902 weak_factory_.GetWeakPtr())); |
| 899 return true; | 903 return true; |
| 900 } | 904 } |
| 901 } | 905 } |
| 902 #endif | 906 #endif |
| OLD | NEW |