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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 ~SharedBuffer() override { agent_->OnSharedBufferDeleted(id()); } | 81 ~SharedBuffer() override { agent_->OnSharedBufferDeleted(id()); } |
82 | 82 |
83 private: | 83 private: |
84 SharedBuffer(DesktopSessionAgent* agent, | 84 SharedBuffer(DesktopSessionAgent* agent, |
85 scoped_ptr<base::SharedMemory> memory, | 85 scoped_ptr<base::SharedMemory> memory, |
86 size_t size, | 86 size_t size, |
87 int id) | 87 int id) |
88 : SharedMemory(memory->memory(), | 88 : SharedMemory(memory->memory(), |
89 size, | 89 size, |
90 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
91 memory->handle(), | 91 memory->handle().GetHandle(), |
92 #else | 92 #else |
93 base::SharedMemory::GetFdFromSharedMemoryHandle( | 93 base::SharedMemory::GetFdFromSharedMemoryHandle( |
94 memory->handle()), | 94 memory->handle()), |
95 #endif | 95 #endif |
96 id), | 96 id), |
97 agent_(agent), | 97 agent_(agent), |
98 shared_memory_(memory.Pass()) { | 98 shared_memory_(memory.Pass()) { |
99 } | 99 } |
100 | 100 |
101 DesktopSessionAgent* agent_; | 101 DesktopSessionAgent* agent_; |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { | 596 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { |
597 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); | 597 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); |
598 DCHECK(id != 0); | 598 DCHECK(id != 0); |
599 | 599 |
600 shared_buffers_--; | 600 shared_buffers_--; |
601 DCHECK_GE(shared_buffers_, 0); | 601 DCHECK_GE(shared_buffers_, 0); |
602 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); | 602 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); |
603 } | 603 } |
604 | 604 |
605 } // namespace remoting | 605 } // namespace remoting |
OLD | NEW |