fix: create userData on requestSingleInstanceLock() if needed (#33559) (#33593)

* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
This commit is contained in:
trop[bot]
2022-04-04 17:57:52 +09:00
committed by GitHub
parent 85b8861a7f
commit bdff8837a7
4 changed files with 25 additions and 0 deletions

View File

@@ -1148,6 +1148,8 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
base::FilePath user_dir;
base::PathService::Get(chrome::DIR_USER_DATA, &user_dir);
// The user_dir may not have been created yet.
base::CreateDirectoryAndGetError(user_dir, nullptr);
auto cb = base::BindRepeating(&App::OnSecondInstance, base::Unretained(this));
auto wrapped_cb = base::BindRepeating(NotificationCallbackWrapper, cb);