| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/base_switches.h" | 11 #include "base/base_switches.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/process/launch.h" |
| 18 #include "base/process/process_iterator.h" | 19 #include "base/process/process_iterator.h" |
| 19 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
| 21 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 22 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 23 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 24 #include "base/win/windows_version.h" | 25 #include "base/win/windows_version.h" |
| 25 #include "build/build_config.h" | 26 #include "build/build_config.h" |
| 26 #include "chrome/browser/nacl_host/nacl_browser.h" | 27 #include "chrome/browser/nacl_host/nacl_browser.h" |
| 27 #include "chrome/browser/nacl_host/nacl_host_message_filter.h" | 28 #include "chrome/browser/nacl_host/nacl_host_message_filter.h" |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 weak_factory_.GetWeakPtr(), channel_id)) { | 470 weak_factory_.GetWeakPtr(), channel_id)) { |
| 470 SendErrorToRenderer("broker service did not launch process"); | 471 SendErrorToRenderer("broker service did not launch process"); |
| 471 return false; | 472 return false; |
| 472 } | 473 } |
| 473 } else { | 474 } else { |
| 474 process_->Launch(new NaClSandboxedProcessLauncherDelegate, | 475 process_->Launch(new NaClSandboxedProcessLauncherDelegate, |
| 475 cmd_line.release()); | 476 cmd_line.release()); |
| 476 } | 477 } |
| 477 #elif defined(OS_POSIX) | 478 #elif defined(OS_POSIX) |
| 478 process_->Launch(nacl_loader_prefix.empty(), // use_zygote | 479 process_->Launch(nacl_loader_prefix.empty(), // use_zygote |
| 479 base::EnvironmentVector(), | 480 base::EnvironmentMap(), |
| 480 cmd_line.release()); | 481 cmd_line.release()); |
| 481 #endif | 482 #endif |
| 482 | 483 |
| 483 return true; | 484 return true; |
| 484 } | 485 } |
| 485 | 486 |
| 486 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { | 487 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { |
| 487 bool handled = true; | 488 bool handled = true; |
| 488 IPC_BEGIN_MESSAGE_MAP(NaClProcessHost, msg) | 489 IPC_BEGIN_MESSAGE_MAP(NaClProcessHost, msg) |
| 489 IPC_MESSAGE_HANDLER(NaClProcessMsg_QueryKnownToValidate, | 490 IPC_MESSAGE_HANDLER(NaClProcessMsg_QueryKnownToValidate, |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 } else { | 946 } else { |
| 946 NaClStartDebugExceptionHandlerThread( | 947 NaClStartDebugExceptionHandlerThread( |
| 947 process_handle.Take(), info, | 948 process_handle.Take(), info, |
| 948 base::MessageLoopProxy::current(), | 949 base::MessageLoopProxy::current(), |
| 949 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 950 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 950 weak_factory_.GetWeakPtr())); | 951 weak_factory_.GetWeakPtr())); |
| 951 return true; | 952 return true; |
| 952 } | 953 } |
| 953 } | 954 } |
| 954 #endif | 955 #endif |
| OLD | NEW |