| 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_broker_host_win.h" | 5 #include "components/nacl/browser/nacl_broker_host_win.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" |
| 9 #include "components/nacl/browser/nacl_broker_service_win.h" | 10 #include "components/nacl/browser/nacl_broker_service_win.h" |
| 10 #include "components/nacl/browser/nacl_browser.h" | 11 #include "components/nacl/browser/nacl_browser.h" |
| 11 #include "components/nacl/common/nacl_cmd_line.h" | 12 #include "components/nacl/common/nacl_cmd_line.h" |
| 12 #include "components/nacl/common/nacl_messages.h" | 13 #include "components/nacl/common/nacl_messages.h" |
| 13 #include "components/nacl/common/nacl_process_type.h" | 14 #include "components/nacl/common/nacl_process_type.h" |
| 14 #include "components/nacl/common/nacl_switches.h" | 15 #include "components/nacl/common/nacl_switches.h" |
| 15 #include "content/public/browser/browser_child_process_host.h" | 16 #include "content/public/browser/browser_child_process_host.h" |
| 16 #include "content/public/browser/child_process_data.h" | 17 #include "content/public/browser/child_process_data.h" |
| 17 #include "content/public/common/child_process_host.h" | 18 #include "content/public/common/child_process_host.h" |
| 18 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return process_->Send( | 88 return process_->Send( |
| 88 new NaClProcessMsg_LaunchLoaderThroughBroker(loader_channel_id)); | 89 new NaClProcessMsg_LaunchLoaderThroughBroker(loader_channel_id)); |
| 89 } | 90 } |
| 90 | 91 |
| 91 void NaClBrokerHost::OnLoaderLaunched(const std::string& loader_channel_id, | 92 void NaClBrokerHost::OnLoaderLaunched(const std::string& loader_channel_id, |
| 92 base::ProcessHandle handle) { | 93 base::ProcessHandle handle) { |
| 93 NaClBrokerService::GetInstance()->OnLoaderLaunched(loader_channel_id, handle); | 94 NaClBrokerService::GetInstance()->OnLoaderLaunched(loader_channel_id, handle); |
| 94 } | 95 } |
| 95 | 96 |
| 96 bool NaClBrokerHost::LaunchDebugExceptionHandler( | 97 bool NaClBrokerHost::LaunchDebugExceptionHandler( |
| 97 int32 pid, base::ProcessHandle process_handle, | 98 int32_t pid, |
| 99 base::ProcessHandle process_handle, |
| 98 const std::string& startup_info) { | 100 const std::string& startup_info) { |
| 99 base::ProcessHandle broker_process = process_->GetData().handle; | 101 base::ProcessHandle broker_process = process_->GetData().handle; |
| 100 base::ProcessHandle handle_in_broker_process; | 102 base::ProcessHandle handle_in_broker_process; |
| 101 if (!DuplicateHandle(::GetCurrentProcess(), process_handle, | 103 if (!DuplicateHandle(::GetCurrentProcess(), process_handle, |
| 102 broker_process, &handle_in_broker_process, | 104 broker_process, &handle_in_broker_process, |
| 103 0, /* bInheritHandle= */ FALSE, DUPLICATE_SAME_ACCESS)) | 105 0, /* bInheritHandle= */ FALSE, DUPLICATE_SAME_ACCESS)) |
| 104 return false; | 106 return false; |
| 105 return process_->Send(new NaClProcessMsg_LaunchDebugExceptionHandler( | 107 return process_->Send(new NaClProcessMsg_LaunchDebugExceptionHandler( |
| 106 pid, handle_in_broker_process, startup_info)); | 108 pid, handle_in_broker_process, startup_info)); |
| 107 } | 109 } |
| 108 | 110 |
| 109 void NaClBrokerHost::OnDebugExceptionHandlerLaunched(int32 pid, bool success) { | 111 void NaClBrokerHost::OnDebugExceptionHandlerLaunched(int32_t pid, |
| 112 bool success) { |
| 110 NaClBrokerService::GetInstance()->OnDebugExceptionHandlerLaunched(pid, | 113 NaClBrokerService::GetInstance()->OnDebugExceptionHandlerLaunched(pid, |
| 111 success); | 114 success); |
| 112 } | 115 } |
| 113 | 116 |
| 114 void NaClBrokerHost::StopBroker() { | 117 void NaClBrokerHost::StopBroker() { |
| 115 is_terminating_ = true; | 118 is_terminating_ = true; |
| 116 process_->Send(new NaClProcessMsg_StopBroker()); | 119 process_->Send(new NaClProcessMsg_StopBroker()); |
| 117 } | 120 } |
| 118 | 121 |
| 119 } // namespace nacl | 122 } // namespace nacl |
| OLD | NEW |