Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: shell/child_main.cc

Issue 1219683015: Convert //shell/... to use set_connection_error_handler() instead of set_error_handler(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « shell/application_manager/shell_impl.cc ('k') | shell/child_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/child_main.cc
diff --git a/shell/child_main.cc b/shell/child_main.cc
index 447a93918bd5042ace253a2ece0a0bc0b3f4aafd..05abbc6733f8b7b9adc3686ff11c83447493b36c 100644
--- a/shell/child_main.cc
+++ b/shell/child_main.cc
@@ -175,7 +175,7 @@ class AppContext : public mojo::embedder::SlaveProcessDelegate {
// ChildControllerImpl ---------------------------------------------------------
-class ChildControllerImpl : public ChildController, public mojo::ErrorHandler {
+class ChildControllerImpl : public ChildController {
public:
~ChildControllerImpl() override {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -210,14 +210,6 @@ class ChildControllerImpl : public ChildController, public mojo::ErrorHandler {
binding_.Bind(handle.Pass());
}
- // |mojo::ErrorHandler| methods:
- void OnConnectionError() override {
- // A connection error means the connection to the shell is lost. This is not
- // recoverable.
- LOG(ERROR) << "Connection error to the shell";
- _exit(1);
- }
-
// |ChildController| methods:
void StartApp(const mojo::String& app_path,
mojo::InterfaceRequest<mojo::Application> application_request,
@@ -243,7 +235,14 @@ class ChildControllerImpl : public ChildController, public mojo::ErrorHandler {
unblocker_(unblocker),
channel_info_(nullptr),
binding_(this) {
- binding_.set_error_handler(this);
+ binding_.set_connection_error_handler([this]() { OnConnectionError(); });
+ }
+
+ void OnConnectionError() {
+ // A connection error means the connection to the shell is lost. This is not
+ // recoverable.
+ LOG(ERROR) << "Connection error to the shell";
+ _exit(1);
}
// Callback for |mojo::embedder::ConnectToMaster()|.
« no previous file with comments | « shell/application_manager/shell_impl.cc ('k') | shell/child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698