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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 LOG(ERROR) << "Failed to serialize AudioPacket."; | 364 LOG(ERROR) << "Failed to serialize AudioPacket."; |
365 return; | 365 return; |
366 } | 366 } |
367 | 367 |
368 SendToNetwork(new ChromotingDesktopNetworkMsg_AudioPacket(serialized_packet)); | 368 SendToNetwork(new ChromotingDesktopNetworkMsg_AudioPacket(serialized_packet)); |
369 } | 369 } |
370 | 370 |
371 bool DesktopSessionAgent::Start(const base::WeakPtr<Delegate>& delegate, | 371 bool DesktopSessionAgent::Start(const base::WeakPtr<Delegate>& delegate, |
372 IPC::PlatformFileForTransit* desktop_pipe_out) { | 372 IPC::PlatformFileForTransit* desktop_pipe_out) { |
373 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 373 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
374 DCHECK(delegate_.get() == NULL); | 374 DCHECK(delegate_.get() == nullptr); |
375 | 375 |
376 delegate_ = delegate; | 376 delegate_ = delegate; |
377 | 377 |
378 // Create an IPC channel to communicate with the network process. | 378 // Create an IPC channel to communicate with the network process. |
379 bool result = CreateConnectedIpcChannel(io_task_runner_, | 379 bool result = CreateConnectedIpcChannel(io_task_runner_, |
380 this, | 380 this, |
381 &desktop_pipe_, | 381 &desktop_pipe_, |
382 &network_channel_); | 382 &network_channel_); |
383 base::PlatformFile raw_desktop_pipe = desktop_pipe_.GetPlatformFile(); | 383 base::PlatformFile raw_desktop_pipe = desktop_pipe_.GetPlatformFile(); |
384 #if defined(OS_WIN) | 384 #if defined(OS_WIN) |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { | 579 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { |
580 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); | 580 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); |
581 DCHECK(id != 0); | 581 DCHECK(id != 0); |
582 | 582 |
583 shared_buffers_--; | 583 shared_buffers_--; |
584 DCHECK_GE(shared_buffers_, 0); | 584 DCHECK_GE(shared_buffers_, 0); |
585 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); | 585 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); |
586 } | 586 } |
587 | 587 |
588 } // namespace remoting | 588 } // namespace remoting |
OLD | NEW |