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

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

Issue 2036123002: Add r-value constructor for RefCountedObject. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 | « webrtc/base/refcount.h ('k') | 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
11 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" 11 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h"
12 12
13 #include <memory> 13 #include <memory>
14 14
15 #include "webrtc/base/constructormagic.h" 15 #include "webrtc/base/constructormagic.h"
16 #include "webrtc/system_wrappers/include/atomic32.h" 16 #include "webrtc/system_wrappers/include/atomic32.h"
17 17
18 namespace webrtc { 18 namespace webrtc {
19 19
20 SharedDesktopFrame::~SharedDesktopFrame() {} 20 SharedDesktopFrame::~SharedDesktopFrame() {}
21 21
22 // static 22 // static
23 std::unique_ptr<SharedDesktopFrame> SharedDesktopFrame::Wrap( 23 std::unique_ptr<SharedDesktopFrame> SharedDesktopFrame::Wrap(
24 std::unique_ptr<DesktopFrame> desktop_frame) { 24 std::unique_ptr<DesktopFrame> desktop_frame) {
25 return std::unique_ptr<SharedDesktopFrame>( 25 return std::unique_ptr<SharedDesktopFrame>(
26 new SharedDesktopFrame(new Core(desktop_frame.release()))); 26 new SharedDesktopFrame(new Core(std::move(desktop_frame))));
27 } 27 }
28 28
29 SharedDesktopFrame* SharedDesktopFrame::Wrap(DesktopFrame* desktop_frame) { 29 SharedDesktopFrame* SharedDesktopFrame::Wrap(DesktopFrame* desktop_frame) {
30 return Wrap(std::unique_ptr<DesktopFrame>(desktop_frame)).release(); 30 return Wrap(std::unique_ptr<DesktopFrame>(desktop_frame)).release();
31 } 31 }
32 32
33 DesktopFrame* SharedDesktopFrame::GetUnderlyingFrame() { 33 DesktopFrame* SharedDesktopFrame::GetUnderlyingFrame() {
34 return core_->get(); 34 return core_->get();
35 } 35 }
36 36
(...skipping 10 matching lines...) Expand all
47 } 47 }
48 48
49 SharedDesktopFrame::SharedDesktopFrame(rtc::scoped_refptr<Core> core) 49 SharedDesktopFrame::SharedDesktopFrame(rtc::scoped_refptr<Core> core)
50 : DesktopFrame((*core)->size(), 50 : DesktopFrame((*core)->size(),
51 (*core)->stride(), 51 (*core)->stride(),
52 (*core)->data(), 52 (*core)->data(),
53 (*core)->shared_memory()), 53 (*core)->shared_memory()),
54 core_(core) {} 54 core_(core) {}
55 55
56 } // namespace webrtc 56 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/base/refcount.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698