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

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

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: include <utility> Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shaped_desktop_capturer.h" 5 #include "remoting/host/shaped_desktop_capturer.h"
6 6
7 #include <utility>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "remoting/host/desktop_shape_tracker.h" 10 #include "remoting/host/desktop_shape_tracker.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 11 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
10 12
11 namespace remoting { 13 namespace remoting {
12 14
13 ShapedDesktopCapturer::ShapedDesktopCapturer( 15 ShapedDesktopCapturer::ShapedDesktopCapturer(
14 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer, 16 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer,
15 scoped_ptr<DesktopShapeTracker> shape_tracker) 17 scoped_ptr<DesktopShapeTracker> shape_tracker)
16 : desktop_capturer_(desktop_capturer.Pass()), 18 : desktop_capturer_(std::move(desktop_capturer)),
17 shape_tracker_(shape_tracker.Pass()), 19 shape_tracker_(std::move(shape_tracker)),
18 callback_(nullptr) { 20 callback_(nullptr) {}
19 }
20 21
21 ShapedDesktopCapturer::~ShapedDesktopCapturer() {} 22 ShapedDesktopCapturer::~ShapedDesktopCapturer() {}
22 23
23 void ShapedDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) { 24 void ShapedDesktopCapturer::Start(webrtc::DesktopCapturer::Callback* callback) {
24 callback_ = callback; 25 callback_ = callback;
25 desktop_capturer_->Start(this); 26 desktop_capturer_->Start(this);
26 } 27 }
27 28
28 void ShapedDesktopCapturer::Capture(const webrtc::DesktopRegion& region) { 29 void ShapedDesktopCapturer::Capture(const webrtc::DesktopRegion& region) {
29 desktop_capturer_->Capture(region); 30 desktop_capturer_->Capture(region);
30 } 31 }
31 32
32 webrtc::SharedMemory* ShapedDesktopCapturer::CreateSharedMemory(size_t size) { 33 webrtc::SharedMemory* ShapedDesktopCapturer::CreateSharedMemory(size_t size) {
33 return callback_->CreateSharedMemory(size); 34 return callback_->CreateSharedMemory(size);
34 } 35 }
35 36
36 void ShapedDesktopCapturer::OnCaptureCompleted(webrtc::DesktopFrame* frame) { 37 void ShapedDesktopCapturer::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
37 shape_tracker_->RefreshDesktopShape(); 38 shape_tracker_->RefreshDesktopShape();
38 frame->set_shape(new webrtc::DesktopRegion(shape_tracker_->desktop_shape())); 39 frame->set_shape(new webrtc::DesktopRegion(shape_tracker_->desktop_shape()));
39 callback_->OnCaptureCompleted(frame); 40 callback_->OnCaptureCompleted(frame);
40 } 41 }
41 42
42 } // namespace remoting 43 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/setup/me2me_native_messaging_host_unittest.cc ('k') | remoting/host/signaling_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698