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

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

Issue 2075693002: Always use a /prefetch:# switch when launching a process on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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"
81 #include "content/public/common/sandbox_init.h" 80 #include "content/public/common/sandbox_init.h"
82 #endif 81 #endif
83 82
84 using content::BrowserThread; 83 using content::BrowserThread;
85 using content::ChildProcessData; 84 using content::ChildProcessData;
86 using content::ChildProcessHost; 85 using content::ChildProcessHost;
87 using ppapi::proxy::SerializedHandle; 86 using ppapi::proxy::SerializedHandle;
88 87
89 namespace nacl { 88 namespace nacl {
90 89
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 637
639 cmd_line->AppendSwitchASCII(switches::kProcessType, 638 cmd_line->AppendSwitchASCII(switches::kProcessType,
640 (uses_nonsfi_mode_ ? 639 (uses_nonsfi_mode_ ?
641 switches::kNaClLoaderNonSfiProcess : 640 switches::kNaClLoaderNonSfiProcess :
642 switches::kNaClLoaderProcess)); 641 switches::kNaClLoaderProcess));
643 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); 642 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
644 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) 643 if (NaClBrowser::GetDelegate()->DialogsAreSuppressed())
645 cmd_line->AppendSwitch(switches::kNoErrorDialogs); 644 cmd_line->AppendSwitch(switches::kNoErrorDialogs);
646 645
647 #if defined(OS_WIN) 646 #if defined(OS_WIN)
648 if (startup_metric_utils::GetPreReadOptions().use_prefetch_argument) 647 cmd_line->AppendArg(switches::kPrefetchArgumentOther);
649 cmd_line->AppendArg(switches::kPrefetchArgumentOther);
650 #endif // defined(OS_WIN) 648 #endif // defined(OS_WIN)
651 649
652 // On Windows we might need to start the broker process to launch a new loader 650 // On Windows we might need to start the broker process to launch a new loader
653 #if defined(OS_WIN) 651 #if defined(OS_WIN)
654 if (RunningOnWOW64()) { 652 if (RunningOnWOW64()) {
655 if (!NaClBrokerService::GetInstance()->LaunchLoader( 653 if (!NaClBrokerService::GetInstance()->LaunchLoader(
656 weak_factory_.GetWeakPtr(), channel_id)) { 654 weak_factory_.GetWeakPtr(), channel_id)) {
657 SendErrorToRenderer("broker service did not launch process"); 655 SendErrorToRenderer("broker service did not launch process");
658 return false; 656 return false;
659 } 657 }
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 NaClStartDebugExceptionHandlerThread( 1290 NaClStartDebugExceptionHandlerThread(
1293 std::move(process), info, base::ThreadTaskRunnerHandle::Get(), 1291 std::move(process), info, base::ThreadTaskRunnerHandle::Get(),
1294 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, 1292 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker,
1295 weak_factory_.GetWeakPtr())); 1293 weak_factory_.GetWeakPtr()));
1296 return true; 1294 return true;
1297 } 1295 }
1298 } 1296 }
1299 #endif 1297 #endif
1300 1298
1301 } // namespace nacl 1299 } // 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