|
@@ -277,14 +277,6 @@ int ElectronBrowserMainParts::GetExitCode() {
|
|
|
return exit_code_ != nullptr ? *exit_code_ : 0;
|
|
|
}
|
|
|
|
|
|
-void ElectronBrowserMainParts::RegisterDestructionCallback(
|
|
|
- base::OnceClosure callback) {
|
|
|
- // The destructors should be called in reversed order, so dependencies between
|
|
|
- // JavaScript objects can be correctly resolved.
|
|
|
- // For example WebContentsView => WebContents => Session.
|
|
|
- destructors_.insert(destructors_.begin(), std::move(callback));
|
|
|
-}
|
|
|
-
|
|
|
int ElectronBrowserMainParts::PreEarlyInitialization() {
|
|
|
field_trial_list_ = std::make_unique<base::FieldTrialList>(nullptr);
|
|
|
#if defined(USE_X11)
|
|
@@ -577,18 +569,6 @@ void ElectronBrowserMainParts::PostMainMessageLoopRun() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Make sure destruction callbacks are called before message loop is
|
|
|
- // destroyed, otherwise some objects that need to be deleted on IO thread
|
|
|
- // won't be freed.
|
|
|
- // We don't use ranged for loop because iterators are getting invalided when
|
|
|
- // the callback runs.
|
|
|
- for (auto iter = destructors_.begin(); iter != destructors_.end();) {
|
|
|
- base::OnceClosure callback = std::move(*iter);
|
|
|
- if (!callback.is_null())
|
|
|
- std::move(callback).Run();
|
|
|
- ++iter;
|
|
|
- }
|
|
|
-
|
|
|
// Destroy node platform after all destructors_ are executed, as they may
|
|
|
// invoke Node/V8 APIs inside them.
|
|
|
node_debugger_->Stop();
|