OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |