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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 NaClProcessHost::PluginListener::PluginListener(NaClProcessHost* host) | 125 NaClProcessHost::PluginListener::PluginListener(NaClProcessHost* host) |
126 : host_(host) { | 126 : host_(host) { |
127 } | 127 } |
128 | 128 |
129 bool NaClProcessHost::PluginListener::OnMessageReceived( | 129 bool NaClProcessHost::PluginListener::OnMessageReceived( |
130 const IPC::Message& msg) { | 130 const IPC::Message& msg) { |
131 return host_->OnUntrustedMessageForwarded(msg); | 131 return host_->OnUntrustedMessageForwarded(msg); |
132 } | 132 } |
133 | 133 |
| 134 // TODO(brettw) bug 153036 set the pepper permissions up for dev interfaces. |
134 NaClProcessHost::NaClProcessHost(const GURL& manifest_url, bool off_the_record) | 135 NaClProcessHost::NaClProcessHost(const GURL& manifest_url, bool off_the_record) |
135 : manifest_url_(manifest_url), | 136 : manifest_url_(manifest_url), |
| 137 permissions_(ppapi::PpapiPermissions::GetForCommandLine(0)), |
136 #if defined(OS_WIN) | 138 #if defined(OS_WIN) |
137 process_launched_by_broker_(false), | 139 process_launched_by_broker_(false), |
138 #elif defined(OS_LINUX) | 140 #elif defined(OS_LINUX) |
139 wait_for_nacl_gdb_(false), | 141 wait_for_nacl_gdb_(false), |
140 #endif | 142 #endif |
141 reply_msg_(NULL), | 143 reply_msg_(NULL), |
142 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
143 debug_exception_handler_requested_(false), | 145 debug_exception_handler_requested_(false), |
144 #endif | 146 #endif |
145 internal_(new NaClInternal()), | 147 internal_(new NaClInternal()), |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 base::MessageLoopProxy::current())); | 753 base::MessageLoopProxy::current())); |
752 // Enable PPAPI message dispatching to the browser process. | 754 // Enable PPAPI message dispatching to the browser process. |
753 content::EnablePepperSupportForChannel( | 755 content::EnablePepperSupportForChannel( |
754 ipc_proxy_channel_.get(), | 756 ipc_proxy_channel_.get(), |
755 chrome_render_message_filter_->GetHostResolver()); | 757 chrome_render_message_filter_->GetHostResolver()); |
756 // Send a message to create the NaCl-Renderer channel. The handle is just | 758 // Send a message to create the NaCl-Renderer channel. The handle is just |
757 // a place holder. | 759 // a place holder. |
758 ipc_proxy_channel_->Send( | 760 ipc_proxy_channel_->Send( |
759 new PpapiMsg_CreateNaClChannel( | 761 new PpapiMsg_CreateNaClChannel( |
760 chrome_render_message_filter_->render_process_id(), | 762 chrome_render_message_filter_->render_process_id(), |
| 763 permissions_, |
761 chrome_render_message_filter_->off_the_record(), | 764 chrome_render_message_filter_->off_the_record(), |
762 SerializedHandle(SerializedHandle::CHANNEL_HANDLE, | 765 SerializedHandle(SerializedHandle::CHANNEL_HANDLE, |
763 IPC::InvalidPlatformFileForTransit()))); | 766 IPC::InvalidPlatformFileForTransit()))); |
764 } else if (reply_msg_) { | 767 } else if (reply_msg_) { |
765 // Otherwise, this must be a renderer channel. | 768 // Otherwise, this must be a renderer channel. |
766 ReplyToRenderer(channel_handle); | 769 ReplyToRenderer(channel_handle); |
767 } else { | 770 } else { |
768 // Attempt to open more than 1 renderer channel is not supported. | 771 // Attempt to open more than 1 renderer channel is not supported. |
769 // Shut down the NaCl process. | 772 // Shut down the NaCl process. |
770 process_->GetHost()->ForceShutdown(); | 773 process_->GetHost()->ForceShutdown(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 } else { | 883 } else { |
881 NaClStartDebugExceptionHandlerThread( | 884 NaClStartDebugExceptionHandlerThread( |
882 process_handle.Take(), info, | 885 process_handle.Take(), info, |
883 base::MessageLoopProxy::current(), | 886 base::MessageLoopProxy::current(), |
884 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 887 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
885 weak_factory_.GetWeakPtr())); | 888 weak_factory_.GetWeakPtr())); |
886 return true; | 889 return true; |
887 } | 890 } |
888 } | 891 } |
889 #endif | 892 #endif |
OLD | NEW |