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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 // from being reused before DebugActiveProcess() is called, and | 905 // from being reused before DebugActiveProcess() is called, and |
906 // holding a process handle open achieves this. | 906 // holding a process handle open achieves this. |
907 if (!base::OpenProcessHandleWithAccess( | 907 if (!base::OpenProcessHandleWithAccess( |
908 nacl_pid, | 908 nacl_pid, |
909 base::kProcessAccessQueryInformation | | 909 base::kProcessAccessQueryInformation | |
910 base::kProcessAccessSuspendResume | | 910 base::kProcessAccessSuspendResume | |
911 base::kProcessAccessTerminate | | 911 base::kProcessAccessTerminate | |
912 base::kProcessAccessVMOperation | | 912 base::kProcessAccessVMOperation | |
913 base::kProcessAccessVMRead | | 913 base::kProcessAccessVMRead | |
914 base::kProcessAccessVMWrite | | 914 base::kProcessAccessVMWrite | |
| 915 base::kProcessAccessDuplicateHandle | |
915 base::kProcessAccessWaitForTermination, | 916 base::kProcessAccessWaitForTermination, |
916 process_handle.Receive())) { | 917 process_handle.Receive())) { |
917 LOG(ERROR) << "Failed to get process handle"; | 918 LOG(ERROR) << "Failed to get process handle"; |
918 return false; | 919 return false; |
919 } | 920 } |
920 | 921 |
921 attach_debug_exception_handler_reply_msg_.reset(reply_msg); | 922 attach_debug_exception_handler_reply_msg_.reset(reply_msg); |
922 // If the NaCl loader is 64-bit, the process running its debug | 923 // If the NaCl loader is 64-bit, the process running its debug |
923 // exception handler must be 64-bit too, so we use the 64-bit NaCl | 924 // exception handler must be 64-bit too, so we use the 64-bit NaCl |
924 // broker process for this. Otherwise, on a 32-bit system, we use | 925 // broker process for this. Otherwise, on a 32-bit system, we use |
925 // the 32-bit browser process to run the debug exception handler. | 926 // the 32-bit browser process to run the debug exception handler. |
926 if (RunningOnWOW64()) { | 927 if (RunningOnWOW64()) { |
927 return NaClBrokerService::GetInstance()->LaunchDebugExceptionHandler( | 928 return NaClBrokerService::GetInstance()->LaunchDebugExceptionHandler( |
928 weak_factory_.GetWeakPtr(), nacl_pid, process_handle, info); | 929 weak_factory_.GetWeakPtr(), nacl_pid, process_handle, info); |
929 } else { | 930 } else { |
930 NaClStartDebugExceptionHandlerThread( | 931 NaClStartDebugExceptionHandlerThread( |
931 process_handle.Take(), info, | 932 process_handle.Take(), info, |
932 base::MessageLoopProxy::current(), | 933 base::MessageLoopProxy::current(), |
933 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 934 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
934 weak_factory_.GetWeakPtr())); | 935 weak_factory_.GetWeakPtr())); |
935 return true; | 936 return true; |
936 } | 937 } |
937 } | 938 } |
938 #endif | 939 #endif |
OLD | NEW |