Fix app.makeSingleInstance hanging on posix systems

Wait for the IO thread to be a thing before attempting to listen on the socket

Fixes #9880
This commit is contained in:
Samuel Attard 2017-09-14 22:33:13 +10:00 committed by Cheng Zhao
parent fb6a4febb0
commit 28900a9b63
4 changed files with 35 additions and 6 deletions

View file

@ -74,6 +74,8 @@ class ProcessSingleton : public base::NonThreadSafe {
// TODO(brettw): Make the implementation of this method non-platform-specific
// by making Linux re-use the Windows implementation.
NotifyResult NotifyOtherProcessOrCreate();
void StartListeningOnSocket();
void OnBrowserReady();
// Sets ourself up as the singleton instance. Returns true on success. If
// false is returned, we are not the singleton instance and the caller must
@ -173,6 +175,8 @@ class ProcessSingleton : public base::NonThreadSafe {
// because it posts messages between threads.
class LinuxWatcher;
scoped_refptr<LinuxWatcher> watcher_;
int sock_;
bool listen_on_ready_ = false;
#endif
DISALLOW_COPY_AND_ASSIGN(ProcessSingleton);