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 #include "remoting/client/chromoting_client.h" | 5 #include "remoting/client/chromoting_client.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "remoting/base/tracer.h" | 8 #include "remoting/base/tracer.h" |
9 #include "remoting/client/chromoting_view.h" | 9 #include "remoting/client/chromoting_view.h" |
10 #include "remoting/client/client_context.h" | 10 #include "remoting/client/client_context.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 received_messages_.pop_front(); | 124 received_messages_.pop_front(); |
125 message_being_processed_ = true; | 125 message_being_processed_ = true; |
126 | 126 |
127 // TODO(ajwong): Consider creating a macro similar to the IPC message | 127 // TODO(ajwong): Consider creating a macro similar to the IPC message |
128 // mappings. Also reconsider the lifetime of the message object. | 128 // mappings. Also reconsider the lifetime of the message object. |
129 if (msg->has_init_client()) { | 129 if (msg->has_init_client()) { |
130 ScopedTracer tracer("Handle Init Client"); | 130 ScopedTracer tracer("Handle Init Client"); |
131 // TODO(ajwong): Change this to use a done callback. | 131 // TODO(ajwong): Change this to use a done callback. |
132 InitClient(msg->init_client(), | 132 InitClient(msg->init_client(), |
133 NewTracedMethod(this, &ChromotingClient::OnMessageDone, msg)); | 133 NewTracedMethod(this, &ChromotingClient::OnMessageDone, msg)); |
134 } else if (msg->has_video_packet()) { | 134 } else if (msg->has_rectangle_update()) { |
135 ScopedTracer tracer("Handle Rectangle Update"); | 135 ScopedTracer tracer("Handle Rectangle Update"); |
136 rectangle_decoder_->DecodePacket( | 136 rectangle_decoder_->DecodePacket( |
137 msg->video_packet(), | 137 msg->rectangle_update(), |
138 NewTracedMethod(this, &ChromotingClient::OnMessageDone, msg)); | 138 NewTracedMethod(this, &ChromotingClient::OnMessageDone, msg)); |
139 } else { | 139 } else { |
140 NOTREACHED() << "Unknown message received"; | 140 NOTREACHED() << "Unknown message received"; |
141 | 141 |
142 // We have an unknown message. Drop it, and schedule another dispatch. | 142 // We have an unknown message. Drop it, and schedule another dispatch. |
143 // Call DispatchMessage as a continuation to avoid growing the stack. | 143 // Call DispatchMessage as a continuation to avoid growing the stack. |
144 delete msg; | 144 delete msg; |
145 message_being_processed_ = false; | 145 message_being_processed_ = false; |
146 message_loop()->PostTask( | 146 message_loop()->PostTask( |
147 FROM_HERE, | 147 FROM_HERE, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 view_->SetViewport(0, 0, width, height); | 216 view_->SetViewport(0, 0, width, height); |
217 | 217 |
218 // Schedule the input handler to process the event queue. | 218 // Schedule the input handler to process the event queue. |
219 input_handler_->Initialize(); | 219 input_handler_->Initialize(); |
220 | 220 |
221 done->Run(); | 221 done->Run(); |
222 delete done; | 222 delete done; |
223 } | 223 } |
224 | 224 |
225 } // namespace remoting | 225 } // namespace remoting |
OLD | NEW |