| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "remoting/host/it2me/it2me_native_messaging_host_main.h" | 5 #include "remoting/host/it2me/it2me_native_messaging_host_main.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/icu_util.h" | 9 #include "base/i18n/icu_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 base::MessageLoopForUI message_loop; | 114 base::MessageLoopForUI message_loop; |
| 115 base::RunLoop run_loop; | 115 base::RunLoop run_loop; |
| 116 | 116 |
| 117 scoped_ptr<It2MeHostFactory> factory(new It2MeHostFactory()); | 117 scoped_ptr<It2MeHostFactory> factory(new It2MeHostFactory()); |
| 118 | 118 |
| 119 scoped_ptr<NativeMessagingPipe> native_messaging_pipe( | 119 scoped_ptr<NativeMessagingPipe> native_messaging_pipe( |
| 120 new NativeMessagingPipe()); | 120 new NativeMessagingPipe()); |
| 121 | 121 |
| 122 // Set up the native messaging channel. | 122 // Set up the native messaging channel. |
| 123 scoped_ptr<extensions::NativeMessagingChannel> channel( | 123 scoped_ptr<extensions::NativeMessagingChannel> channel( |
| 124 new PipeMessagingChannel(read_file.Pass(), write_file.Pass())); | 124 new PipeMessagingChannel(std::move(read_file), std::move(write_file))); |
| 125 | 125 |
| 126 scoped_ptr<ChromotingHostContext> context = | 126 scoped_ptr<ChromotingHostContext> context = |
| 127 ChromotingHostContext::Create(new remoting::AutoThreadTaskRunner( | 127 ChromotingHostContext::Create(new remoting::AutoThreadTaskRunner( |
| 128 message_loop.task_runner(), run_loop.QuitClosure())); | 128 message_loop.task_runner(), run_loop.QuitClosure())); |
| 129 scoped_ptr<extensions::NativeMessageHost> host( | 129 scoped_ptr<extensions::NativeMessageHost> host( |
| 130 new It2MeNativeMessagingHost(context.Pass(), factory.Pass())); | 130 new It2MeNativeMessagingHost(std::move(context), std::move(factory))); |
| 131 | 131 |
| 132 host->Start(native_messaging_pipe.get()); | 132 host->Start(native_messaging_pipe.get()); |
| 133 | 133 |
| 134 native_messaging_pipe->Start(host.Pass(), channel.Pass()); | 134 native_messaging_pipe->Start(std::move(host), std::move(channel)); |
| 135 | 135 |
| 136 // Run the loop until channel is alive. | 136 // Run the loop until channel is alive. |
| 137 run_loop.Run(); | 137 run_loop.Run(); |
| 138 | 138 |
| 139 return kSuccessExitCode; | 139 return kSuccessExitCode; |
| 140 } | 140 } |
| 141 | 141 |
| 142 int It2MeNativeMessagingHostMain(int argc, char** argv) { | 142 int It2MeNativeMessagingHostMain(int argc, char** argv) { |
| 143 // This object instance is required by Chrome code (such as MessageLoop). | 143 // This object instance is required by Chrome code (such as MessageLoop). |
| 144 base::AtExitManager exit_manager; | 144 base::AtExitManager exit_manager; |
| 145 | 145 |
| 146 base::CommandLine::Init(argc, argv); | 146 base::CommandLine::Init(argc, argv); |
| 147 remoting::InitHostLogging(); | 147 remoting::InitHostLogging(); |
| 148 | 148 |
| 149 return StartIt2MeNativeMessagingHost(); | 149 return StartIt2MeNativeMessagingHost(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace remoting | 152 } // namespace remoting |
| OLD | NEW |