| 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" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/process_util.h" |
| 15 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 16 #include "base/string_split.h" | 17 #include "base/string_split.h" |
| 17 #include "base/string_util.h" | 18 #include "base/string_util.h" |
| 18 #include "base/stringprintf.h" | 19 #include "base/stringprintf.h" |
| 19 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 20 #include "base/win/windows_version.h" | 21 #include "base/win/windows_version.h" |
| 21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 22 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/extensions/extension_info_map.h" | 24 #include "chrome/browser/extensions/extension_info_map.h" |
| 24 #include "chrome/browser/io_thread.h" | 25 #include "chrome/browser/io_thread.h" |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 // that the renderer can send handles to the NaCl process using | 653 // that the renderer can send handles to the NaCl process using |
| 653 // BrokerDuplicateHandle(). | 654 // BrokerDuplicateHandle(). |
| 654 if (RunningOnWOW64()) { | 655 if (RunningOnWOW64()) { |
| 655 if (!content::BrokerAddTargetPeer(process_->GetData().handle)) { | 656 if (!content::BrokerAddTargetPeer(process_->GetData().handle)) { |
| 656 DLOG(ERROR) << "Failed to add NaCl process PID"; | 657 DLOG(ERROR) << "Failed to add NaCl process PID"; |
| 657 return false; | 658 return false; |
| 658 } | 659 } |
| 659 } | 660 } |
| 660 #endif | 661 #endif |
| 661 | 662 |
| 663 const ChildProcessData& data = process_->GetData(); |
| 662 ChromeViewHostMsg_LaunchNaCl::WriteReplyParams( | 664 ChromeViewHostMsg_LaunchNaCl::WriteReplyParams( |
| 663 reply_msg_, handles_for_renderer, | 665 reply_msg_, handles_for_renderer, |
| 664 channel_handle, process_->GetData().id); | 666 channel_handle, base::GetProcId(data.handle), data.id); |
| 665 chrome_render_message_filter_->Send(reply_msg_); | 667 chrome_render_message_filter_->Send(reply_msg_); |
| 666 chrome_render_message_filter_ = NULL; | 668 chrome_render_message_filter_ = NULL; |
| 667 reply_msg_ = NULL; | 669 reply_msg_ = NULL; |
| 668 internal_->sockets_for_renderer.clear(); | 670 internal_->sockets_for_renderer.clear(); |
| 669 return true; | 671 return true; |
| 670 } | 672 } |
| 671 | 673 |
| 672 // TCP port we chose for NaCl debug stub. It can be any other number. | 674 // TCP port we chose for NaCl debug stub. It can be any other number. |
| 673 static const int kDebugStubPort = 4014; | 675 static const int kDebugStubPort = 4014; |
| 674 | 676 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 } else { | 931 } else { |
| 930 NaClStartDebugExceptionHandlerThread( | 932 NaClStartDebugExceptionHandlerThread( |
| 931 process_handle.Take(), info, | 933 process_handle.Take(), info, |
| 932 base::MessageLoopProxy::current(), | 934 base::MessageLoopProxy::current(), |
| 933 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 935 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 934 weak_factory_.GetWeakPtr())); | 936 weak_factory_.GetWeakPtr())); |
| 935 return true; | 937 return true; |
| 936 } | 938 } |
| 937 } | 939 } |
| 938 #endif | 940 #endif |
| OLD | NEW |