Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: remoting/client/chromoting_client.cc

Issue 8495024: Access ChromotingHost::clients_ only on network thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/host/chromoting_host.h » ('j') | remoting/host/chromoting_host.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "remoting/client/chromoting_client.h" 5 #include "remoting/client/chromoting_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "remoting/client/chromoting_view.h" 8 #include "remoting/client/chromoting_view.h"
9 #include "remoting/client/client_context.h" 9 #include "remoting/client/client_context.h"
10 #include "remoting/client/input_handler.h" 10 #include "remoting/client/input_handler.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 void ChromotingClient::Stop(const base::Closure& shutdown_task) { 59 void ChromotingClient::Stop(const base::Closure& shutdown_task) {
60 if (!message_loop()->BelongsToCurrentThread()) { 60 if (!message_loop()->BelongsToCurrentThread()) {
61 message_loop()->PostTask( 61 message_loop()->PostTask(
62 FROM_HERE, base::Bind(&ChromotingClient::Stop, 62 FROM_HERE, base::Bind(&ChromotingClient::Stop,
63 base::Unretained(this), shutdown_task)); 63 base::Unretained(this), shutdown_task));
64 return; 64 return;
65 } 65 }
66 66
67 // Drop all pending packets.
68 while(!received_packets_.empty()) {
69 received_packets_.front().done.Run();
70 received_packets_.pop_front();
Wez 2011/11/09 02:32:22 This looks leaked from another CL?
Sergey Ulanov 2011/11/09 21:24:00 Yeah, it should be in a separate CL. I thought my
71 }
72
67 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected, 73 connection_->Disconnect(base::Bind(&ChromotingClient::OnDisconnected,
68 base::Unretained(this), shutdown_task)); 74 base::Unretained(this), shutdown_task));
69 } 75 }
70 76
71 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) { 77 void ChromotingClient::OnDisconnected(const base::Closure& shutdown_task) {
72 view_->TearDown(); 78 view_->TearDown();
73 79
74 shutdown_task.Run(); 80 shutdown_task.Run();
75 } 81 }
76 82
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 204 }
199 205
200 // Initialize the decoder. 206 // Initialize the decoder.
201 rectangle_decoder_->Initialize(connection_->config()); 207 rectangle_decoder_->Initialize(connection_->config());
202 208
203 // Schedule the input handler to process the event queue. 209 // Schedule the input handler to process the event queue.
204 input_handler_->Initialize(); 210 input_handler_->Initialize();
205 } 211 }
206 212
207 } // namespace remoting 213 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/chromoting_host.h » ('j') | remoting/host/chromoting_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698