| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 // Confirm that an explicit prefetch profile is used for all process types | 238 // Confirm that an explicit prefetch profile is used for all process types |
| 239 // except for the browser process. Any new process type will have to assign | 239 // except for the browser process. Any new process type will have to assign |
| 240 // itself a prefetch id. See kPrefetchArgument* constants in | 240 // itself a prefetch id. See kPrefetchArgument* constants in |
| 241 // content_switches.cc for details. | 241 // content_switches.cc for details. |
| 242 DCHECK(process_type.empty() || | 242 DCHECK(process_type.empty() || |
| 243 HasValidWindowsPrefetchArgument(*command_line)); | 243 HasValidWindowsPrefetchArgument(*command_line)); |
| 244 | 244 |
| 245 if (process_type == crash_reporter::switches::kCrashpadHandler) { | 245 if (process_type == crash_reporter::switches::kCrashpadHandler) { |
| 246 crash_reporter::SetupFallbackCrashHandling(*command_line); | 246 crash_reporter::SetupFallbackCrashHandling(*command_line); |
| 247 base::string16 user_data_dir = install_static::GetUserDataDirectory(); |
| 247 return crash_reporter::RunAsCrashpadHandler( | 248 return crash_reporter::RunAsCrashpadHandler( |
| 248 *base::CommandLine::ForCurrentProcess(), switches::kProcessType); | 249 *base::CommandLine::ForCurrentProcess(), base::FilePath(user_data_dir), |
| 250 switches::kProcessType, switches::kUserDataDir); |
| 249 } else if (process_type == crash_reporter::switches::kFallbackCrashHandler) { | 251 } else if (process_type == crash_reporter::switches::kFallbackCrashHandler) { |
| 250 return RunFallbackCrashHandler(*command_line); | 252 return RunFallbackCrashHandler(*command_line); |
| 251 } | 253 } |
| 252 | 254 |
| 253 const base::TimeTicks exe_entry_point_ticks = base::TimeTicks::Now(); | 255 const base::TimeTicks exe_entry_point_ticks = base::TimeTicks::Now(); |
| 254 | 256 |
| 255 // Signal Chrome Elf that Chrome has begun to start. | 257 // Signal Chrome Elf that Chrome has begun to start. |
| 256 SignalChromeElf(); | 258 SignalChromeElf(); |
| 257 | 259 |
| 258 // The exit manager is in charge of calling the dtors of singletons. | 260 // The exit manager is in charge of calling the dtors of singletons. |
| 259 base::AtExitManager exit_manager; | 261 base::AtExitManager exit_manager; |
| 260 | 262 |
| 261 EnableHighDPISupport(); | 263 EnableHighDPISupport(); |
| 262 | 264 |
| 263 if (AttemptFastNotify(*command_line)) | 265 if (AttemptFastNotify(*command_line)) |
| 264 return 0; | 266 return 0; |
| 265 | 267 |
| 266 RemoveAppCompatFlagsEntry(); | 268 RemoveAppCompatFlagsEntry(); |
| 267 | 269 |
| 268 // Load and launch the chrome dll. *Everything* happens inside. | 270 // Load and launch the chrome dll. *Everything* happens inside. |
| 269 VLOG(1) << "About to load main DLL."; | 271 VLOG(1) << "About to load main DLL."; |
| 270 MainDllLoader* loader = MakeMainDllLoader(); | 272 MainDllLoader* loader = MakeMainDllLoader(); |
| 271 int rc = loader->Launch(instance, exe_entry_point_ticks); | 273 int rc = loader->Launch(instance, exe_entry_point_ticks); |
| 272 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 274 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
| 273 delete loader; | 275 delete loader; |
| 274 return rc; | 276 return rc; |
| 275 } | 277 } |
| OLD | NEW |