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

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

Issue 609923004: Cleanup usage of scoped_ptr<> in remoting for C++11 (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
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_proxy.h" 5 #include "remoting/host/desktop_session_proxy.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process_handle.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 if (desktop_process_ != base::kNullProcessHandle) { 284 if (desktop_process_ != base::kNullProcessHandle) {
285 base::CloseProcessHandle(desktop_process_); 285 base::CloseProcessHandle(desktop_process_);
286 desktop_process_ = base::kNullProcessHandle; 286 desktop_process_ = base::kNullProcessHandle;
287 } 287 }
288 288
289 shared_buffers_.clear(); 289 shared_buffers_.clear();
290 290
291 // Generate fake responses to keep the video capturer in sync. 291 // Generate fake responses to keep the video capturer in sync.
292 while (pending_capture_frame_requests_) { 292 while (pending_capture_frame_requests_) {
293 --pending_capture_frame_requests_; 293 --pending_capture_frame_requests_;
294 PostCaptureCompleted(scoped_ptr<webrtc::DesktopFrame>()); 294 PostCaptureCompleted(nullptr);
295 } 295 }
296 } 296 }
297 297
298 void DesktopSessionProxy::SetAudioCapturer( 298 void DesktopSessionProxy::SetAudioCapturer(
299 const base::WeakPtr<IpcAudioCapturer>& audio_capturer) { 299 const base::WeakPtr<IpcAudioCapturer>& audio_capturer) {
300 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread()); 300 DCHECK(audio_capture_task_runner_->BelongsToCurrentThread());
301 301
302 audio_capturer_ = audio_capturer; 302 audio_capturer_ = audio_capturer;
303 } 303 }
304 304
305 void DesktopSessionProxy::CaptureFrame() { 305 void DesktopSessionProxy::CaptureFrame() {
306 if (!caller_task_runner_->BelongsToCurrentThread()) { 306 if (!caller_task_runner_->BelongsToCurrentThread()) {
307 caller_task_runner_->PostTask( 307 caller_task_runner_->PostTask(
308 FROM_HERE, base::Bind(&DesktopSessionProxy::CaptureFrame, this)); 308 FROM_HERE, base::Bind(&DesktopSessionProxy::CaptureFrame, this));
309 return; 309 return;
310 } 310 }
311 311
312 if (desktop_channel_) { 312 if (desktop_channel_) {
313 ++pending_capture_frame_requests_; 313 ++pending_capture_frame_requests_;
314 SendToDesktop(new ChromotingNetworkDesktopMsg_CaptureFrame()); 314 SendToDesktop(new ChromotingNetworkDesktopMsg_CaptureFrame());
315 } else { 315 } else {
316 PostCaptureCompleted(scoped_ptr<webrtc::DesktopFrame>()); 316 PostCaptureCompleted(nullptr);
317 } 317 }
318 } 318 }
319 319
320 void DesktopSessionProxy::SetVideoCapturer( 320 void DesktopSessionProxy::SetVideoCapturer(
321 const base::WeakPtr<IpcVideoFrameCapturer> video_capturer) { 321 const base::WeakPtr<IpcVideoFrameCapturer> video_capturer) {
322 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); 322 DCHECK(video_capture_task_runner_->BelongsToCurrentThread());
323 323
324 video_capturer_ = video_capturer; 324 video_capturer_ = video_capturer;
325 } 325 }
326 326
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 571 }
572 572
573 // static 573 // static
574 void DesktopSessionProxyTraits::Destruct( 574 void DesktopSessionProxyTraits::Destruct(
575 const DesktopSessionProxy* desktop_session_proxy) { 575 const DesktopSessionProxy* desktop_session_proxy) {
576 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, 576 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE,
577 desktop_session_proxy); 577 desktop_session_proxy);
578 } 578 }
579 579
580 } // namespace remoting 580 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698