Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: chrome/browser/nacl_host/nacl_process_host.cc

Issue 11441012: PPB_UDPSocket_Private is switched to the new Pepper proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 20 matching lines...) Expand all
31 #include "chrome/common/chrome_version_info.h" 31 #include "chrome/common/chrome_version_info.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/browser_ppapi_host.h"
39 #include "content/public/browser/child_process_data.h" 39 #include "content/public/browser/child_process_data.h"
40 #include "content/public/common/child_process_host.h" 40 #include "content/public/common/child_process_host.h"
41 #include "content/public/common/process_type.h"
41 #include "extensions/common/constants.h" 42 #include "extensions/common/constants.h"
42 #include "extensions/common/url_pattern.h" 43 #include "extensions/common/url_pattern.h"
43 #include "ipc/ipc_channel.h" 44 #include "ipc/ipc_channel.h"
44 #include "ipc/ipc_switches.h" 45 #include "ipc/ipc_switches.h"
45 #include "native_client/src/shared/imc/nacl_imc.h" 46 #include "native_client/src/shared/imc/nacl_imc.h"
46 #include "net/base/net_util.h" 47 #include "net/base/net_util.h"
47 #include "net/base/tcp_listen_socket.h" 48 #include "net/base/tcp_listen_socket.h"
48 #include "ppapi/proxy/ppapi_messages.h" 49 #include "ppapi/proxy/ppapi_messages.h"
49 50
50 #if defined(OS_POSIX) 51 #if defined(OS_POSIX)
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 771
771 // This method is called when NaClProcessHostMsg_PpapiChannelCreated is 772 // This method is called when NaClProcessHostMsg_PpapiChannelCreated is
772 // received or PpapiHostMsg_ChannelCreated is forwarded by our plugin 773 // received or PpapiHostMsg_ChannelCreated is forwarded by our plugin
773 // listener. 774 // listener.
774 void NaClProcessHost::OnPpapiChannelCreated( 775 void NaClProcessHost::OnPpapiChannelCreated(
775 const IPC::ChannelHandle& channel_handle) { 776 const IPC::ChannelHandle& channel_handle) {
776 DCHECK(enable_ipc_proxy_); 777 DCHECK(enable_ipc_proxy_);
777 // If the proxy channel is null, this must be the initial NaCl-Browser IPC 778 // If the proxy channel is null, this must be the initial NaCl-Browser IPC
778 // channel. 779 // channel.
779 if (!ipc_proxy_channel_.get()) { 780 if (!ipc_proxy_channel_.get()) {
781 DCHECK_EQ(content::PROCESS_TYPE_NACL_LOADER, process_->GetData().type);
782
780 ipc_proxy_channel_.reset( 783 ipc_proxy_channel_.reset(
781 new IPC::ChannelProxy(channel_handle, 784 new IPC::ChannelProxy(channel_handle,
782 IPC::Channel::MODE_CLIENT, 785 IPC::Channel::MODE_CLIENT,
783 &ipc_plugin_listener_, 786 &ipc_plugin_listener_,
784 base::MessageLoopProxy::current())); 787 base::MessageLoopProxy::current()));
785 // Create the browser ppapi host and enable PPAPI message dispatching to the 788 // Create the browser ppapi host and enable PPAPI message dispatching to the
786 // browser process. 789 // browser process.
787 ppapi_host_.reset(content::BrowserPpapiHost::CreateExternalPluginProcess( 790 ppapi_host_.reset(content::BrowserPpapiHost::CreateExternalPluginProcess(
788 ipc_proxy_channel_.get(), //process_.get(), // sender 791 ipc_proxy_channel_.get(), // sender
789 permissions_, 792 permissions_,
790 process_->GetData().handle, 793 process_->GetData().handle,
791 ipc_proxy_channel_.get(), 794 ipc_proxy_channel_.get(),
792 chrome_render_message_filter_->GetHostResolver(), 795 chrome_render_message_filter_->GetHostResolver(),
793 chrome_render_message_filter_->render_process_id(), 796 chrome_render_message_filter_->render_process_id(),
794 render_view_id_)); 797 render_view_id_));
795 798
796 // Send a message to create the NaCl-Renderer channel. The handle is just 799 // Send a message to create the NaCl-Renderer channel. The handle is just
797 // a place holder. 800 // a place holder.
798 ipc_proxy_channel_->Send( 801 ipc_proxy_channel_->Send(
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 } else { 925 } else {
923 NaClStartDebugExceptionHandlerThread( 926 NaClStartDebugExceptionHandlerThread(
924 process_handle.Take(), info, 927 process_handle.Take(), info,
925 base::MessageLoopProxy::current(), 928 base::MessageLoopProxy::current(),
926 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, 929 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker,
927 weak_factory_.GetWeakPtr())); 930 weak_factory_.GetWeakPtr()));
928 return true; 931 return true;
929 } 932 }
930 } 933 }
931 #endif 934 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698