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

Unified Diff: third_party/WebKit/Source/core/dom/CompositorProxy.cpp

Issue 1921503008: Blink CompositorWorker: Use CompositorElementId and CompositorIdToElementMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@elementid
Patch Set: Vend ids via local blink nextCompositorElementId. Created 4 years, 7 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/core/dom/CompositorProxy.cpp
diff --git a/third_party/WebKit/Source/core/dom/CompositorProxy.cpp b/third_party/WebKit/Source/core/dom/CompositorProxy.cpp
index 7ab544c2acc8294d689d3837f93bbf50d7134abb..7dff364b14e1bfd6d39fd3327c94cafa2a5a0cbc 100644
--- a/third_party/WebKit/Source/core/dom/CompositorProxy.cpp
+++ b/third_party/WebKit/Source/core/dom/CompositorProxy.cpp
@@ -6,7 +6,7 @@
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/ExceptionState.h"
-#include "core/dom/DOMNodeIds.h"
+#include "core/dom/CompositorIdToElementMap.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
#include "platform/ThreadSafeFunctional.h"
@@ -50,20 +50,18 @@ static bool isCallingCompositorFrameCallback()
static void decrementCompositorProxiedPropertiesForElement(CompositorElementId elementId, uint32_t compositorMutableProperties)
{
DCHECK(isMainThread());
- Node* node = DOMNodeIds::nodeForId(elementId);
- if (!node)
+ Element* element = CompositorIdToElementMap::getById(elementId);
+ if (!element)
return;
- Element* element = toElement(node);
element->decrementCompositorProxiedProperties(compositorMutableProperties);
}
static void incrementCompositorProxiedPropertiesForElement(CompositorElementId elementId, uint32_t compositorMutableProperties)
{
DCHECK(isMainThread());
- Node* node = DOMNodeIds::nodeForId(elementId);
- if (!node)
+ Element* element = CompositorIdToElementMap::getById(elementId);
+ if (!element)
return;
- Element* element = toElement(node);
element->incrementCompositorProxiedProperties(compositorMutableProperties);
}
@@ -118,7 +116,7 @@ CompositorProxy* CompositorProxy::create(CompositorElementId elementId, uint32_t
}
CompositorProxy::CompositorProxy(Element& element, const Vector<String>& attributeArray)
- : m_elementId(DOMNodeIds::idForNode(&element))
+ : m_elementId(element.assignCompositorElementId())
, m_compositorMutableProperties(compositorMutablePropertiesFromNames(attributeArray))
{
DCHECK(isMainThread());
@@ -126,6 +124,7 @@ CompositorProxy::CompositorProxy(Element& element, const Vector<String>& attribu
#if DCHECK_IS_ON()
DCHECK(sanityCheckMutableProperties(m_compositorMutableProperties));
#endif
+ CompositorIdToElementMap::registerElement(element);
incrementCompositorProxiedPropertiesForElement(m_elementId, m_compositorMutableProperties);
}

Powered by Google App Engine
This is Rietveld 408576698