summaryrefslogtreecommitdiffstats
path: root/mash/example
diff options
context:
space:
mode:
authorjam <jam@chromium.org>2015-12-08 18:11:53 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-09 02:13:19 +0000
commit1288a4e108e23dd4200102dc8f47c10605f0b664 (patch)
tree8f0479e864a9c70e59cd19399f106dcdf3ab8ff8 /mash/example
parent88c24007f6dc13d7e9e6b249e734ba5b668e8023 (diff)
downloadchromium_src-1288a4e108e23dd4200102dc8f47c10605f0b664.zip
chromium_src-1288a4e108e23dd4200102dc8f47c10605f0b664.tar.gz
chromium_src-1288a4e108e23dd4200102dc8f47c10605f0b664.tar.bz2
Fix mojo:example_main.
To support the new Mojo EDK's Broker, we currently send a second pipe over the pipe that's passed on the command line. First, teach chrome to read that first just like mojo_runner processes do (patchset 1). Also ensure that child processes of the chrome browser process talk to the broker in the parent mojo_runner process. This is because there can only be one BrokerState that is used by all processes. BUG=563639 Review URL: https://codereview.chromium.org/1495113003 Cr-Commit-Position: refs/heads/master@{#363907}
Diffstat (limited to 'mash/example')
-rw-r--r--mash/example/window_type_launcher/main.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/mash/example/window_type_launcher/main.cc b/mash/example/window_type_launcher/main.cc
index 56941fc..d6b31fd 100644
--- a/mash/example/window_type_launcher/main.cc
+++ b/mash/example/window_type_launcher/main.cc
@@ -49,6 +49,7 @@ int main(int argc, char** argv) {
#endif
{
+ mojo::embedder::PreInitializeChildProcess();
mojo::embedder::Init();
ProcessDelegate process_delegate;
@@ -61,16 +62,14 @@ int main(int argc, char** argv) {
io_thread.task_runner().get(),
mojo::embedder::ScopedPlatformHandle());
+ mojo::InterfaceRequest<mojo::Application> application_request;
+ scoped_ptr<mojo::runner::RunnerConnection> connection(
+ mojo::runner::RunnerConnection::ConnectToRunner(
+ &application_request, mojo::ScopedMessagePipeHandle()));
base::MessageLoop loop(mojo::common::MessagePumpMojo::Create());
WindowTypeLauncher delegate;
- {
- mojo::InterfaceRequest<mojo::Application> application_request;
- scoped_ptr<mojo::runner::RunnerConnection> connection(
- mojo::runner::RunnerConnection::ConnectToRunner(
- &application_request, mojo::ScopedMessagePipeHandle()));
- mojo::ApplicationImpl impl(&delegate, application_request.Pass());
- loop.Run();
- }
+ mojo::ApplicationImpl impl(&delegate, application_request.Pass());
+ loop.Run();
mojo::embedder::ShutdownIPCSupport();
}