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

Side by Side Diff: webrtc/modules/desktop_capture/window_capturer_win.cc

Issue 1743203002: Replace scoped_ptr with unique_ptr in webrtc/modules/desktop_capture/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More Windows reverts Created 4 years, 9 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 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/modules/desktop_capture/window_capturer.h" 11 #include "webrtc/modules/desktop_capture/window_capturer.h"
12 12
13 #include <assert.h> 13 #include <assert.h>
14 14
15 #include "webrtc/base/scoped_ptr.h" 15 #include <memory>
16
16 #include "webrtc/base/checks.h" 17 #include "webrtc/base/checks.h"
17 #include "webrtc/base/win32.h" 18 #include "webrtc/base/win32.h"
18 #include "webrtc/modules/desktop_capture/desktop_frame_win.h" 19 #include "webrtc/modules/desktop_capture/desktop_frame_win.h"
19 #include "webrtc/modules/desktop_capture/win/window_capture_utils.h" 20 #include "webrtc/modules/desktop_capture/win/window_capture_utils.h"
20 #include "webrtc/system_wrappers/include/logging.h" 21 #include "webrtc/system_wrappers/include/logging.h"
21 22
22 namespace webrtc { 23 namespace webrtc {
23 24
24 namespace { 25 namespace {
25 26
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return; 198 return;
198 } 199 }
199 200
200 HDC window_dc = GetWindowDC(window_); 201 HDC window_dc = GetWindowDC(window_);
201 if (!window_dc) { 202 if (!window_dc) {
202 LOG(LS_WARNING) << "Failed to get window DC: " << GetLastError(); 203 LOG(LS_WARNING) << "Failed to get window DC: " << GetLastError();
203 callback_->OnCaptureCompleted(NULL); 204 callback_->OnCaptureCompleted(NULL);
204 return; 205 return;
205 } 206 }
206 207
207 rtc::scoped_ptr<DesktopFrameWin> frame( 208 std::unique_ptr<DesktopFrameWin> frame(
208 DesktopFrameWin::Create(cropped_rect.size(), NULL, window_dc)); 209 DesktopFrameWin::Create(cropped_rect.size(), NULL, window_dc));
209 if (!frame.get()) { 210 if (!frame.get()) {
210 ReleaseDC(window_, window_dc); 211 ReleaseDC(window_, window_dc);
211 callback_->OnCaptureCompleted(NULL); 212 callback_->OnCaptureCompleted(NULL);
212 return; 213 return;
213 } 214 }
214 215
215 HDC mem_dc = CreateCompatibleDC(window_dc); 216 HDC mem_dc = CreateCompatibleDC(window_dc);
216 HGDIOBJ previous_object = SelectObject(mem_dc, frame->bitmap()); 217 HGDIOBJ previous_object = SelectObject(mem_dc, frame->bitmap());
217 BOOL result = FALSE; 218 BOOL result = FALSE;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 266 }
266 267
267 } // namespace 268 } // namespace
268 269
269 // static 270 // static
270 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { 271 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) {
271 return new WindowCapturerWin(); 272 return new WindowCapturerWin();
272 } 273 }
273 274
274 } // namespace webrtc 275 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698