| 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 "web/CompositorProxyClientImpl.h" | 5 #include "web/CompositorProxyClientImpl.h" |
| 6 | 6 |
| 7 #include "core/dom/CompositorProxy.h" | 7 #include "core/dom/CompositorProxy.h" |
| 8 #include "modules/compositorworker/CompositorWorkerGlobalScope.h" | 8 #include "modules/compositorworker/CompositorWorkerGlobalScope.h" |
| 9 #include "platform/TraceEvent.h" | 9 #include "platform/TraceEvent.h" |
| 10 #include "platform/graphics/CompositorMutableStateProvider.h" | 10 #include "platform/graphics/CompositorMutableStateProvider.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 proxy->takeCompositorMutableState(nullptr); | 33 proxy->takeCompositorMutableState(nullptr); |
| 34 } | 34 } |
| 35 private: | 35 private: |
| 36 HeapHashSet<WeakMember<CompositorProxy>>& m_proxies; | 36 HeapHashSet<WeakMember<CompositorProxy>>& m_proxies; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 CompositorProxyClientImpl::CompositorProxyClientImpl(CompositorMutatorImpl* muta
tor) | 39 CompositorProxyClientImpl::CompositorProxyClientImpl(CompositorMutatorImpl* muta
tor) |
| 40 : m_mutator(mutator) | 40 : m_mutator(mutator) |
| 41 , m_globalScope(nullptr) | 41 , m_globalScope(nullptr) |
| 42 { | 42 { |
| 43 DCHECK(isMainThread()); |
| 43 } | 44 } |
| 44 | 45 |
| 45 DEFINE_TRACE(CompositorProxyClientImpl) | 46 DEFINE_TRACE(CompositorProxyClientImpl) |
| 46 { | 47 { |
| 47 CompositorProxyClient::trace(visitor); | 48 CompositorProxyClient::trace(visitor); |
| 48 visitor->trace(m_mutator); | |
| 49 visitor->trace(m_globalScope); | |
| 50 visitor->trace(m_proxies); | 49 visitor->trace(m_proxies); |
| 51 } | 50 } |
| 52 | 51 |
| 53 void CompositorProxyClientImpl::setGlobalScope(WorkerGlobalScope* scope) | 52 void CompositorProxyClientImpl::setGlobalScope(WorkerGlobalScope* scope) |
| 54 { | 53 { |
| 55 TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::setGlobalScope
"); | 54 TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::setGlobalScope
"); |
| 56 DCHECK(!m_globalScope); | 55 DCHECK(!m_globalScope); |
| 57 DCHECK(scope); | 56 DCHECK(scope); |
| 58 m_globalScope = static_cast<CompositorWorkerGlobalScope*>(scope); | 57 m_globalScope = static_cast<CompositorWorkerGlobalScope*>(scope); |
| 59 m_mutator->registerProxyClient(this); | 58 m_mutator->registerProxyClient(this); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 { | 95 { |
| 97 m_proxies.add(proxy); | 96 m_proxies.add(proxy); |
| 98 } | 97 } |
| 99 | 98 |
| 100 void CompositorProxyClientImpl::unregisterCompositorProxy(CompositorProxy* proxy
) | 99 void CompositorProxyClientImpl::unregisterCompositorProxy(CompositorProxy* proxy
) |
| 101 { | 100 { |
| 102 m_proxies.remove(proxy); | 101 m_proxies.remove(proxy); |
| 103 } | 102 } |
| 104 | 103 |
| 105 } // namespace blink | 104 } // namespace blink |
| OLD | NEW |