mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
At Browser ctor time, DIR_USER_DATA is unset, wait
This commit is contained in:
@@ -21,16 +21,6 @@ Browser::Browser()
|
||||
is_ready_(false),
|
||||
is_shutdown_(false),
|
||||
process_notify_callback_(NULL) {
|
||||
base::FilePath userDir;
|
||||
PathService::Get(brightray::DIR_USER_DATA, &userDir);
|
||||
|
||||
auto no_refcount_this = base::Unretained(this);
|
||||
process_singleton_.reset(new AtomProcessSingleton(
|
||||
userDir,
|
||||
base::Bind(&Browser::OnProcessSingletonNotification, no_refcount_this)));
|
||||
|
||||
process_notify_result_ = process_singleton_->NotifyOtherProcessOrCreate();
|
||||
|
||||
WindowList::AddObserver(this);
|
||||
}
|
||||
|
||||
@@ -122,6 +112,17 @@ void Browser::Activate(bool has_visible_windows) {
|
||||
}
|
||||
|
||||
void Browser::WillFinishLaunching() {
|
||||
base::FilePath userDir;
|
||||
PathService::Get(brightray::DIR_USER_DATA, &userDir);
|
||||
|
||||
auto no_refcount_this = base::Unretained(this);
|
||||
process_singleton_.reset(new AtomProcessSingleton(
|
||||
userDir,
|
||||
base::Bind(&Browser::OnProcessSingletonNotification, no_refcount_this)));
|
||||
|
||||
LOG(ERROR) << "Setting up Process Singleton: " << userDir.value();
|
||||
process_notify_result_ = process_singleton_->NotifyOtherProcessOrCreate();
|
||||
|
||||
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWillFinishLaunching());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user