OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/android/in_process/synchronous_compositor_impl.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 SynchronousCompositorImpl::~SynchronousCompositorImpl() { | 85 SynchronousCompositorImpl::~SynchronousCompositorImpl() { |
86 DCHECK(!output_surface_); | 86 DCHECK(!output_surface_); |
87 DCHECK(!begin_frame_source_); | 87 DCHECK(!begin_frame_source_); |
88 DCHECK(!input_handler_); | 88 DCHECK(!input_handler_); |
89 } | 89 } |
90 | 90 |
91 void SynchronousCompositorImpl::SetClient( | 91 void SynchronousCompositorImpl::SetClient( |
92 SynchronousCompositorClient* compositor_client) { | 92 SynchronousCompositorClient* compositor_client) { |
93 DCHECK(CalledOnValidThread()); | 93 DCHECK(CalledOnValidThread()); |
94 DCHECK_IMPLIES(compositor_client, !compositor_client_); | 94 DCHECK(!compositor_client || !compositor_client_); |
95 DCHECK_IMPLIES(!compositor_client, compositor_client_); | 95 DCHECK(compositor_client || compositor_client_); |
96 | 96 |
97 if (!compositor_client) { | 97 if (!compositor_client) { |
98 SynchronousCompositorRegistry::GetInstance()->UnregisterCompositor( | 98 SynchronousCompositorRegistry::GetInstance()->UnregisterCompositor( |
99 routing_id_, this); | 99 routing_id_, this); |
100 } | 100 } |
101 | 101 |
102 compositor_client_ = compositor_client; | 102 compositor_client_ = compositor_client; |
103 | 103 |
104 // SetClient is essentially the constructor and destructor of | 104 // SetClient is essentially the constructor and destructor of |
105 // SynchronousCompositorImpl. | 105 // SynchronousCompositorImpl. |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 g_factory.Get(); // Ensure it's initialized. | 399 g_factory.Get(); // Ensure it's initialized. |
400 SynchronousCompositorImpl::CreateForWebContents(contents); | 400 SynchronousCompositorImpl::CreateForWebContents(contents); |
401 } | 401 } |
402 SynchronousCompositorImpl* instance = | 402 SynchronousCompositorImpl* instance = |
403 SynchronousCompositorImpl::FromWebContents(contents); | 403 SynchronousCompositorImpl::FromWebContents(contents); |
404 DCHECK(instance); | 404 DCHECK(instance); |
405 instance->SetClient(client); | 405 instance->SetClient(client); |
406 } | 406 } |
407 | 407 |
408 } // namespace content | 408 } // namespace content |
OLD | NEW |