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

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

Issue 1921553002: Stop using rtc_make_scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_capturer_proxy.cc ('k') | no next file » | 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 <utility> 7 #include <utility>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // take about a year of allocating 100 new buffers every second. 135 // take about a year of allocating 100 new buffers every second.
136 // Practically speaking it never happens. 136 // Practically speaking it never happens.
137 next_shared_buffer_id_ += 2; 137 next_shared_buffer_id_ += 2;
138 138
139 send_message_callback_.Run( 139 send_message_callback_.Run(
140 base::WrapUnique(new ChromotingDesktopNetworkMsg_CreateSharedBuffer( 140 base::WrapUnique(new ChromotingDesktopNetworkMsg_CreateSharedBuffer(
141 buffer->id(), buffer->shared_memory()->handle(), 141 buffer->id(), buffer->shared_memory()->handle(),
142 buffer->size()))); 142 buffer->size())));
143 } 143 }
144 144
145 return rtc_make_scoped_ptr(buffer.release()); 145 return rtc::scoped_ptr<webrtc::SharedMemory>(buffer.release());
tommi 2016/04/25 10:24:22 looks like CreateSharedMemory is only being called
kwiberg-chromium 2016/04/25 10:41:59 We could, but changing the return value of an inte
tommi 2016/04/25 12:30:26 ok, sgtm
146 } 146 }
147 147
148 private: 148 private:
149 int next_shared_buffer_id_ = 1; 149 int next_shared_buffer_id_ = 1;
150 SendMessageCallback send_message_callback_; 150 SendMessageCallback send_message_callback_;
151 151
152 DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactoryImpl); 152 DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactoryImpl);
153 }; 153 };
154 154
155 } // namespace 155 } // namespace
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if (delegate_->desktop_environment_factory().SupportsAudioCapture()) { 303 if (delegate_->desktop_environment_factory().SupportsAudioCapture()) {
304 audio_capturer_ = desktop_environment_->CreateAudioCapturer(); 304 audio_capturer_ = desktop_environment_->CreateAudioCapturer();
305 audio_capture_task_runner_->PostTask( 305 audio_capture_task_runner_->PostTask(
306 FROM_HERE, base::Bind(&DesktopSessionAgent::StartAudioCapturer, this)); 306 FROM_HERE, base::Bind(&DesktopSessionAgent::StartAudioCapturer, this));
307 } 307 }
308 308
309 // Start the video capturer and mouse cursor monitor. 309 // Start the video capturer and mouse cursor monitor.
310 video_capturer_ = desktop_environment_->CreateVideoCapturer(); 310 video_capturer_ = desktop_environment_->CreateVideoCapturer();
311 video_capturer_->Start(this); 311 video_capturer_->Start(this);
312 video_capturer_->SetSharedMemoryFactory( 312 video_capturer_->SetSharedMemoryFactory(
313 rtc_make_scoped_ptr(new SharedMemoryFactoryImpl( 313 rtc::scoped_ptr<webrtc::SharedMemoryFactory>(new SharedMemoryFactoryImpl(
314 base::Bind(&DesktopSessionAgent::SendToNetwork, this)))); 314 base::Bind(&DesktopSessionAgent::SendToNetwork, this))));
315 mouse_cursor_monitor_ = desktop_environment_->CreateMouseCursorMonitor(); 315 mouse_cursor_monitor_ = desktop_environment_->CreateMouseCursorMonitor();
316 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY); 316 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY);
317 } 317 }
318 318
319 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) { 319 void DesktopSessionAgent::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
320 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 320 DCHECK(caller_task_runner_->BelongsToCurrentThread());
321 321
322 last_frame_.reset(frame); 322 last_frame_.reset(frame);
323 323
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 } 569 }
570 } 570 }
571 571
572 void DesktopSessionAgent::StopAudioCapturer() { 572 void DesktopSessionAgent::StopAudioCapturer() {
573 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread()); 573 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread());
574 574
575 audio_capturer_.reset(); 575 audio_capturer_.reset();
576 } 576 }
577 577
578 } // namespace remoting 578 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_capturer_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698