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

Unified Diff: mojo/shell/runner/child/runner_connection.cc

Issue 1761153002: Replace ChildController with ShellClientFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@29binding
Patch Set: . Created 4 years, 10 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 | « mojo/shell/runner/child/child_controller.mojom ('k') | mojo/shell/runner/host/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/runner/child/runner_connection.cc
diff --git a/mojo/shell/runner/child/runner_connection.cc b/mojo/shell/runner/child/runner_connection.cc
index 900ee2c9da06c80467fea269876e284fcaeab130..659f519516bae07fd2e7755d6921a49caef2d58c 100644
--- a/mojo/shell/runner/child/runner_connection.cc
+++ b/mojo/shell/runner/child/runner_connection.cc
@@ -22,7 +22,7 @@
#include "mojo/edk/embedder/scoped_platform_handle.h"
#include "mojo/message_pump/message_pump_mojo.h"
#include "mojo/public/cpp/bindings/binding.h"
-#include "mojo/shell/runner/child/child_controller.mojom.h"
+#include "mojo/shell/public/interfaces/shell_client_factory.mojom.h"
#include "mojo/shell/runner/common/switches.h"
namespace mojo {
@@ -128,13 +128,10 @@ class RunnerConnectionImpl : public RunnerConnection {
DISALLOW_COPY_AND_ASSIGN(RunnerConnectionImpl);
};
-class ChildControllerImpl : public mojom::ChildController {
+class ChildControllerImpl : public mojom::ShellClientFactory {
public:
~ChildControllerImpl() override {
DCHECK(thread_checker_.CalledOnValidThread());
-
- // TODO(vtl): Pass in the result from |MainMain()|.
- on_app_complete_.Run(MOJO_RESULT_UNIMPLEMENTED);
}
// To be executed on the controller thread. Creates the |ChildController|,
@@ -167,7 +164,7 @@ class ChildControllerImpl : public mojom::ChildController {
DLOG(ERROR) << "Connection error to the shell.";
if (exit_on_error_) {
_exit(1);
- } else if (on_app_complete_.is_null()) {
+ } else {
// If we failed before we could even get a ShellClient request from the
// shell, signal failure to the RunnerConnection, as it's still blocking
// on a response.
@@ -177,22 +174,15 @@ class ChildControllerImpl : public mojom::ChildController {
}
}
- // |mojom::ChildController| methods:
- void StartApp(InterfaceRequest<mojom::ShellClient> request,
- const StartAppCallback& on_app_complete) override {
+ // |mojom::ShellClientFactory| methods:
+ void CreateShellClient(mojom::ShellClientRequest request,
+ const String& name) override {
DCHECK(thread_checker_.CalledOnValidThread());
-
- on_app_complete_ = on_app_complete;
unblocker_.Unblock(
base::Bind(&ChildControllerImpl::ReturnApplicationRequestOnMainThread,
callback_, base::Passed(&request)));
}
- void ExitNow(int32_t exit_code) override {
- DVLOG(2) << "ChildControllerImpl::ExitNow(" << exit_code << ")";
- _exit(exit_code);
- }
-
private:
ChildControllerImpl(RunnerConnectionImpl* connection,
const GotApplicationRequestCallback& callback,
@@ -214,9 +204,8 @@ class ChildControllerImpl : public mojom::ChildController {
RunnerConnectionImpl* const connection_;
GotApplicationRequestCallback callback_;
Blocker::Unblocker unblocker_;
- StartAppCallback on_app_complete_;
- Binding<ChildController> binding_;
+ Binding<mojom::ShellClientFactory> binding_;
bool exit_on_error_;
« no previous file with comments | « mojo/shell/runner/child/child_controller.mojom ('k') | mojo/shell/runner/host/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698