Singleton must be created on request

The creation of singleton relies on the `userData` dir, which can be
changed by user, we have to ensure singleton uses the `userData` dir set
by user.
This commit is contained in:
Cheng Zhao 2018-01-03 18:59:12 +09:00
parent 0cce6b3d21
commit 952928dc79
7 changed files with 41 additions and 46 deletions

View file

@ -182,8 +182,11 @@ bool TerminateAppWithError() {
} // namespace
ProcessSingleton::ProcessSingleton(const base::FilePath& user_data_dir)
: is_virtualized_(false),
ProcessSingleton::ProcessSingleton(
const base::FilePath& user_data_dir,
const NotificationCallback& notification_callback)
: notification_callback_(notification_callback),
is_virtualized_(false),
lock_file_(INVALID_HANDLE_VALUE),
user_data_dir_(user_data_dir),
should_kill_remote_process_callback_(base::Bind(&TerminateAppWithError)) {