Add ApplicationDelegate::Quit()

This CL adds ApplicationDelegate::Quit(), which ApplicationImpl calls
before shutting down the main run loop. In this function, an
ApplicationDelegate should shut down anything that relies on the main
run loop being active.

R=eseidel@chromium.org, jamesr@chromium.org

Review URL: https://codereview.chromium.org/947253003
This commit is contained in:
Colin Blundell
2015-02-24 14:06:47 +01:00
parent da65a22fca
commit 04f7cb9a0b

View File

@@ -67,7 +67,7 @@ class SkyDebugger : public mojo::ApplicationDelegate,
if (request->relative_url == "/reload") {
Load(callback, url_);
} else if (request->relative_url == "/quit") {
Quit();
Exit();
} else if (request->relative_url == "/load") {
std::string url;
mojo::common::BlockingCopyToString(request->body.Pass(), &url);
@@ -118,7 +118,7 @@ class SkyDebugger : public mojo::ApplicationDelegate,
window_manager_->Embed(url_, nullptr, nullptr);
}
void Quit() {
void Exit() {
// TODO(eseidel): We should orderly shutdown once mojo can.
exit(0);
}