| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/base_paths.h" | 6 #include "base/base_paths.h" |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 platform_channel_pair.PassServerHandle(); | 74 platform_channel_pair.PassServerHandle(); |
| 75 | 75 |
| 76 mojo::ScopedMessagePipeHandle handle(mojo::embedder::CreateChannel( | 76 mojo::ScopedMessagePipeHandle handle(mojo::embedder::CreateChannel( |
| 77 platform_channel.Pass(), | 77 platform_channel.Pass(), |
| 78 base::Bind(&TargetApplicationDelegate::DidCreateChannel, | 78 base::Bind(&TargetApplicationDelegate::DidCreateChannel, |
| 79 weak_factory_.GetWeakPtr()), | 79 weak_factory_.GetWeakPtr()), |
| 80 base::ThreadTaskRunnerHandle::Get())); | 80 base::ThreadTaskRunnerHandle::Get())); |
| 81 | 81 |
| 82 application_manager->CreateInstanceForHandle( | 82 application_manager->CreateInstanceForHandle( |
| 83 mojo::ScopedHandle(mojo::Handle(handle.release().value())), | 83 mojo::ScopedHandle(mojo::Handle(handle.release().value())), |
| 84 "exe:application_manager_apptest_target", | 84 "exe:application_manager_apptest_target"); |
| 85 "0"); | |
| 86 // Put the other end on the command line used to launch the target. | 85 // Put the other end on the command line used to launch the target. |
| 87 platform_channel_pair.PrepareToPassClientHandleToChildProcess( | 86 platform_channel_pair.PrepareToPassClientHandleToChildProcess( |
| 88 &child_command_line, &handle_passing_info); | 87 &child_command_line, &handle_passing_info); |
| 89 | 88 |
| 90 base::LaunchOptions options; | 89 base::LaunchOptions options; |
| 91 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
| 92 options.handles_to_inherit = &handle_passing_info; | 91 options.handles_to_inherit = &handle_passing_info; |
| 93 #elif defined(OS_POSIX) | 92 #elif defined(OS_POSIX) |
| 94 options.fds_to_remap = &handle_passing_info; | 93 options.fds_to_remap = &handle_passing_info; |
| 95 #endif | 94 #endif |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 126 |
| 128 int main(int argc, char** argv) { | 127 int main(int argc, char** argv) { |
| 129 base::AtExitManager at_exit; | 128 base::AtExitManager at_exit; |
| 130 base::CommandLine::Init(argc, argv); | 129 base::CommandLine::Init(argc, argv); |
| 131 | 130 |
| 132 mojo::runner::InitializeLogging(); | 131 mojo::runner::InitializeLogging(); |
| 133 | 132 |
| 134 TargetApplicationDelegate delegate; | 133 TargetApplicationDelegate delegate; |
| 135 return mojo::runner::TestNativeMain(&delegate); | 134 return mojo::runner::TestNativeMain(&delegate); |
| 136 } | 135 } |
| OLD | NEW |