From 35f7270e84da5abb0f7895304a53d632efbbfe71 Mon Sep 17 00:00:00 2001 From: rockot Date: Sun, 13 Mar 2016 16:42:41 -0700 Subject: Remove ShellConnection::WaitForInitialize This changes ShellClient::Initialize to expect a response with an optional Connector request rather than a ConnectorPtr being passed in with the call. This allows clients to create their own Connector pipe and lazily connect it to the shell thus avoiding any practical need to wait for an Initialize message. Additionally: - Client instances no longer die on the first Connector pipe error: instead an Instance is kept alive by the shell as long as either the ShellClient pipe is connected OR any Connector pipes are connected. - ShellClientFactory endpoints are now strongly typed instead of being raw message pipe handles. - Some uses of MessagePumpMojo near other changes in this CL have been opportunistically removed. BUG=591742 Review URL: https://codereview.chromium.org/1793793002 Cr-Commit-Position: refs/heads/master@{#380909} --- mash/example/window_type_launcher/main.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'mash') diff --git a/mash/example/window_type_launcher/main.cc b/mash/example/window_type_launcher/main.cc index 3932a37..e0e178d 100644 --- a/mash/example/window_type_launcher/main.cc +++ b/mash/example/window_type_launcher/main.cc @@ -16,7 +16,6 @@ #include "mash/example/window_type_launcher/window_type_launcher.h" #include "mojo/edk/embedder/embedder.h" #include "mojo/edk/embedder/process_delegate.h" -#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/shell/public/cpp/shell_connection.h" #include "mojo/shell/public/interfaces/shell_client.mojom.h" #include "mojo/shell/runner/child/runner_connection.h" @@ -60,14 +59,13 @@ int main(int argc, char** argv) { CHECK(io_thread.StartWithOptions(io_thread_options)); mojo::edk::InitIPCSupport(&process_delegate, io_thread.task_runner().get()); + mojo::edk::SetParentPipeHandleFromCommandLine(); - mojo::shell::mojom::ShellClientRequest request; - scoped_ptr connection( - mojo::shell::RunnerConnection::ConnectToRunner( - &request, mojo::ScopedMessagePipeHandle())); - base::MessageLoop loop(mojo::common::MessagePumpMojo::Create()); + base::MessageLoop loop; WindowTypeLauncher delegate; - mojo::ShellConnection impl(&delegate, std::move(request)); + mojo::ShellConnection impl(&delegate); + scoped_ptr connection = + mojo::shell::RunnerConnection::Create(&impl); loop.Run(); mojo::edk::ShutdownIPCSupport(); -- cgit v1.1