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

Unified Diff: shell/app_child_process_host.h

Issue 1047333002: For the out-of-process NativeRunner, make sure that Start()'s callback always gets called. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | shell/app_child_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/app_child_process_host.h
diff --git a/shell/app_child_process_host.h b/shell/app_child_process_host.h
index b7e237f4b98e6961c40739540055f5abb95814b3..a7dba66c0e6c648f1b2c526dae7ccf3a68927b1d 100644
--- a/shell/app_child_process_host.h
+++ b/shell/app_child_process_host.h
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "mojo/edk/embedder/channel_info_forward.h"
+#include "mojo/public/cpp/bindings/error_handler.h"
#include "shell/app_child_process.mojom.h"
#include "shell/child_process_host.h"
@@ -20,22 +21,29 @@ namespace shell {
//
// Note: After |Start()|, |StartApp| must be called and this object must
// remained alive until the |on_app_complete| callback is called.
-class AppChildProcessHost : public ChildProcessHost {
+class AppChildProcessHost : public ChildProcessHost, public ErrorHandler {
public:
explicit AppChildProcessHost(Context* context);
~AppChildProcessHost() override;
- // See |AppChildController|:
+ // See |AppChildController::StartApp()| (this may only be called after
+ // |Start()|). Note, however, one difference: |on_app_complete| will *always*
+ // get called, even on connection error (or even if the child process failed
+ // to start at all).
void StartApp(const String& app_path,
bool clean_app_path,
InterfaceRequest<Application> application_request,
const AppChildController::StartAppCallback& on_app_complete);
+ // See |AppChildController::ExitNow()|.
void ExitNow(int32_t exit_code);
// |ChildProcessHost| methods:
void WillStart() override;
void DidStart(bool success) override;
+ // |ErrorHandler| methods:
+ void OnConnectionError() override;
+
private:
// Callback for |embedder::CreateChannel()|.
void DidCreateChannel(embedder::ChannelInfo* channel_info);
« no previous file with comments | « no previous file | shell/app_child_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698