| 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 <string.h> | 7 #include <string.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 delete this; | 712 delete this; |
| 713 } else if (!StartNaClExecution()) { | 713 } else if (!StartNaClExecution()) { |
| 714 delete this; | 714 delete this; |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 | 717 |
| 718 void NaClProcessHost::ReplyToRenderer( | 718 void NaClProcessHost::ReplyToRenderer( |
| 719 ScopedChannelHandle ppapi_channel_handle, | 719 ScopedChannelHandle ppapi_channel_handle, |
| 720 ScopedChannelHandle trusted_channel_handle, | 720 ScopedChannelHandle trusted_channel_handle, |
| 721 ScopedChannelHandle manifest_service_channel_handle) { | 721 ScopedChannelHandle manifest_service_channel_handle) { |
| 722 #if defined(OS_WIN) | |
| 723 // If we are on 64-bit Windows, the NaCl process's sandbox is | |
| 724 // managed by a different process from the renderer's sandbox. We | |
| 725 // need to inform the renderer's sandbox about the NaCl process so | |
| 726 // that the renderer can send handles to the NaCl process using | |
| 727 // BrokerDuplicateHandle(). | |
| 728 if (RunningOnWOW64()) { | |
| 729 if (!content::BrokerAddTargetPeer(process_->GetData().handle)) { | |
| 730 SendErrorToRenderer("BrokerAddTargetPeer() failed"); | |
| 731 return; | |
| 732 } | |
| 733 } | |
| 734 #endif | |
| 735 | |
| 736 // Hereafter, we always send an IPC message with handles created above | 722 // Hereafter, we always send an IPC message with handles created above |
| 737 // which, on Windows, are not closable in this process. | 723 // which, on Windows, are not closable in this process. |
| 738 std::string error_message; | 724 std::string error_message; |
| 739 base::SharedMemoryHandle crash_info_shmem_renderer_handle; | 725 base::SharedMemoryHandle crash_info_shmem_renderer_handle; |
| 740 if (!crash_info_shmem_.ShareToProcess(nacl_host_message_filter_->PeerHandle(), | 726 if (!crash_info_shmem_.ShareToProcess(nacl_host_message_filter_->PeerHandle(), |
| 741 &crash_info_shmem_renderer_handle)) { | 727 &crash_info_shmem_renderer_handle)) { |
| 742 // On error, we do not send "IPC::ChannelHandle"s to the renderer process. | 728 // On error, we do not send "IPC::ChannelHandle"s to the renderer process. |
| 743 // Note that some other FDs/handles still get sent to the renderer, but | 729 // Note that some other FDs/handles still get sent to the renderer, but |
| 744 // will be closed there. | 730 // will be closed there. |
| 745 ppapi_channel_handle.reset(); | 731 ppapi_channel_handle.reset(); |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 NaClStartDebugExceptionHandlerThread( | 1324 NaClStartDebugExceptionHandlerThread( |
| 1339 std::move(process), info, base::ThreadTaskRunnerHandle::Get(), | 1325 std::move(process), info, base::ThreadTaskRunnerHandle::Get(), |
| 1340 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1326 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 1341 weak_factory_.GetWeakPtr())); | 1327 weak_factory_.GetWeakPtr())); |
| 1342 return true; | 1328 return true; |
| 1343 } | 1329 } |
| 1344 } | 1330 } |
| 1345 #endif | 1331 #endif |
| 1346 | 1332 |
| 1347 } // namespace nacl | 1333 } // namespace nacl |
| OLD | NEW |