Move OnBrowserReady call to PreMainMessageLoopRun to account for timing issues on macOS
This commit is contained in:
parent
28900a9b63
commit
f928a399ae
3 changed files with 14 additions and 0 deletions
|
@ -522,6 +522,7 @@ App::App(v8::Isolate* isolate) {
|
|||
base::ProcessMetrics::CreateCurrentProcessMetrics()));
|
||||
app_metrics_[pid] = std::move(process_metric);
|
||||
Init(isolate);
|
||||
App::self_ = this;
|
||||
}
|
||||
|
||||
App::~App() {
|
||||
|
@ -532,6 +533,10 @@ App::~App() {
|
|||
content::BrowserChildProcessObserver::Remove(this);
|
||||
}
|
||||
|
||||
App* App::Get() {
|
||||
return App::self_;
|
||||
}
|
||||
|
||||
void App::OnBeforeQuit(bool* prevent_default) {
|
||||
*prevent_default = Emit("before-quit");
|
||||
}
|
||||
|
@ -577,7 +582,9 @@ void App::OnFinishLaunching(const base::DictionaryValue& launch_info) {
|
|||
media::AudioManager::SetGlobalAppName(Browser::Get()->GetName());
|
||||
#endif
|
||||
Emit("ready", launch_info);
|
||||
}
|
||||
|
||||
void App::PreMainMessageLoopRun() {
|
||||
if (process_singleton_) {
|
||||
process_singleton_->OnBrowserReady();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue