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

Side by Side Diff: cc/trees/threaded_channel.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/remote_channel_impl.cc ('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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/threaded_channel.h" 5 #include "cc/trees/threaded_channel.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/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 void ThreadedChannel::InitializeImplOnImpl( 282 void ThreadedChannel::InitializeImplOnImpl(
283 CompletionEvent* completion, 283 CompletionEvent* completion,
284 LayerTreeHost* layer_tree_host, 284 LayerTreeHost* layer_tree_host,
285 std::unique_ptr<BeginFrameSource> external_begin_frame_source) { 285 std::unique_ptr<BeginFrameSource> external_begin_frame_source) {
286 DCHECK(IsImplThread()); 286 DCHECK(IsImplThread());
287 impl().proxy_impl = 287 impl().proxy_impl =
288 CreateProxyImpl(this, layer_tree_host, task_runner_provider_, 288 CreateProxyImpl(this, layer_tree_host, task_runner_provider_,
289 std::move(external_begin_frame_source)); 289 std::move(external_begin_frame_source));
290 impl().proxy_impl_weak_factory = base::WrapUnique( 290 impl().proxy_impl_weak_factory =
291 new base::WeakPtrFactory<ProxyImpl>(impl().proxy_impl.get())); 291 base::MakeUnique<base::WeakPtrFactory<ProxyImpl>>(
292 impl().proxy_impl.get());
292 proxy_impl_weak_ptr_ = impl().proxy_impl_weak_factory->GetWeakPtr(); 293 proxy_impl_weak_ptr_ = impl().proxy_impl_weak_factory->GetWeakPtr();
293 completion->Signal(); 294 completion->Signal();
294 } 295 }
295 296
296 void ThreadedChannel::CloseImplOnImpl(CompletionEvent* completion) { 297 void ThreadedChannel::CloseImplOnImpl(CompletionEvent* completion) {
297 DCHECK(IsImplThread()); 298 DCHECK(IsImplThread());
298 299
299 // We must destroy the factory and ensure that the ProxyImpl weak pointers are 300 // We must destroy the factory and ensure that the ProxyImpl weak pointers are
300 // invalidated before destroying proxy_impl. 301 // invalidated before destroying proxy_impl.
301 impl().proxy_impl_weak_factory.reset(); 302 impl().proxy_impl_weak_factory.reset();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 350
350 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {} 351 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {}
351 352
352 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly( 353 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly(
353 base::WeakPtr<ProxyMain> proxy_main_weak_ptr) 354 base::WeakPtr<ProxyMain> proxy_main_weak_ptr)
354 : proxy_main_weak_ptr(proxy_main_weak_ptr) {} 355 : proxy_main_weak_ptr(proxy_main_weak_ptr) {}
355 356
356 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} 357 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {}
357 358
358 } // namespace cc 359 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/remote_channel_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698