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

Side by Side Diff: chrome/app/main_dll_loader_win.cc

Issue 1543803005: Added an integration test for kasko hang reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better documentation for RunTest() Created 4 years, 11 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 <windows.h> // NOLINT 5 #include <windows.h> // NOLINT
6 #include <shlwapi.h> // NOLINT 6 #include <shlwapi.h> // NOLINT
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <userenv.h> // NOLINT 8 #include <userenv.h> // NOLINT
9 9
10 #include "chrome/app/main_dll_loader_win.h" 10 #include "chrome/app/main_dll_loader_win.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 base::win::ScopedHandle parent_process; 222 base::win::ScopedHandle parent_process;
223 base::win::ScopedHandle on_initialized_event; 223 base::win::ScopedHandle on_initialized_event;
224 DWORD main_thread_id = 0; 224 DWORD main_thread_id = 0;
225 if (!InterpretChromeWatcherCommandLine(cmd_line, &parent_process, 225 if (!InterpretChromeWatcherCommandLine(cmd_line, &parent_process,
226 &main_thread_id, 226 &main_thread_id,
227 &on_initialized_event)) { 227 &on_initialized_event)) {
228 return chrome::RESULT_CODE_UNSUPPORTED_PARAM; 228 return chrome::RESULT_CODE_UNSUPPORTED_PARAM;
229 } 229 }
230 230
231 base::FilePath default_user_data_directory;
jam 2016/01/26 23:08:35 why is this code removed?
Patrick Monette 2016/01/27 17:52:03 The user data directory was used by the hang watch
232 if (!PathService::Get(chrome::DIR_USER_DATA, &default_user_data_directory))
233 return chrome::RESULT_CODE_MISSING_DATA;
234 // The actual user data directory may differ from the default according to
235 // policy and command-line arguments evaluated in the browser process.
236 // The hang monitor will simply be disabled if a window with this name is
237 // never instantiated by the browser process. Since this should be
238 // exceptionally rare it should not impact stability efforts.
239 base::string16 message_window_name = default_user_data_directory.value();
240
241 base::FilePath watcher_data_directory; 231 base::FilePath watcher_data_directory;
242 if (!PathService::Get(chrome::DIR_WATCHER_DATA, &watcher_data_directory)) 232 if (!PathService::Get(chrome::DIR_WATCHER_DATA, &watcher_data_directory))
243 return chrome::RESULT_CODE_MISSING_DATA; 233 return chrome::RESULT_CODE_MISSING_DATA;
244 234
245 base::string16 channel_name = GoogleUpdateSettings::GetChromeChannel( 235 base::string16 channel_name = GoogleUpdateSettings::GetChromeChannel(
246 !InstallUtil::IsPerUserInstall(cmd_line.GetProgram())); 236 !InstallUtil::IsPerUserInstall(cmd_line.GetProgram()));
247 237
248 // Intentionally leaked. 238 // Intentionally leaked.
249 HMODULE watcher_dll = Load(&version, &file); 239 HMODULE watcher_dll = Load(&version, &file);
250 if (!watcher_dll) 240 if (!watcher_dll)
251 return chrome::RESULT_CODE_MISSING_DATA; 241 return chrome::RESULT_CODE_MISSING_DATA;
252 242
253 ChromeWatcherMainFunction watcher_main = 243 ChromeWatcherMainFunction watcher_main =
254 reinterpret_cast<ChromeWatcherMainFunction>( 244 reinterpret_cast<ChromeWatcherMainFunction>(
255 ::GetProcAddress(watcher_dll, kChromeWatcherDLLEntrypoint)); 245 ::GetProcAddress(watcher_dll, kChromeWatcherDLLEntrypoint));
256 return watcher_main(chrome::kBrowserExitCodesRegistryPath, 246 return watcher_main(
257 parent_process.Take(), main_thread_id, 247 chrome::kBrowserExitCodesRegistryPath, parent_process.Take(),
258 on_initialized_event.Take(), 248 main_thread_id, on_initialized_event.Take(),
259 watcher_data_directory.value().c_str(), 249 watcher_data_directory.value().c_str(), channel_name.c_str());
260 message_window_name.c_str(), channel_name.c_str());
261 } 250 }
262 251
263 // Initialize the sandbox services. 252 // Initialize the sandbox services.
264 sandbox::SandboxInterfaceInfo sandbox_info = {0}; 253 sandbox::SandboxInterfaceInfo sandbox_info = {0};
265 content::InitializeSandboxInfo(&sandbox_info); 254 content::InitializeSandboxInfo(&sandbox_info);
266 255
267 dll_ = Load(&version, &file); 256 dll_ = Load(&version, &file);
268 if (!dll_) 257 if (!dll_)
269 return chrome::RESULT_CODE_MISSING_DATA; 258 return chrome::RESULT_CODE_MISSING_DATA;
270 259
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 379 }
391 }; 380 };
392 381
393 MainDllLoader* MakeMainDllLoader() { 382 MainDllLoader* MakeMainDllLoader() {
394 #if defined(GOOGLE_CHROME_BUILD) 383 #if defined(GOOGLE_CHROME_BUILD)
395 return new ChromeDllLoader(); 384 return new ChromeDllLoader();
396 #else 385 #else
397 return new ChromiumDllLoader(); 386 return new ChromiumDllLoader();
398 #endif 387 #endif
399 } 388 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698