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

Side by Side Diff: content/renderer/gpu/frame_swap_message_queue.cc

Issue 2253053003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/gpu/frame_swap_message_queue.h" 5 #include "content/renderer/gpu/frame_swap_message_queue.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void FrameSwapMessageQueue::DrainMessages( 192 void FrameSwapMessageQueue::DrainMessages(
193 std::vector<std::unique_ptr<IPC::Message>>* messages) { 193 std::vector<std::unique_ptr<IPC::Message>>* messages) {
194 lock_.AssertAcquired(); 194 lock_.AssertAcquired();
195 std::move(next_drain_messages_.begin(), next_drain_messages_.end(), 195 std::move(next_drain_messages_.begin(), next_drain_messages_.end(),
196 std::back_inserter(*messages)); 196 std::back_inserter(*messages));
197 next_drain_messages_.clear(); 197 next_drain_messages_.clear();
198 } 198 }
199 199
200 std::unique_ptr<FrameSwapMessageQueue::SendMessageScope> 200 std::unique_ptr<FrameSwapMessageQueue::SendMessageScope>
201 FrameSwapMessageQueue::AcquireSendMessageScope() { 201 FrameSwapMessageQueue::AcquireSendMessageScope() {
202 return base::WrapUnique(new SendMessageScopeImpl(&lock_)); 202 return base::MakeUnique<SendMessageScopeImpl>(&lock_);
203 } 203 }
204 204
205 // static 205 // static
206 void FrameSwapMessageQueue::TransferMessages( 206 void FrameSwapMessageQueue::TransferMessages(
207 std::vector<std::unique_ptr<IPC::Message>>* source, 207 std::vector<std::unique_ptr<IPC::Message>>* source,
208 vector<IPC::Message>* dest) { 208 vector<IPC::Message>* dest) {
209 for (const auto& msg : *source) { 209 for (const auto& msg : *source) {
210 dest->push_back(*msg.get()); 210 dest->push_back(*msg.get());
211 } 211 }
212 source->clear(); 212 source->clear();
213 } 213 }
214 214
215 } // namespace content 215 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/bluetooth/web_bluetooth_impl.cc ('k') | content/renderer/gpu/frame_swap_message_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698