| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <shlwapi.h> | 6 #include <shlwapi.h> |
| 7 | 7 |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 if (!dll_) | 228 if (!dll_) |
| 229 return chrome::RESULT_CODE_MISSING_DATA; | 229 return chrome::RESULT_CODE_MISSING_DATA; |
| 230 | 230 |
| 231 scoped_ptr<base::Environment> env(base::Environment::Create()); | 231 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 232 env->SetVar(chrome::kChromeVersionEnvVar, base::WideToUTF8(version)); | 232 env->SetVar(chrome::kChromeVersionEnvVar, base::WideToUTF8(version)); |
| 233 | 233 |
| 234 OnBeforeLaunch(process_type_, file); | 234 OnBeforeLaunch(process_type_, file); |
| 235 DLL_MAIN chrome_main = | 235 DLL_MAIN chrome_main = |
| 236 reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain")); | 236 reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain")); |
| 237 int rc = chrome_main(instance, &sandbox_info); | 237 int rc = chrome_main(instance, &sandbox_info); |
| 238 return OnBeforeExit(rc, file); | 238 rc = OnBeforeExit(rc, file); |
| 239 // Sandboxed processes close some system DLL handles after lockdown so ignore |
| 240 // EXCEPTION_INVALID_HANDLE generated on Windows 10 during shutdown of these |
| 241 // processes. |
| 242 // TODO(wfh): Check whether MS have fixed this in Win10 RTM. crbug.com/456193 |
| 243 if (base::win::GetVersion() >= base::win::VERSION_WIN10) |
| 244 breakpad::ConsumeInvalidHandleExceptions(); |
| 245 return rc; |
| 239 } | 246 } |
| 240 | 247 |
| 241 void MainDllLoader::RelaunchChromeBrowserWithNewCommandLineIfNeeded() { | 248 void MainDllLoader::RelaunchChromeBrowserWithNewCommandLineIfNeeded() { |
| 242 if (!dll_) | 249 if (!dll_) |
| 243 return; | 250 return; |
| 244 | 251 |
| 245 RelaunchChromeBrowserWithNewCommandLineIfNeededFunc relaunch_function = | 252 RelaunchChromeBrowserWithNewCommandLineIfNeededFunc relaunch_function = |
| 246 reinterpret_cast<RelaunchChromeBrowserWithNewCommandLineIfNeededFunc>( | 253 reinterpret_cast<RelaunchChromeBrowserWithNewCommandLineIfNeededFunc>( |
| 247 ::GetProcAddress(dll_, | 254 ::GetProcAddress(dll_, |
| 248 "RelaunchChromeBrowserWithNewCommandLineIfNeeded")); | 255 "RelaunchChromeBrowserWithNewCommandLineIfNeeded")); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 311 } |
| 305 }; | 312 }; |
| 306 | 313 |
| 307 MainDllLoader* MakeMainDllLoader() { | 314 MainDllLoader* MakeMainDllLoader() { |
| 308 #if defined(GOOGLE_CHROME_BUILD) | 315 #if defined(GOOGLE_CHROME_BUILD) |
| 309 return new ChromeDllLoader(); | 316 return new ChromeDllLoader(); |
| 310 #else | 317 #else |
| 311 return new ChromiumDllLoader(); | 318 return new ChromiumDllLoader(); |
| 312 #endif | 319 #endif |
| 313 } | 320 } |
| OLD | NEW |