| 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/desktop_session_agent.h" | 5 #include "remoting/host/desktop_session_agent.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "ipc/ipc_channel_proxy.h" | 10 #include "ipc/ipc_channel_proxy.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, | 113 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, |
| 114 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 114 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 115 scoped_refptr<AutoThreadTaskRunner> input_task_runner, | 115 scoped_refptr<AutoThreadTaskRunner> input_task_runner, |
| 116 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 116 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 117 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner) | 117 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner) |
| 118 : audio_capture_task_runner_(audio_capture_task_runner), | 118 : audio_capture_task_runner_(audio_capture_task_runner), |
| 119 caller_task_runner_(caller_task_runner), | 119 caller_task_runner_(caller_task_runner), |
| 120 input_task_runner_(input_task_runner), | 120 input_task_runner_(input_task_runner), |
| 121 io_task_runner_(io_task_runner), | 121 io_task_runner_(io_task_runner), |
| 122 video_capture_task_runner_(video_capture_task_runner), | 122 video_capture_task_runner_(video_capture_task_runner), |
| 123 control_factory_(this), | |
| 124 next_shared_buffer_id_(1), | 123 next_shared_buffer_id_(1), |
| 125 shared_buffers_(0), | 124 shared_buffers_(0), |
| 126 started_(false) { | 125 started_(false), |
| 126 control_factory_(this) { |
| 127 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 127 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool DesktopSessionAgent::OnMessageReceived(const IPC::Message& message) { | 130 bool DesktopSessionAgent::OnMessageReceived(const IPC::Message& message) { |
| 131 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 131 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 132 | 132 |
| 133 bool handled = true; | 133 bool handled = true; |
| 134 if (started_) { | 134 if (started_) { |
| 135 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message) | 135 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message) |
| 136 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_CaptureFrame, | 136 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_CaptureFrame, |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { | 583 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { |
| 584 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); | 584 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); |
| 585 DCHECK(id != 0); | 585 DCHECK(id != 0); |
| 586 | 586 |
| 587 shared_buffers_--; | 587 shared_buffers_--; |
| 588 DCHECK_GE(shared_buffers_, 0); | 588 DCHECK_GE(shared_buffers_, 0); |
| 589 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); | 589 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); |
| 590 } | 590 } |
| 591 | 591 |
| 592 } // namespace remoting | 592 } // namespace remoting |
| OLD | NEW |