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

Side by Side Diff: remoting/client/dual_buffer_frame_consumer.cc

Issue 2253233004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 | « remoting/client/chromoting_client.cc ('k') | remoting/client/gl_desktop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/client/dual_buffer_frame_consumer.h" 5 #include "remoting/client/dual_buffer_frame_consumer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 RunRenderCallback(std::move(full_frame), base::Bind(&base::DoNothing)); 51 RunRenderCallback(std::move(full_frame), base::Bind(&base::DoNothing));
52 } 52 }
53 53
54 std::unique_ptr<webrtc::DesktopFrame> DualBufferFrameConsumer::AllocateFrame( 54 std::unique_ptr<webrtc::DesktopFrame> DualBufferFrameConsumer::AllocateFrame(
55 const webrtc::DesktopSize& size) { 55 const webrtc::DesktopSize& size) {
56 DCHECK(thread_checker_.CalledOnValidThread()); 56 DCHECK(thread_checker_.CalledOnValidThread());
57 57
58 // Both buffers are reallocated whenever screen size changes. 58 // Both buffers are reallocated whenever screen size changes.
59 if (!buffers_[0] || !buffers_[0]->size().equals(size)) { 59 if (!buffers_[0] || !buffers_[0]->size().equals(size)) {
60 buffers_[0] = webrtc::SharedDesktopFrame::Wrap( 60 buffers_[0] = webrtc::SharedDesktopFrame::Wrap(
61 base::WrapUnique(new webrtc::BasicDesktopFrame(size))); 61 base::MakeUnique<webrtc::BasicDesktopFrame>(size));
62 buffers_[1] = webrtc::SharedDesktopFrame::Wrap( 62 buffers_[1] = webrtc::SharedDesktopFrame::Wrap(
63 base::WrapUnique(new webrtc::BasicDesktopFrame(size))); 63 base::MakeUnique<webrtc::BasicDesktopFrame>(size));
64 buffer_1_mask_.Clear(); 64 buffer_1_mask_.Clear();
65 current_buffer_ = 0; 65 current_buffer_ = 0;
66 } else { 66 } else {
67 current_buffer_ = (current_buffer_ + 1) % 2; 67 current_buffer_ = (current_buffer_ + 1) % 2;
68 } 68 }
69 return buffers_[current_buffer_]->Share(); 69 return buffers_[current_buffer_]->Share();
70 } 70 }
71 71
72 void DualBufferFrameConsumer::DrawFrame( 72 void DualBufferFrameConsumer::DrawFrame(
73 std::unique_ptr<webrtc::DesktopFrame> frame, 73 std::unique_ptr<webrtc::DesktopFrame> frame,
(...skipping 27 matching lines...) Expand all
101 return; 101 return;
102 } 102 }
103 103
104 task_runner_->PostTask( 104 task_runner_->PostTask(
105 FROM_HERE, base::Bind(callback_, base::Passed(&frame), base::Bind( 105 FROM_HERE, base::Bind(callback_, base::Passed(&frame), base::Bind(
106 base::IgnoreResult(&base::TaskRunner::PostTask), 106 base::IgnoreResult(&base::TaskRunner::PostTask),
107 base::ThreadTaskRunnerHandle::Get(), FROM_HERE, done))); 107 base::ThreadTaskRunnerHandle::Get(), FROM_HERE, done)));
108 } 108 }
109 109
110 } // namespace remoting 110 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/chromoting_client.cc ('k') | remoting/client/gl_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698