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

Side by Side Diff: cc/layers/texture_layer.cc

Issue 2258833002: 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 | « cc/layers/layer_impl.cc ('k') | cc/output/bsp_tree.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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 "cc/layers/texture_layer.h" 5 #include "cc/layers/texture_layer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 is_lost_(false) {} 251 is_lost_(false) {}
252 252
253 TextureLayer::TextureMailboxHolder::~TextureMailboxHolder() { 253 TextureLayer::TextureMailboxHolder::~TextureMailboxHolder() {
254 DCHECK_EQ(0u, internal_references_); 254 DCHECK_EQ(0u, internal_references_);
255 } 255 }
256 256
257 std::unique_ptr<TextureLayer::TextureMailboxHolder::MainThreadReference> 257 std::unique_ptr<TextureLayer::TextureMailboxHolder::MainThreadReference>
258 TextureLayer::TextureMailboxHolder::Create( 258 TextureLayer::TextureMailboxHolder::Create(
259 const TextureMailbox& mailbox, 259 const TextureMailbox& mailbox,
260 std::unique_ptr<SingleReleaseCallback> release_callback) { 260 std::unique_ptr<SingleReleaseCallback> release_callback) {
261 return base::WrapUnique(new MainThreadReference( 261 return base::MakeUnique<MainThreadReference>(
262 new TextureMailboxHolder(mailbox, std::move(release_callback)))); 262 new TextureMailboxHolder(mailbox, std::move(release_callback)));
263 } 263 }
264 264
265 void TextureLayer::TextureMailboxHolder::Return( 265 void TextureLayer::TextureMailboxHolder::Return(
266 const gpu::SyncToken& sync_token, 266 const gpu::SyncToken& sync_token,
267 bool is_lost) { 267 bool is_lost) {
268 base::AutoLock lock(arguments_lock_); 268 base::AutoLock lock(arguments_lock_);
269 sync_token_ = sync_token; 269 sync_token_ = sync_token;
270 is_lost_ = is_lost; 270 is_lost_ = is_lost;
271 } 271 }
272 272
(...skipping 23 matching lines...) Expand all
296 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( 296 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread(
297 const gpu::SyncToken& sync_token, 297 const gpu::SyncToken& sync_token,
298 bool is_lost, 298 bool is_lost,
299 BlockingTaskRunner* main_thread_task_runner) { 299 BlockingTaskRunner* main_thread_task_runner) {
300 Return(sync_token, is_lost); 300 Return(sync_token, is_lost);
301 main_thread_task_runner->PostTask( 301 main_thread_task_runner->PostTask(
302 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); 302 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this));
303 } 303 }
304 304
305 } // namespace cc 305 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/output/bsp_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698