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: webrtc/modules/desktop_capture/window_capturer_win.cc

Issue 2835553002: Crash in WindowCapturerWin (Closed)
Patch Set: Created 3 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 | « no previous file | 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 /* 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
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 SelectObject(mem_dc, previous_object); 245 SelectObject(mem_dc, previous_object);
246 DeleteDC(mem_dc); 246 DeleteDC(mem_dc);
247 ReleaseDC(window_, window_dc); 247 ReleaseDC(window_, window_dc);
248 248
249 previous_size_ = frame->size(); 249 previous_size_ = frame->size();
250 window_size_map_[window_] = previous_size_; 250 window_size_map_[window_] = previous_size_;
251 251
252 frame->mutable_updated_region()->SetRect( 252 frame->mutable_updated_region()->SetRect(
253 DesktopRect::MakeSize(frame->size())); 253 DesktopRect::MakeSize(frame->size()));
254 254
255 if (!result) { 255 if (result) {
256 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
257 } else {
256 LOG(LS_ERROR) << "Both PrintWindow() and BitBlt() failed."; 258 LOG(LS_ERROR) << "Both PrintWindow() and BitBlt() failed.";
257 frame.reset(); 259 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
258 } 260 }
259
260 callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
261 } 261 }
262 262
263 } // namespace 263 } // namespace
264 264
265 // static 265 // static
266 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( 266 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
267 const DesktopCaptureOptions& options) { 267 const DesktopCaptureOptions& options) {
268 return std::unique_ptr<DesktopCapturer>(new WindowCapturerWin()); 268 return std::unique_ptr<DesktopCapturer>(new WindowCapturerWin());
269 } 269 }
270 270
271 } // namespace webrtc 271 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698