Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: components/nacl/browser/nacl_process_host.cc

Issue 1612663002: Use a valid /prefetch argument when launching a process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bit
Patch Set: rebase + prefetch argument for crashpad Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 CopyNaClCommandLineArguments(cmd_line.get()); 637 CopyNaClCommandLineArguments(cmd_line.get());
637 638
638 cmd_line->AppendSwitchASCII(switches::kProcessType, 639 cmd_line->AppendSwitchASCII(switches::kProcessType,
639 (uses_nonsfi_mode_ ? 640 (uses_nonsfi_mode_ ?
640 switches::kNaClLoaderNonSfiProcess : 641 switches::kNaClLoaderNonSfiProcess :
641 switches::kNaClLoaderProcess)); 642 switches::kNaClLoaderProcess));
642 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); 643 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
643 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) 644 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed())
644 cmd_line->AppendSwitch(switches::kNoErrorDialogs); 645 cmd_line->AppendSwitch(switches::kNoErrorDialogs);
645 646
646 // On Windows we might need to start the broker process to launch a new loader 647 #if defined(OS_WIN)
648 if (startup_metric_utils::GetPreReadOptions().use_prefetch_argument)
649 cmd_line->AppendArg(switches::kPrefetchArgumentOther);
650 #endif // defined(OS_WIN)
651
652 // On Windows we might need to start the broker process to launch a new loader
647 #if defined(OS_WIN) 653 #if defined(OS_WIN)
648 if (RunningOnWOW64()) { 654 if (RunningOnWOW64()) {
649 if (!NaClBrokerService::GetInstance()->LaunchLoader( 655 if (!NaClBrokerService::GetInstance()->LaunchLoader(
650 weak_factory_.GetWeakPtr(), channel_id)) { 656 weak_factory_.GetWeakPtr(), channel_id)) {
651 SendErrorToRenderer("broker service did not launch process"); 657 SendErrorToRenderer("broker service did not launch process");
652 return false; 658 return false;
653 } 659 }
654 return true; 660 return true;
655 } 661 }
656 #endif 662 #endif
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 NaClStartDebugExceptionHandlerThread( 1338 NaClStartDebugExceptionHandlerThread(
1333 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), 1339 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(),
1334 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, 1340 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker,
1335 weak_factory_.GetWeakPtr())); 1341 weak_factory_.GetWeakPtr()));
1336 return true; 1342 return true;
1337 } 1343 }
1338 } 1344 }
1339 #endif 1345 #endif
1340 1346
1341 } // namespace nacl 1347 } // namespace nacl
OLDNEW
« no previous file with comments | « components/nacl/browser/DEPS ('k') | components/startup_metric_utils/common/pre_read_field_trial_utils_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698