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

Unified Diff: chrome/browser/process_singleton.h

Issue 981223004: Add test for ProcessSingleton hung rendezvous case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Scott's remaining comment. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_process_finder_win.cc ('k') | chrome/browser/process_singleton_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton.h
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h
index 64486881e5b0ab6b857b949f6298c334b682ad4e..3260c4ef240cc0c07574840777051a3c5ce44ef0 100644
--- a/chrome/browser/process_singleton.h
+++ b/chrome/browser/process_singleton.h
@@ -61,9 +61,9 @@ class ProcessSingleton : public base::NonThreadSafe {
// Chrome process was launched. Return true if the command line will be
// handled within the current browser instance or false if the remote process
// should handle it (i.e., because the current process is shutting down).
- typedef base::Callback<bool(
- const base::CommandLine& command_line,
- const base::FilePath& current_directory)> NotificationCallback;
+ using NotificationCallback =
+ base::Callback<bool(const base::CommandLine& command_line,
+ const base::FilePath& current_directory)>;
ProcessSingleton(const base::FilePath& user_data_dir,
const NotificationCallback& notification_callback);
@@ -92,6 +92,13 @@ class ProcessSingleton : public base::NonThreadSafe {
#if defined(OS_POSIX) && !defined(OS_ANDROID)
static void DisablePromptForTesting();
#endif
+#if defined(OS_WIN)
+ // Called to query whether to kill a hung browser process that has visible
+ // windows. Return true to allow killing the hung process.
+ using ShouldKillRemoteProcessCallback = base::Callback<bool()>;
+ void OverrideShouldKillRemoteProcessCallbackForTesting(
+ const ShouldKillRemoteProcessCallback& display_dialog_callback);
+#endif
protected:
// Notify another process, if available.
@@ -128,6 +135,7 @@ class ProcessSingleton : public base::NonThreadSafe {
bool is_virtualized_; // Stuck inside Microsoft Softricity VM environment.
HANDLE lock_file_;
base::FilePath user_data_dir_;
+ ShouldKillRemoteProcessCallback should_kill_remote_process_callback_;
#elif defined(OS_POSIX) && !defined(OS_ANDROID)
// Return true if the given pid is one of our child processes.
// Assumes that the current pid is the root of all pids of the current
« no previous file with comments | « chrome/browser/chrome_process_finder_win.cc ('k') | chrome/browser/process_singleton_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698