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 "components/nacl/browser/nacl_process_host.h" | 5 #include "components/nacl/browser/nacl_process_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
814 } | 814 } |
815 #endif | 815 #endif |
816 | 816 |
817 bool NaClProcessHost::StartNaClExecution() { | 817 bool NaClProcessHost::StartNaClExecution() { |
818 NaClBrowser* nacl_browser = NaClBrowser::GetInstance(); | 818 NaClBrowser* nacl_browser = NaClBrowser::GetInstance(); |
819 | 819 |
820 NaClStartParams params; | 820 NaClStartParams params; |
821 | 821 |
822 // Enable PPAPI proxy channel creation only for renderer processes. | 822 // Enable PPAPI proxy channel creation only for renderer processes. |
823 params.enable_ipc_proxy = enable_ppapi_proxy(); | 823 params.enable_ipc_proxy = enable_ppapi_proxy(); |
824 // Currently, non-SFI mode is supported only on Linux. | |
825 #if defined(OS_LINUX) | |
826 if (params.enable_ipc_proxy && uses_nonsfi_mode_) { | |
Mark Seaborn
2015/04/15 20:52:05
Nit: At the moment, uses_nonsfi_mode_ implies enab
hidehiko
2015/05/12 18:47:51
Done.
| |
827 if (!IPC::SocketPair(¶ms.browser_server_ppapi_fd.fd, | |
828 ¶ms.browser_client_ppapi_fd.fd) || | |
829 !IPC::SocketPair(¶ms.renderer_server_ppapi_fd.fd, | |
Mark Seaborn
2015/04/15 20:52:05
If the subsequent IPC::SocketPair() calls fail, wo
Mark Seaborn
2015/05/12 06:46:10
I guess you're trying to clean up that pre-existin
hidehiko
2015/05/12 18:47:51
Ok, done.
| |
830 ¶ms.renderer_client_ppapi_fd.fd) || | |
831 !IPC::SocketPair(¶ms.manifest_service_server_fd.fd, | |
832 ¶ms.manifest_service_client_fd.fd) || | |
833 !IPC::SocketPair(¶ms.trusted_channel_server_fd.fd, | |
834 ¶ms.trusted_channel_client_fd.fd)) { | |
835 return false; | |
836 } | |
837 params.browser_server_ppapi_fd.auto_close = true; | |
838 params.browser_client_ppapi_fd.auto_close = true; | |
Mark Seaborn
2015/04/15 20:52:05
Notice how the NaCl loader process is receiving th
hidehiko
2015/05/12 18:47:51
Done.
| |
839 params.renderer_server_ppapi_fd.auto_close = true; | |
840 params.renderer_client_ppapi_fd.auto_close = true; | |
841 params.manifest_service_server_fd.auto_close = true; | |
842 params.manifest_service_client_fd.auto_close = true; | |
843 params.trusted_channel_server_fd.auto_close = true; | |
844 params.trusted_channel_client_fd.auto_close = true; | |
845 } | |
846 #endif | |
847 | |
824 params.process_type = process_type_; | 848 params.process_type = process_type_; |
825 bool enable_nacl_debug = enable_debug_stub_ && | 849 bool enable_nacl_debug = enable_debug_stub_ && |
826 NaClBrowser::GetDelegate()->URLMatchesDebugPatterns(manifest_url_); | 850 NaClBrowser::GetDelegate()->URLMatchesDebugPatterns(manifest_url_); |
827 if (uses_nonsfi_mode_) { | 851 if (uses_nonsfi_mode_) { |
828 // Currently, non-SFI mode is supported only on Linux. | 852 // Currently, non-SFI mode is supported only on Linux. |
829 #if defined(OS_LINUX) | 853 #if defined(OS_LINUX) |
830 // In non-SFI mode, we do not use SRPC. Make sure that the socketpair is | 854 // In non-SFI mode, we do not use SRPC. Make sure that the socketpair is |
831 // not created. | 855 // not created. |
832 DCHECK(!socket_for_sel_ldr_.IsValid()); | 856 DCHECK(!socket_for_sel_ldr_.IsValid()); |
833 #endif | 857 #endif |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1208 process.Pass(), info, | 1232 process.Pass(), info, |
1209 base::MessageLoopProxy::current(), | 1233 base::MessageLoopProxy::current(), |
1210 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1234 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
1211 weak_factory_.GetWeakPtr())); | 1235 weak_factory_.GetWeakPtr())); |
1212 return true; | 1236 return true; |
1213 } | 1237 } |
1214 } | 1238 } |
1215 #endif | 1239 #endif |
1216 | 1240 |
1217 } // namespace nacl | 1241 } // namespace nacl |
OLD | NEW |