OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "mojo/shell/child_process.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" |
| 9 #include "mojo/edk/embedder/platform_channel_pair.h" |
| 10 #include "mojo/shell/app_child_process.h" |
| 11 #include "mojo/shell/switches.h" |
| 12 |
| 13 namespace mojo { |
| 14 namespace shell { |
| 15 |
| 16 ChildProcess::~ChildProcess() { |
| 17 } |
| 18 |
| 19 // static |
| 20 scoped_ptr<ChildProcess> ChildProcess::Create( |
| 21 const base::CommandLine& command_line) { |
| 22 if (!command_line.HasSwitch(switches::kChildProcess)) |
| 23 return scoped_ptr<ChildProcess>(); |
| 24 |
| 25 scoped_ptr<ChildProcess> rv(new AppChildProcess()); |
| 26 if (!rv) |
| 27 return nullptr; |
| 28 |
| 29 rv->platform_channel_ = |
| 30 embedder::PlatformChannelPair::PassClientHandleFromParentProcess( |
| 31 command_line); |
| 32 CHECK(rv->platform_channel_.is_valid()); |
| 33 return rv; |
| 34 } |
| 35 |
| 36 ChildProcess::ChildProcess() { |
| 37 } |
| 38 |
| 39 } // namespace shell |
| 40 } // namespace mojo |
OLD | NEW |