OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This is an application of a minimal host process in a Chromoting | 5 // This is an application of a minimal host process in a Chromoting |
6 // system. It serves the purpose of gluing different pieces together | 6 // system. It serves the purpose of gluing different pieces together |
7 // to make a functional host process for testing. | 7 // to make a functional host process for testing. |
8 // | 8 // |
9 // It peforms the following functionality: | 9 // It peforms the following functionality: |
10 // 1. Connect to the GTalk network and register the machine as a host. | 10 // 1. Connect to the GTalk network and register the machine as a host. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 CHECK(media::InitializeMediaLibrary(module_path)) | 124 CHECK(media::InitializeMediaLibrary(module_path)) |
125 << "Cannot load media library"; | 125 << "Cannot load media library"; |
126 | 126 |
127 // Construct a chromoting host. | 127 // Construct a chromoting host. |
128 scoped_refptr<ChromotingHost> host; | 128 scoped_refptr<ChromotingHost> host; |
129 | 129 |
130 bool fake = cmd_line->HasSwitch(kFakeSwitchName); | 130 bool fake = cmd_line->HasSwitch(kFakeSwitchName); |
131 if (fake) { | 131 if (fake) { |
132 remoting::Capturer* capturer = | 132 remoting::Capturer* capturer = |
133 new remoting::CapturerFake(); | 133 new remoting::CapturerFake(); |
134 remoting::protocol::InputStub* input_stub = | 134 remoting::EventExecutor* event_executor = |
135 CreateEventExecutor(context.ui_message_loop(), capturer); | 135 remoting::EventExecutor::Create(context.ui_message_loop(), capturer); |
136 remoting::Curtain* curtain = remoting::Curtain::Create(); | 136 remoting::Curtain* curtain = remoting::Curtain::Create(); |
137 host = ChromotingHost::Create( | 137 host = ChromotingHost::Create( |
138 &context, config, | 138 &context, config, |
139 new DesktopEnvironment(capturer, input_stub, curtain)); | 139 new DesktopEnvironment(capturer, event_executor, curtain)); |
140 } else { | 140 } else { |
141 host = ChromotingHost::Create(&context, config); | 141 host = ChromotingHost::Create(&context, config); |
142 } | 142 } |
143 | 143 |
144 if (cmd_line->HasSwitch(kVideoSwitchName)) { | 144 if (cmd_line->HasSwitch(kVideoSwitchName)) { |
145 string video_codec = cmd_line->GetSwitchValueASCII(kVideoSwitchName); | 145 string video_codec = cmd_line->GetSwitchValueASCII(kVideoSwitchName); |
146 scoped_ptr<CandidateSessionConfig> config( | 146 scoped_ptr<CandidateSessionConfig> config( |
147 CandidateSessionConfig::CreateDefault()); | 147 CandidateSessionConfig::CreateDefault()); |
148 config->mutable_video_configs()->clear(); | 148 config->mutable_video_configs()->clear(); |
149 | 149 |
(...skipping 24 matching lines...) Expand all Loading... |
174 | 174 |
175 // Let the chromoting host run until the shutdown task is executed. | 175 // Let the chromoting host run until the shutdown task is executed. |
176 host->Start(NewRunnableFunction(&ShutdownTask, &message_loop)); | 176 host->Start(NewRunnableFunction(&ShutdownTask, &message_loop)); |
177 message_loop.MessageLoop::Run(); | 177 message_loop.MessageLoop::Run(); |
178 | 178 |
179 // And then stop the chromoting context. | 179 // And then stop the chromoting context. |
180 context.Stop(); | 180 context.Stop(); |
181 file_io_thread.Stop(); | 181 file_io_thread.Stop(); |
182 return 0; | 182 return 0; |
183 } | 183 } |
OLD | NEW |