REVIEW: destroy process singleton on sequence where IO is allowed
This commit is contained in:
parent
c3154d86e0
commit
88e53b1b5e
13 changed files with 90 additions and 110 deletions
|
@ -62,8 +62,7 @@ class ProcessSingleton {
|
|||
base::Callback<bool(const base::CommandLine::StringVector& command_line,
|
||||
const base::FilePath& current_directory)>;
|
||||
|
||||
ProcessSingleton(const base::FilePath& user_data_dir,
|
||||
const NotificationCallback& notification_callback);
|
||||
explicit ProcessSingleton(const base::FilePath& user_data_dir);
|
||||
~ProcessSingleton();
|
||||
|
||||
// Notify another process, if available. Otherwise sets ourselves as the
|
||||
|
@ -99,6 +98,11 @@ class ProcessSingleton {
|
|||
const ShouldKillRemoteProcessCallback& display_dialog_callback);
|
||||
#endif
|
||||
|
||||
void RegisterSingletonNotificationCallback(
|
||||
const NotificationCallback& callback) {
|
||||
notification_callback_ = callback;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Notify another process, if available.
|
||||
// Returns true if another process was found and notified, false if we should
|
||||
|
|
|
@ -716,11 +716,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ProcessSingleton
|
||||
//
|
||||
ProcessSingleton::ProcessSingleton(
|
||||
const base::FilePath& user_data_dir,
|
||||
const NotificationCallback& notification_callback)
|
||||
: notification_callback_(notification_callback),
|
||||
current_pid_(base::GetCurrentProcId()) {
|
||||
ProcessSingleton::ProcessSingleton(const base::FilePath& user_data_dir)
|
||||
: current_pid_(base::GetCurrentProcId()) {
|
||||
// The user_data_dir may have not been created yet.
|
||||
base::CreateDirectoryAndGetError(user_data_dir, nullptr);
|
||||
|
||||
|
|
|
@ -182,15 +182,11 @@ bool TerminateAppWithError() {
|
|||
|
||||
} // namespace
|
||||
|
||||
ProcessSingleton::ProcessSingleton(
|
||||
const base::FilePath& user_data_dir,
|
||||
const NotificationCallback& notification_callback)
|
||||
: notification_callback_(notification_callback),
|
||||
is_virtualized_(false),
|
||||
ProcessSingleton::ProcessSingleton(const base::FilePath& user_data_dir)
|
||||
: is_virtualized_(false),
|
||||
lock_file_(INVALID_HANDLE_VALUE),
|
||||
user_data_dir_(user_data_dir),
|
||||
should_kill_remote_process_callback_(
|
||||
base::Bind(&TerminateAppWithError)) {
|
||||
should_kill_remote_process_callback_(base::Bind(&TerminateAppWithError)) {
|
||||
// The user_data_dir may have not been created yet.
|
||||
base::CreateDirectoryAndGetError(user_data_dir, nullptr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue