| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 options.fds_to_remap = &handle_passing_info; | 104 options.fds_to_remap = &handle_passing_info; |
| 105 #endif | 105 #endif |
| 106 target_ = base::LaunchProcess(child_command_line, options); | 106 target_ = base::LaunchProcess(child_command_line, options); |
| 107 DCHECK(target_.IsValid()); | 107 DCHECK(target_.IsValid()); |
| 108 receiver->SetPID(target_.Pid()); | 108 receiver->SetPID(target_.Pid()); |
| 109 mojo::edk::ChildProcessLaunched(target_.Handle(), | 109 mojo::edk::ChildProcessLaunched(target_.Handle(), |
| 110 platform_channel_pair.PassServerHandle()); | 110 platform_channel_pair.PassServerHandle()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 bool AcceptConnection(mojo::Connection* connection) override { | 113 bool AcceptConnection(mojo::Connection* connection) override { |
| 114 connection->AddService<Driver>(this); | 114 connection->AddInterface<Driver>(this); |
| 115 return true; | 115 return true; |
| 116 } | 116 } |
| 117 | 117 |
| 118 // mojo::InterfaceFactory<Driver>: | 118 // mojo::InterfaceFactory<Driver>: |
| 119 void Create(mojo::Connection* connection, | 119 void Create(mojo::Connection* connection, |
| 120 mojo::InterfaceRequest<Driver> request) override { | 120 mojo::InterfaceRequest<Driver> request) override { |
| 121 bindings_.AddBinding(this, std::move(request)); | 121 bindings_.AddBinding(this, std::move(request)); |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Driver: | 124 // Driver: |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 int main(int argc, char** argv) { | 170 int main(int argc, char** argv) { |
| 171 base::AtExitManager at_exit; | 171 base::AtExitManager at_exit; |
| 172 base::CommandLine::Init(argc, argv); | 172 base::CommandLine::Init(argc, argv); |
| 173 | 173 |
| 174 mojo::shell::InitializeLogging(); | 174 mojo::shell::InitializeLogging(); |
| 175 | 175 |
| 176 TargetApplicationDelegate delegate; | 176 TargetApplicationDelegate delegate; |
| 177 return mojo::shell::TestNativeMain(&delegate); | 177 return mojo::shell::TestNativeMain(&delegate); |
| 178 } | 178 } |
| OLD | NEW |