chore: correct spelling of is_quitting in electron::Browser (#29948)

This commit is contained in:
David Sanders 2021-07-05 12:45:50 -07:00 committed by GitHub
parent 60366ad171
commit 6c251da201
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -78,11 +78,11 @@ void Browser::Focus(gin::Arguments* args) {
#endif #endif
void Browser::Quit() { void Browser::Quit() {
if (is_quiting_) if (is_quitting_)
return; return;
is_quiting_ = HandleBeforeQuit(); is_quitting_ = HandleBeforeQuit();
if (!is_quiting_) if (!is_quitting_)
return; return;
if (electron::WindowList::IsEmpty()) if (electron::WindowList::IsEmpty())
@ -100,7 +100,7 @@ void Browser::Exit(gin::Arguments* args) {
exit(code); exit(code);
} else { } else {
// Prepare to quit when all windows have been closed. // Prepare to quit when all windows have been closed.
is_quiting_ = true; is_quitting_ = true;
// Remember this caller so that we don't emit unrelated events. // Remember this caller so that we don't emit unrelated events.
is_exiting_ = true; is_exiting_ = true;
@ -121,7 +121,7 @@ void Browser::Shutdown() {
return; return;
is_shutdown_ = true; is_shutdown_ = true;
is_quiting_ = true; is_quitting_ = true;
for (BrowserObserver& observer : observers_) for (BrowserObserver& observer : observers_)
observer.OnQuit(); observer.OnQuit();
@ -242,7 +242,7 @@ void Browser::NotifyAndShutdown() {
observer.OnWillQuit(&prevent_default); observer.OnWillQuit(&prevent_default);
if (prevent_default) { if (prevent_default) {
is_quiting_ = false; is_quitting_ = false;
return; return;
} }
@ -258,16 +258,16 @@ bool Browser::HandleBeforeQuit() {
} }
void Browser::OnWindowCloseCancelled(NativeWindow* window) { void Browser::OnWindowCloseCancelled(NativeWindow* window) {
if (is_quiting_) if (is_quitting_)
// Once a beforeunload handler has prevented the closing, we think the quit // Once a beforeunload handler has prevented the closing, we think the quit
// is cancelled too. // is cancelled too.
is_quiting_ = false; is_quitting_ = false;
} }
void Browser::OnWindowAllClosed() { void Browser::OnWindowAllClosed() {
if (is_exiting_) { if (is_exiting_) {
Shutdown(); Shutdown();
} else if (is_quiting_) { } else if (is_quitting_) {
NotifyAndShutdown(); NotifyAndShutdown();
} else { } else {
for (BrowserObserver& observer : observers_) for (BrowserObserver& observer : observers_)

View file

@ -305,7 +305,7 @@ class Browser : public WindowListObserver {
#endif #endif
bool is_shutting_down() const { return is_shutdown_; } bool is_shutting_down() const { return is_shutdown_; }
bool is_quiting() const { return is_quiting_; } bool is_quitting() const { return is_quitting_; }
bool is_ready() const { return is_ready_; } bool is_ready() const { return is_ready_; }
v8::Local<v8::Value> WhenReady(v8::Isolate* isolate); v8::Local<v8::Value> WhenReady(v8::Isolate* isolate);
@ -322,7 +322,7 @@ class Browser : public WindowListObserver {
// Send the before-quit message and start closing windows. // Send the before-quit message and start closing windows.
bool HandleBeforeQuit(); bool HandleBeforeQuit();
bool is_quiting_ = false; bool is_quitting_ = false;
private: private:
// WindowListObserver implementations: // WindowListObserver implementations: