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/rand_util.h" | 20 #include "base/rand_util.h" |
20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
22 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
23 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
24 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
25 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
26 #include "build/build_config.h" | 27 #include "build/build_config.h" |
27 #include "chrome/browser/nacl_host/nacl_browser.h" | 28 #include "chrome/browser/nacl_host/nacl_browser.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 weak_factory_.GetWeakPtr(), channel_id)) { | 540 weak_factory_.GetWeakPtr(), channel_id)) { |
540 SendErrorToRenderer("broker service did not launch process"); | 541 SendErrorToRenderer("broker service did not launch process"); |
541 return false; | 542 return false; |
542 } | 543 } |
543 } else { | 544 } else { |
544 process_->Launch(new NaClSandboxedProcessLauncherDelegate, | 545 process_->Launch(new NaClSandboxedProcessLauncherDelegate, |
545 cmd_line.release()); | 546 cmd_line.release()); |
546 } | 547 } |
547 #elif defined(OS_POSIX) | 548 #elif defined(OS_POSIX) |
548 process_->Launch(nacl_loader_prefix.empty(), // use_zygote | 549 process_->Launch(nacl_loader_prefix.empty(), // use_zygote |
549 base::EnvironmentVector(), | 550 base::EnvironmentMap(), |
550 cmd_line.release()); | 551 cmd_line.release()); |
551 #endif | 552 #endif |
552 | 553 |
553 return true; | 554 return true; |
554 } | 555 } |
555 | 556 |
556 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { | 557 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { |
557 bool handled = true; | 558 bool handled = true; |
558 IPC_BEGIN_MESSAGE_MAP(NaClProcessHost, msg) | 559 IPC_BEGIN_MESSAGE_MAP(NaClProcessHost, msg) |
559 IPC_MESSAGE_HANDLER(NaClProcessMsg_QueryKnownToValidate, | 560 IPC_MESSAGE_HANDLER(NaClProcessMsg_QueryKnownToValidate, |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 } else { | 1015 } else { |
1015 NaClStartDebugExceptionHandlerThread( | 1016 NaClStartDebugExceptionHandlerThread( |
1016 process_handle.Take(), info, | 1017 process_handle.Take(), info, |
1017 base::MessageLoopProxy::current(), | 1018 base::MessageLoopProxy::current(), |
1018 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1019 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
1019 weak_factory_.GetWeakPtr())); | 1020 weak_factory_.GetWeakPtr())); |
1020 return true; | 1021 return true; |
1021 } | 1022 } |
1022 } | 1023 } |
1023 #endif | 1024 #endif |
OLD | NEW |