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 18 matching lines...) Expand all Loading... |
29 #include "base/threading/thread.h" | 29 #include "base/threading/thread.h" |
30 #include "crypto/nss_util.h" | 30 #include "crypto/nss_util.h" |
31 #include "media/base/media.h" | 31 #include "media/base/media.h" |
32 #include "remoting/base/tracer.h" | 32 #include "remoting/base/tracer.h" |
33 #include "remoting/host/capturer_fake.h" | 33 #include "remoting/host/capturer_fake.h" |
34 #include "remoting/host/chromoting_host.h" | 34 #include "remoting/host/chromoting_host.h" |
35 #include "remoting/host/chromoting_host_context.h" | 35 #include "remoting/host/chromoting_host_context.h" |
36 #include "remoting/host/curtain.h" | 36 #include "remoting/host/curtain.h" |
37 #include "remoting/host/desktop_environment.h" | 37 #include "remoting/host/desktop_environment.h" |
38 #include "remoting/host/event_executor.h" | 38 #include "remoting/host/event_executor.h" |
| 39 #include "remoting/host/heartbeat_sender.h" |
39 #include "remoting/host/json_host_config.h" | 40 #include "remoting/host/json_host_config.h" |
40 #include "remoting/proto/video.pb.h" | 41 #include "remoting/proto/video.pb.h" |
41 | 42 |
42 #if defined(TOOLKIT_USES_GTK) | 43 #if defined(TOOLKIT_USES_GTK) |
43 #include "ui/gfx/gtk_util.h" | 44 #include "ui/gfx/gtk_util.h" |
44 #endif | 45 #endif |
45 | 46 |
46 using remoting::ChromotingHost; | 47 using remoting::ChromotingHost; |
47 using remoting::DesktopEnvironment; | 48 using remoting::DesktopEnvironment; |
48 using remoting::protocol::CandidateSessionConfig; | 49 using remoting::protocol::CandidateSessionConfig; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 166 } |
166 config->mutable_video_configs()->push_back(ChannelConfig( | 167 config->mutable_video_configs()->push_back(ChannelConfig( |
167 transport, remoting::protocol::kDefaultStreamVersion, codec)); | 168 transport, remoting::protocol::kDefaultStreamVersion, codec)); |
168 host->set_protocol_config(config.release()); | 169 host->set_protocol_config(config.release()); |
169 } | 170 } |
170 | 171 |
171 #if defined(OS_MACOSX) | 172 #if defined(OS_MACOSX) |
172 mock_cr_app::RegisterMockCrApp(); | 173 mock_cr_app::RegisterMockCrApp(); |
173 #endif // OS_MACOSX | 174 #endif // OS_MACOSX |
174 | 175 |
| 176 // Initialize HeartbeatSender. |
| 177 scoped_refptr<remoting::HeartbeatSender> heartbeat_sender = |
| 178 new remoting::HeartbeatSender(context.network_message_loop(), config); |
| 179 if (!heartbeat_sender->Init()) |
| 180 return 1; |
| 181 host->AddStatusObserver(heartbeat_sender); |
| 182 |
175 // Let the chromoting host run until the shutdown task is executed. | 183 // Let the chromoting host run until the shutdown task is executed. |
176 host->Start(NewRunnableFunction(&ShutdownTask, &message_loop)); | 184 host->Start(NewRunnableFunction(&ShutdownTask, &message_loop)); |
177 message_loop.MessageLoop::Run(); | 185 message_loop.MessageLoop::Run(); |
178 | 186 |
179 // And then stop the chromoting context. | 187 // And then stop the chromoting context. |
180 context.Stop(); | 188 context.Stop(); |
181 file_io_thread.Stop(); | 189 file_io_thread.Stop(); |
182 return 0; | 190 return 0; |
183 } | 191 } |
OLD | NEW |