Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <malloc.h> | 6 #include <malloc.h> |
| 7 #include <shellscalingapi.h> | 7 #include <shellscalingapi.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <tchar.h> | 9 #include <tchar.h> |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 | 200 |
| 201 #if !defined(WIN_CONSOLE_APP) | 201 #if !defined(WIN_CONSOLE_APP) |
| 202 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { | 202 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { |
| 203 #else | 203 #else |
| 204 int main() { | 204 int main() { |
| 205 HINSTANCE instance = GetModuleHandle(nullptr); | 205 HINSTANCE instance = GetModuleHandle(nullptr); |
| 206 #endif | 206 #endif |
| 207 install_static::InstallDetails::InitializeFromPrimaryModule( | 207 install_static::InstallDetails::InitializeFromPrimaryModule( |
| 208 chrome::kChromeElfDllName); | 208 chrome::kChromeElfDllName); |
| 209 | 209 |
| 210 #if defined(SYZYASAN) | |
| 211 // This is a temporary workaround for a race during startup with the | |
| 212 // syzyasan_rtl.dll. See https://crbug.com/675710. | |
| 213 HMODULE chrome_elf = GetModuleHandle(chrome::kChromeElfDllName); | |
|
Sigurður Ásgeirsson
2016/12/20 20:42:47
Stoopid question: why don't we simply link against
scottmg
2016/12/20 20:51:45
Yuck, I have no idea. We probably do here actually
| |
| 214 auto block_until_handler_started = reinterpret_cast<void (*)()>( | |
| 215 GetProcAddress(chrome_elf, "BlockUntilHandlerStartedImpl")); | |
| 216 block_until_handler_started(); | |
| 217 #endif // SYZYASAN | |
| 218 | |
| 210 // Initialize the CommandLine singleton from the environment. | 219 // Initialize the CommandLine singleton from the environment. |
| 211 base::CommandLine::Init(0, nullptr); | 220 base::CommandLine::Init(0, nullptr); |
| 212 const base::CommandLine* command_line = | 221 const base::CommandLine* command_line = |
| 213 base::CommandLine::ForCurrentProcess(); | 222 base::CommandLine::ForCurrentProcess(); |
| 214 | 223 |
| 215 const std::string process_type = | 224 const std::string process_type = |
| 216 command_line->GetSwitchValueASCII(switches::kProcessType); | 225 command_line->GetSwitchValueASCII(switches::kProcessType); |
| 217 | 226 |
| 218 // Confirm that an explicit prefetch profile is used for all process types | 227 // Confirm that an explicit prefetch profile is used for all process types |
| 219 // except for the browser process. Any new process type will have to assign | 228 // except for the browser process. Any new process type will have to assign |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 243 RemoveAppCompatFlagsEntry(); | 252 RemoveAppCompatFlagsEntry(); |
| 244 | 253 |
| 245 // Load and launch the chrome dll. *Everything* happens inside. | 254 // Load and launch the chrome dll. *Everything* happens inside. |
| 246 VLOG(1) << "About to load main DLL."; | 255 VLOG(1) << "About to load main DLL."; |
| 247 MainDllLoader* loader = MakeMainDllLoader(); | 256 MainDllLoader* loader = MakeMainDllLoader(); |
| 248 int rc = loader->Launch(instance, exe_entry_point_ticks); | 257 int rc = loader->Launch(instance, exe_entry_point_ticks); |
| 249 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 258 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
| 250 delete loader; | 259 delete loader; |
| 251 return rc; | 260 return rc; |
| 252 } | 261 } |
| OLD | NEW |