OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/host/session_event_executor_win.h" | 5 #include "remoting/host/session_event_executor_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // Connect to the Chromoting IPC channel if the name was passed in the command | 92 // Connect to the Chromoting IPC channel if the name was passed in the command |
93 // line. | 93 // line. |
94 if (!channel_name.empty()) { | 94 if (!channel_name.empty()) { |
95 chromoting_channel_.reset(new IPC::ChannelProxy( | 95 chromoting_channel_.reset(new IPC::ChannelProxy( |
96 channel_name, IPC::Channel::MODE_CLIENT, this, io_task_runner)); | 96 channel_name, IPC::Channel::MODE_CLIENT, this, io_task_runner)); |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 SessionEventExecutorWin::~SessionEventExecutorWin() { | 100 SessionEventExecutorWin::~SessionEventExecutorWin() { |
101 DCHECK(task_runner_->BelongsToCurrentThread()); | |
102 } | 101 } |
103 | 102 |
104 void SessionEventExecutorWin::OnSessionStarted( | 103 void SessionEventExecutorWin::OnSessionStarted( |
105 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 104 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
106 if (!task_runner_->BelongsToCurrentThread()) { | 105 if (!task_runner_->BelongsToCurrentThread()) { |
107 task_runner_->PostTask( | 106 task_runner_->PostTask( |
108 FROM_HERE, | 107 FROM_HERE, |
109 base::Bind(&SessionEventExecutorWin::OnSessionStarted, | 108 base::Bind(&SessionEventExecutorWin::OnSessionStarted, |
110 weak_ptr_, base::Passed(&client_clipboard))); | 109 weak_ptr_, base::Passed(&client_clipboard))); |
111 return; | 110 return; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // one. | 196 // one. |
198 scoped_ptr<Desktop> input_desktop = Desktop::GetInputDesktop(); | 197 scoped_ptr<Desktop> input_desktop = Desktop::GetInputDesktop(); |
199 if (input_desktop.get() != NULL && !desktop_.IsSame(*input_desktop)) { | 198 if (input_desktop.get() != NULL && !desktop_.IsSame(*input_desktop)) { |
200 // If SetThreadDesktop() fails, the thread is still assigned a desktop. | 199 // If SetThreadDesktop() fails, the thread is still assigned a desktop. |
201 // So we can continue capture screen bits, just from a diffected desktop. | 200 // So we can continue capture screen bits, just from a diffected desktop. |
202 desktop_.SetThreadDesktop(input_desktop.Pass()); | 201 desktop_.SetThreadDesktop(input_desktop.Pass()); |
203 } | 202 } |
204 } | 203 } |
205 | 204 |
206 } // namespace remoting | 205 } // namespace remoting |
OLD | NEW |