| 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 "chrome/app/main_dll_loader_win.h" | 5 #include "chrome/app/main_dll_loader_win.h" |
| 6 | 6 |
| 7 #include <windows.h> // NOLINT | 7 #include <windows.h> // NOLINT |
| 8 #include <shlwapi.h> // NOLINT | 8 #include <shlwapi.h> // NOLINT |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <userenv.h> // NOLINT | 10 #include <userenv.h> // NOLINT |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 int OnBeforeExit(int return_code, const base::FilePath& dll_path) override; | 196 int OnBeforeExit(int return_code, const base::FilePath& dll_path) override; |
| 197 | 197 |
| 198 private: | 198 private: |
| 199 std::unique_ptr<ChromeWatcherClient> chrome_watcher_client_; | 199 std::unique_ptr<ChromeWatcherClient> chrome_watcher_client_; |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, | 202 void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, |
| 203 const base::FilePath& dll_path) { | 203 const base::FilePath& dll_path) { |
| 204 if (process_type.empty()) { | 204 if (process_type.empty()) { |
| 205 RecordDidRun(dll_path); | 205 RecordDidRun(dll_path); |
| 206 |
| 207 // Launch the watcher process. |
| 208 base::FilePath exe_path; |
| 209 if (PathService::Get(base::FILE_EXE, &exe_path)) { |
| 210 chrome_watcher_client_.reset(new ChromeWatcherClient( |
| 211 base::Bind(&GenerateChromeWatcherCommandLine, exe_path))); |
| 212 chrome_watcher_client_->LaunchWatcher(); |
| 213 } |
| 206 } else { | 214 } else { |
| 207 // Set non-browser processes up to be killed by the system after the browser | 215 // Set non-browser processes up to be killed by the system after the browser |
| 208 // goes away. The browser uses the default shutdown order, which is 0x280. | 216 // goes away. The browser uses the default shutdown order, which is 0x280. |
| 209 // Note that lower numbers here denote "kill later" and higher numbers mean | 217 // Note that lower numbers here denote "kill later" and higher numbers mean |
| 210 // "kill sooner". | 218 // "kill sooner". |
| 211 // This gets rid of most of those unsighly sad tabs on logout and shutdown. | 219 // This gets rid of most of those unsighly sad tabs on logout and shutdown. |
| 212 ::SetProcessShutdownParameters(0x280 - 1, SHUTDOWN_NORETRY); | 220 ::SetProcessShutdownParameters(0x280 - 1, SHUTDOWN_NORETRY); |
| 213 } | 221 } |
| 214 } | 222 } |
| 215 | 223 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 238 } | 246 } |
| 239 }; | 247 }; |
| 240 | 248 |
| 241 MainDllLoader* MakeMainDllLoader() { | 249 MainDllLoader* MakeMainDllLoader() { |
| 242 #if defined(GOOGLE_CHROME_BUILD) | 250 #if defined(GOOGLE_CHROME_BUILD) |
| 243 return new ChromeDllLoader(); | 251 return new ChromeDllLoader(); |
| 244 #else | 252 #else |
| 245 return new ChromiumDllLoader(); | 253 return new ChromiumDllLoader(); |
| 246 #endif | 254 #endif |
| 247 } | 255 } |
| OLD | NEW |