| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // A simple client implements a minimal Chromoting client and shows | 5 // A simple client implements a minimal Chromoting client and shows |
| 6 // network traffic for debugging. | 6 // network traffic for debugging. |
| 7 | 7 |
| 8 #include <iostream> | 8 #include <iostream> |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 << ", " << msg.height() << ")" << std::endl; | 79 << ", " << msg.height() << ")" << std::endl; |
| 80 } | 80 } |
| 81 | 81 |
| 82 void HandleBeginUpdateStreamMessage(HostMessage* host_msg) { | 82 void HandleBeginUpdateStreamMessage(HostMessage* host_msg) { |
| 83 const BeginUpdateStreamMessage& msg = host_msg->begin_update_stream(); | 83 const BeginUpdateStreamMessage& msg = host_msg->begin_update_stream(); |
| 84 std::cout << msg.GetTypeName() << std::endl; | 84 std::cout << msg.GetTypeName() << std::endl; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void HandleUpdateStreamPacketMessage(HostMessage* host_msg) { | 87 void HandleUpdateStreamPacketMessage(HostMessage* host_msg) { |
| 88 const UpdateStreamPacketMessage& msg = host_msg->update_stream_packet(); | 88 const UpdateStreamPacketMessage& msg = host_msg->update_stream_packet(); |
| 89 std::cout << "UpdateStreamPacket (" << msg.header().x() | 89 if (!msg.has_begin_rect()) |
| 90 << ", " << msg.header().y() << ") [" | 90 return; |
| 91 << msg.header().width() << " x " << msg.header().height() << "]" | 91 |
| 92 std::cout << "UpdateStreamPacket (" << msg.begin_rect().x() |
| 93 << ", " << msg.begin_rect().y() << ") [" |
| 94 << msg.begin_rect().width() << " x " |
| 95 << msg.begin_rect().height() << "]" |
| 92 << std::endl; | 96 << std::endl; |
| 93 } | 97 } |
| 94 | 98 |
| 95 void HandleEndUpdateStreamMessage(HostMessage* host_msg) { | 99 void HandleEndUpdateStreamMessage(HostMessage* host_msg) { |
| 96 const EndUpdateStreamMessage& msg = host_msg->end_update_stream(); | 100 const EndUpdateStreamMessage& msg = host_msg->end_update_stream(); |
| 97 std::cout << msg.GetTypeName() << std::endl; | 101 std::cout << msg.GetTypeName() << std::endl; |
| 98 } | 102 } |
| 99 | 103 |
| 100 // JingleClient::Callback interface. | 104 // JingleClient::Callback interface. |
| 101 void OnStateChange(JingleClient* client, JingleClient::State state) { | 105 void OnStateChange(JingleClient* client, JingleClient::State state) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Wait until the mainloop has been signaled to exit. | 139 // Wait until the mainloop has been signaled to exit. |
| 136 client_done.Wait(); | 140 client_done.Wait(); |
| 137 | 141 |
| 138 connection.Disconnect(); | 142 connection.Disconnect(); |
| 139 network_thread.message_loop()->PostTask(FROM_HERE, | 143 network_thread.message_loop()->PostTask(FROM_HERE, |
| 140 new MessageLoop::QuitTask()); | 144 new MessageLoop::QuitTask()); |
| 141 network_thread.Stop(); | 145 network_thread.Stop(); |
| 142 | 146 |
| 143 return 0; | 147 return 0; |
| 144 } | 148 } |
| OLD | NEW |