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_process_host.h" | 5 #include "components/nacl/browser/nacl_process_host.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "content/public/browser/zygote_handle_linux.h" | 70 #include "content/public/browser/zygote_handle_linux.h" |
71 #include "ipc/ipc_channel_posix.h" | 71 #include "ipc/ipc_channel_posix.h" |
72 #elif defined(OS_WIN) | 72 #elif defined(OS_WIN) |
73 #include <windows.h> | 73 #include <windows.h> |
74 #include <winsock2.h> | 74 #include <winsock2.h> |
75 | 75 |
76 #include "base/threading/thread.h" | 76 #include "base/threading/thread.h" |
77 #include "base/win/scoped_handle.h" | 77 #include "base/win/scoped_handle.h" |
78 #include "components/nacl/browser/nacl_broker_service_win.h" | 78 #include "components/nacl/browser/nacl_broker_service_win.h" |
79 #include "components/nacl/common/nacl_debug_exception_handler_win.h" | 79 #include "components/nacl/common/nacl_debug_exception_handler_win.h" |
| 80 #include "components/startup_metric_utils/common/pre_read_field_trial_utils_win.
h" |
80 #include "content/public/common/sandbox_init.h" | 81 #include "content/public/common/sandbox_init.h" |
81 #endif | 82 #endif |
82 | 83 |
83 using content::BrowserThread; | 84 using content::BrowserThread; |
84 using content::ChildProcessData; | 85 using content::ChildProcessData; |
85 using content::ChildProcessHost; | 86 using content::ChildProcessHost; |
86 using ppapi::proxy::SerializedHandle; | 87 using ppapi::proxy::SerializedHandle; |
87 | 88 |
88 namespace nacl { | 89 namespace nacl { |
89 | 90 |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 CopyNaClCommandLineArguments(cmd_line.get()); | 635 CopyNaClCommandLineArguments(cmd_line.get()); |
635 | 636 |
636 cmd_line->AppendSwitchASCII(switches::kProcessType, | 637 cmd_line->AppendSwitchASCII(switches::kProcessType, |
637 (uses_nonsfi_mode_ ? | 638 (uses_nonsfi_mode_ ? |
638 switches::kNaClLoaderNonSfiProcess : | 639 switches::kNaClLoaderNonSfiProcess : |
639 switches::kNaClLoaderProcess)); | 640 switches::kNaClLoaderProcess)); |
640 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 641 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
641 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) | 642 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) |
642 cmd_line->AppendSwitch(switches::kNoErrorDialogs); | 643 cmd_line->AppendSwitch(switches::kNoErrorDialogs); |
643 | 644 |
644 // On Windows we might need to start the broker process to launch a new loader | 645 #if defined(OS_WIN) |
| 646 if (startup_metric_utils::GetPreReadOptions().prefetch_argument) |
| 647 cmd_line->AppendArg(switches::kPrefetchArgumentOther); |
| 648 #endif // defined(OS_WIN) |
| 649 |
| 650 // On Windows we might need to start the broker process to launch a new loader |
645 #if defined(OS_WIN) | 651 #if defined(OS_WIN) |
646 if (RunningOnWOW64()) { | 652 if (RunningOnWOW64()) { |
647 if (!NaClBrokerService::GetInstance()->LaunchLoader( | 653 if (!NaClBrokerService::GetInstance()->LaunchLoader( |
648 weak_factory_.GetWeakPtr(), channel_id)) { | 654 weak_factory_.GetWeakPtr(), channel_id)) { |
649 SendErrorToRenderer("broker service did not launch process"); | 655 SendErrorToRenderer("broker service did not launch process"); |
650 return false; | 656 return false; |
651 } | 657 } |
652 return true; | 658 return true; |
653 } | 659 } |
654 #endif | 660 #endif |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 NaClStartDebugExceptionHandlerThread( | 1336 NaClStartDebugExceptionHandlerThread( |
1331 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), | 1337 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), |
1332 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1338 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
1333 weak_factory_.GetWeakPtr())); | 1339 weak_factory_.GetWeakPtr())); |
1334 return true; | 1340 return true; |
1335 } | 1341 } |
1336 } | 1342 } |
1337 #endif | 1343 #endif |
1338 | 1344 |
1339 } // namespace nacl | 1345 } // namespace nacl |
OLD | NEW |