diff options
author | sky <sky@chromium.org> | 2016-03-21 14:12:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-21 21:14:00 +0000 |
commit | a50f9840749052fbdec087a304548217cc6fd00b (patch) | |
tree | 97a63d4c0af4422d58f5a56ac9d0895dfba8d547 /mash | |
parent | d1b5f3a6dc60c0d00e9eca6476e0c3bc0a773b3b (diff) | |
download | chromium_src-a50f9840749052fbdec087a304548217cc6fd00b.zip chromium_src-a50f9840749052fbdec087a304548217cc6fd00b.tar.gz chromium_src-a50f9840749052fbdec087a304548217cc6fd00b.tar.bz2 |
Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used
This was originally at https://codereview.chromium.org/1814223002/ , but Ben is out and
I need this for tests, so I'm taking over.
BUG=none
TEST=covered by tests
TBR=ben@chromium.org
R=ben@chromium.org
Review URL: https://codereview.chromium.org/1819063002
Cr-Commit-Position: refs/heads/master@{#382389}
Diffstat (limited to 'mash')
8 files changed, 6 insertions, 15 deletions
diff --git a/mash/browser_driver/browser_driver_application_delegate.cc b/mash/browser_driver/browser_driver_application_delegate.cc index d30225e..cc6bbdc 100644 --- a/mash/browser_driver/browser_driver_application_delegate.cc +++ b/mash/browser_driver/browser_driver_application_delegate.cc @@ -67,10 +67,10 @@ bool BrowserDriverApplicationDelegate::AcceptConnection( return true; } -void BrowserDriverApplicationDelegate::ShellConnectionLost() { +bool BrowserDriverApplicationDelegate::ShellConnectionLost() { // Prevent the code in AddAccelerators() from keeping this app alive. binding_.set_connection_error_handler(base::Bind(&DoNothing)); - base::MessageLoop::current()->QuitWhenIdle(); + return true; } void BrowserDriverApplicationDelegate::OnAccelerator( diff --git a/mash/browser_driver/browser_driver_application_delegate.h b/mash/browser_driver/browser_driver_application_delegate.h index f517a76..0c05779 100644 --- a/mash/browser_driver/browser_driver_application_delegate.h +++ b/mash/browser_driver/browser_driver_application_delegate.h @@ -31,7 +31,7 @@ class BrowserDriverApplicationDelegate : public mojo::ShellClient, void Initialize(mojo::Connector* connector, const mojo::Identity& identity, uint32_t id) override; bool AcceptConnection(mojo::Connection* connection) override; - void ShellConnectionLost() override; + bool ShellConnectionLost() override; // mus::mojom::AcceleratorHandler: void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) override; diff --git a/mash/example/window_type_launcher/window_type_launcher.cc b/mash/example/window_type_launcher/window_type_launcher.cc index 2628f03..0547e84 100644 --- a/mash/example/window_type_launcher/window_type_launcher.cc +++ b/mash/example/window_type_launcher/window_type_launcher.cc @@ -384,6 +384,7 @@ void WindowTypeLauncher::Initialize(mojo::Connector* connector, widget->Show(); } -void WindowTypeLauncher::ShellConnectionLost() { +bool WindowTypeLauncher::ShellConnectionLost() { base::MessageLoop::current()->QuitWhenIdle(); + return false; } diff --git a/mash/example/window_type_launcher/window_type_launcher.h b/mash/example/window_type_launcher/window_type_launcher.h index 4d5a266..fd05874 100644 --- a/mash/example/window_type_launcher/window_type_launcher.h +++ b/mash/example/window_type_launcher/window_type_launcher.h @@ -22,7 +22,7 @@ class WindowTypeLauncher : public mojo::ShellClient { // mojo::ShellClient: void Initialize(mojo::Connector* connector, const mojo::Identity& identity, uint32_t id) override; - void ShellConnectionLost() override; + bool ShellConnectionLost() override; scoped_ptr<views::AuraInit> aura_init_; diff --git a/mash/quick_launch/quick_launch_application.cc b/mash/quick_launch/quick_launch_application.cc index 0f505a8..2b2764b 100644 --- a/mash/quick_launch/quick_launch_application.cc +++ b/mash/quick_launch/quick_launch_application.cc @@ -106,9 +106,5 @@ bool QuickLaunchApplication::AcceptConnection(mojo::Connection* connection) { return true; } -void QuickLaunchApplication::ShellConnectionLost() { - base::MessageLoop::current()->QuitWhenIdle(); -} - } // namespace quick_launch } // namespace mash diff --git a/mash/quick_launch/quick_launch_application.h b/mash/quick_launch/quick_launch_application.h index 93d72b2..130a1dd 100644 --- a/mash/quick_launch/quick_launch_application.h +++ b/mash/quick_launch/quick_launch_application.h @@ -28,7 +28,6 @@ class QuickLaunchApplication : public mojo::ShellClient { const mojo::Identity& identity, uint32_t id) override; bool AcceptConnection(mojo::Connection* connection) override; - void ShellConnectionLost() override; mojo::TracingImpl tracing_; scoped_ptr<views::AuraInit> aura_init_; diff --git a/mash/wm/window_manager_application.cc b/mash/wm/window_manager_application.cc index 606de45..57fb884 100644 --- a/mash/wm/window_manager_application.cc +++ b/mash/wm/window_manager_application.cc @@ -127,10 +127,6 @@ bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { return true; } -void WindowManagerApplication::ShellConnectionLost() { - _exit(1); -} - void WindowManagerApplication::Create( mojo::Connection* connection, mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { diff --git a/mash/wm/window_manager_application.h b/mash/wm/window_manager_application.h index 5ca2725..b6cd495 100644 --- a/mash/wm/window_manager_application.h +++ b/mash/wm/window_manager_application.h @@ -90,7 +90,6 @@ class WindowManagerApplication void Initialize(mojo::Connector* connector, const mojo::Identity& identity, uint32_t id) override; bool AcceptConnection(mojo::Connection* connection) override; - void ShellConnectionLost() override; // InterfaceFactory<mash::wm::mojom::UserWindowController>: void Create(mojo::Connection* connection, |