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

Side by Side Diff: remoting/host/desktop_shape_tracker_win.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: Created 4 years, 12 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_shape_tracker.h" 5 #include "remoting/host/desktop_shape_tracker.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // Accumulate a new desktop shape from current window positions. 58 // Accumulate a new desktop shape from current window positions.
59 scoped_ptr<EnumDesktopShapeData> shape_data(new EnumDesktopShapeData); 59 scoped_ptr<EnumDesktopShapeData> shape_data(new EnumDesktopShapeData);
60 if (!EnumWindows(EnumWindowsCallback, (LPARAM)shape_data.get())) { 60 if (!EnumWindows(EnumWindowsCallback, (LPARAM)shape_data.get())) {
61 PLOG(ERROR) << "Failed to enumerate windows"; 61 PLOG(ERROR) << "Failed to enumerate windows";
62 desktop_shape_.Clear(); 62 desktop_shape_.Clear();
63 return; 63 return;
64 } 64 }
65 65
66 // If the shape has changed, refresh |desktop_shape_|. 66 // If the shape has changed, refresh |desktop_shape_|.
67 if (!EqualRgn(shape_data->desktop_region.get(), old_desktop_region_.get())) { 67 if (!EqualRgn(shape_data->desktop_region.get(), old_desktop_region_.get())) {
68 old_desktop_region_ = shape_data->desktop_region.Pass(); 68 old_desktop_region_ = std::move(shape_data->desktop_region);
69 69
70 // Determine the size of output buffer required to receive the region. 70 // Determine the size of output buffer required to receive the region.
71 DWORD bytes_size = GetRegionData(old_desktop_region_.get(), 0, nullptr); 71 DWORD bytes_size = GetRegionData(old_desktop_region_.get(), 0, nullptr);
72 CHECK(bytes_size != 0); 72 CHECK(bytes_size != 0);
73 73
74 // Fetch the Windows RECTs that comprise the region. 74 // Fetch the Windows RECTs that comprise the region.
75 std::vector<char> buffer(bytes_size); 75 std::vector<char> buffer(bytes_size);
76 LPRGNDATA region_data = reinterpret_cast<LPRGNDATA>(buffer.data()); 76 LPRGNDATA region_data = reinterpret_cast<LPRGNDATA>(buffer.data());
77 DWORD result = 77 DWORD result =
78 GetRegionData(old_desktop_region_.get(), bytes_size, region_data); 78 GetRegionData(old_desktop_region_.get(), bytes_size, region_data);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 } // namespace 135 } // namespace
136 136
137 // static 137 // static
138 scoped_ptr<DesktopShapeTracker> DesktopShapeTracker::Create( 138 scoped_ptr<DesktopShapeTracker> DesktopShapeTracker::Create(
139 webrtc::DesktopCaptureOptions options) { 139 webrtc::DesktopCaptureOptions options) {
140 return make_scoped_ptr(new DesktopShapeTrackerWin()); 140 return make_scoped_ptr(new DesktopShapeTrackerWin());
141 } 141 }
142 142
143 } // namespace remoting 143 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698