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

Unified Diff: third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp

Issue 1900423004: [compositorworker] Register compositor proxies with proxy client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp b/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
index 785f096b53c210fa47430bbbf0c614d36fad27c0..883ea21352636a176304ed08ace173512285acfb 100644
--- a/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
+++ b/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
@@ -23,6 +23,7 @@ DEFINE_TRACE(CompositorProxyClientImpl)
CompositorProxyClient::trace(visitor);
visitor->trace(m_mutator);
visitor->trace(m_globalScope);
+ visitor->trace(m_proxyMap);
}
void CompositorProxyClientImpl::setGlobalScope(WorkerGlobalScope* scope)
@@ -64,4 +65,23 @@ bool CompositorProxyClientImpl::executeAnimationFrameCallbacks(double monotonicT
return shouldReinvoke;
}
+void CompositorProxyClientImpl::registerCompositorProxy(CompositorProxy* proxy)
+{
+ uint64_t elementId = proxy->elementId();
+ ProxyMap::AddResult entry = m_proxyMap.add(elementId, new ProxySet);
jbroman 2016/06/10 17:45:42 This will create a spurious "new ProxySet" every t
majidvp 2016/06/10 19:17:51 Great! I like this pattern of using isNewEntry. Th
+ ProxySet* proxies = entry.storedValue->value;
+ if (!proxies->contains(proxy))
+ proxies->add(proxy);
+}
+
+void CompositorProxyClientImpl::unregisterCompositorProxy(CompositorProxy* proxy)
+{
+ uint64_t elementId = proxy->elementId();
+ if (ProxySet* proxies = m_proxyMap.get(elementId)) {
+ proxies->remove(proxy);
+ if (proxies->isEmpty())
+ m_proxyMap.remove(elementId);
jbroman 2016/06/10 17:45:42 This case is probably less worrisome, but this is
majidvp 2016/06/10 19:17:51 Done.
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698