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

Side by Side Diff: cc/trees/remote_channel_impl.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/trees/layer_tree_host_unittest.cc ('k') | cc/trees/threaded_channel.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 "cc/trees/remote_channel_impl.h" 5 #include "cc/trees/remote_channel_impl.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "cc/animation/animation_events.h" 10 #include "cc/animation/animation_events.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 proxy_impl_weak_ptr_, damaged_rect)); 463 proxy_impl_weak_ptr_, damaged_rect));
464 } 464 }
465 465
466 void RemoteChannelImpl::InitializeImplOnImpl(CompletionEvent* completion, 466 void RemoteChannelImpl::InitializeImplOnImpl(CompletionEvent* completion,
467 LayerTreeHost* layer_tree_host) { 467 LayerTreeHost* layer_tree_host) {
468 DCHECK(task_runner_provider_->IsMainThreadBlocked()); 468 DCHECK(task_runner_provider_->IsMainThreadBlocked());
469 DCHECK(task_runner_provider_->IsImplThread()); 469 DCHECK(task_runner_provider_->IsImplThread());
470 470
471 impl().proxy_impl = 471 impl().proxy_impl =
472 CreateProxyImpl(this, layer_tree_host, task_runner_provider_, nullptr); 472 CreateProxyImpl(this, layer_tree_host, task_runner_provider_, nullptr);
473 impl().proxy_impl_weak_factory = base::WrapUnique( 473 impl().proxy_impl_weak_factory =
474 new base::WeakPtrFactory<ProxyImpl>(impl().proxy_impl.get())); 474 base::MakeUnique<base::WeakPtrFactory<ProxyImpl>>(
475 impl().proxy_impl.get());
475 proxy_impl_weak_ptr_ = impl().proxy_impl_weak_factory->GetWeakPtr(); 476 proxy_impl_weak_ptr_ = impl().proxy_impl_weak_factory->GetWeakPtr();
476 completion->Signal(); 477 completion->Signal();
477 } 478 }
478 479
479 void RemoteChannelImpl::ShutdownImplOnImpl(CompletionEvent* completion) { 480 void RemoteChannelImpl::ShutdownImplOnImpl(CompletionEvent* completion) {
480 DCHECK(task_runner_provider_->IsMainThreadBlocked()); 481 DCHECK(task_runner_provider_->IsMainThreadBlocked());
481 DCHECK(task_runner_provider_->IsImplThread()); 482 DCHECK(task_runner_provider_->IsImplThread());
482 483
483 // We must invalidate the proxy_impl weak ptrs and destroy the weak ptr 484 // We must invalidate the proxy_impl weak ptrs and destroy the weak ptr
484 // factory before destroying proxy_impl. 485 // factory before destroying proxy_impl.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 535
535 RemoteChannelImpl::CompositorThreadOnly::CompositorThreadOnly( 536 RemoteChannelImpl::CompositorThreadOnly::CompositorThreadOnly(
536 base::WeakPtr<RemoteChannelImpl> remote_channel_weak_ptr) 537 base::WeakPtr<RemoteChannelImpl> remote_channel_weak_ptr)
537 : proxy_impl(nullptr), 538 : proxy_impl(nullptr),
538 proxy_impl_weak_factory(nullptr), 539 proxy_impl_weak_factory(nullptr),
539 remote_channel_weak_ptr(remote_channel_weak_ptr) {} 540 remote_channel_weak_ptr(remote_channel_weak_ptr) {}
540 541
541 RemoteChannelImpl::CompositorThreadOnly::~CompositorThreadOnly() {} 542 RemoteChannelImpl::CompositorThreadOnly::~CompositorThreadOnly() {}
542 543
543 } // namespace cc 544 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/threaded_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698