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

Side by Side Diff: remoting/host/desktop_session_agent.cc

Issue 667123002: Standardize usage of virtual/override/final in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « remoting/host/desktop_session_agent.h ('k') | remoting/host/desktop_session_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 32
33 namespace remoting { 33 namespace remoting {
34 34
35 namespace { 35 namespace {
36 36
37 // Routes local clipboard events though the IPC channel to the network process. 37 // Routes local clipboard events though the IPC channel to the network process.
38 class DesktopSesssionClipboardStub : public protocol::ClipboardStub { 38 class DesktopSesssionClipboardStub : public protocol::ClipboardStub {
39 public: 39 public:
40 explicit DesktopSesssionClipboardStub( 40 explicit DesktopSesssionClipboardStub(
41 scoped_refptr<DesktopSessionAgent> desktop_session_agent); 41 scoped_refptr<DesktopSessionAgent> desktop_session_agent);
42 virtual ~DesktopSesssionClipboardStub(); 42 ~DesktopSesssionClipboardStub() override;
43 43
44 // protocol::ClipboardStub implementation. 44 // protocol::ClipboardStub implementation.
45 virtual void InjectClipboardEvent( 45 void InjectClipboardEvent(const protocol::ClipboardEvent& event) override;
46 const protocol::ClipboardEvent& event) override;
47 46
48 private: 47 private:
49 scoped_refptr<DesktopSessionAgent> desktop_session_agent_; 48 scoped_refptr<DesktopSessionAgent> desktop_session_agent_;
50 49
51 DISALLOW_COPY_AND_ASSIGN(DesktopSesssionClipboardStub); 50 DISALLOW_COPY_AND_ASSIGN(DesktopSesssionClipboardStub);
52 }; 51 };
53 52
54 DesktopSesssionClipboardStub::DesktopSesssionClipboardStub( 53 DesktopSesssionClipboardStub::DesktopSesssionClipboardStub(
55 scoped_refptr<DesktopSessionAgent> desktop_session_agent) 54 scoped_refptr<DesktopSessionAgent> desktop_session_agent)
56 : desktop_session_agent_(desktop_session_agent) { 55 : desktop_session_agent_(desktop_session_agent) {
(...skipping 15 matching lines...) Expand all
72 public: 71 public:
73 static scoped_ptr<SharedBuffer> Create(DesktopSessionAgent* agent, 72 static scoped_ptr<SharedBuffer> Create(DesktopSessionAgent* agent,
74 size_t size, 73 size_t size,
75 int id) { 74 int id) {
76 scoped_ptr<base::SharedMemory> memory(new base::SharedMemory()); 75 scoped_ptr<base::SharedMemory> memory(new base::SharedMemory());
77 if (!memory->CreateAndMapAnonymous(size)) 76 if (!memory->CreateAndMapAnonymous(size))
78 return nullptr; 77 return nullptr;
79 return make_scoped_ptr(new SharedBuffer(agent, memory.Pass(), size, id)); 78 return make_scoped_ptr(new SharedBuffer(agent, memory.Pass(), size, id));
80 } 79 }
81 80
82 virtual ~SharedBuffer() { 81 ~SharedBuffer() override { agent_->OnSharedBufferDeleted(id()); }
83 agent_->OnSharedBufferDeleted(id());
84 }
85 82
86 private: 83 private:
87 SharedBuffer(DesktopSessionAgent* agent, 84 SharedBuffer(DesktopSessionAgent* agent,
88 scoped_ptr<base::SharedMemory> memory, 85 scoped_ptr<base::SharedMemory> memory,
89 size_t size, 86 size_t size,
90 int id) 87 int id)
91 : SharedMemory(memory->memory(), size, 88 : SharedMemory(memory->memory(), size,
92 #if defined(OS_WIN) 89 #if defined(OS_WIN)
93 memory->handle(), 90 memory->handle(),
94 #else 91 #else
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { 579 void DesktopSessionAgent::OnSharedBufferDeleted(int id) {
583 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); 580 DCHECK(video_capture_task_runner_->BelongsToCurrentThread());
584 DCHECK(id != 0); 581 DCHECK(id != 0);
585 582
586 shared_buffers_--; 583 shared_buffers_--;
587 DCHECK_GE(shared_buffers_, 0); 584 DCHECK_GE(shared_buffers_, 0);
588 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); 585 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id));
589 } 586 }
590 587
591 } // namespace remoting 588 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_session_agent.h ('k') | remoting/host/desktop_session_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698