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/ElementRareData.h

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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/ElementRareData.h
diff --git a/third_party/WebKit/Source/core/dom/ElementRareData.h b/third_party/WebKit/Source/core/dom/ElementRareData.h
index 5e27cfe6ef0a797ef74015199dba900aba584b20..08e83b8065bb702ac450d3cb8d59b1554098ef91 100644
--- a/third_party/WebKit/Source/core/dom/ElementRareData.h
+++ b/third_party/WebKit/Source/core/dom/ElementRareData.h
@@ -24,6 +24,7 @@
#include "core/animation/ElementAnimations.h"
#include "core/dom/Attr.h"
+#include "core/dom/CompositorProxiedPropertySet.h"
#include "core/dom/DatasetDOMStringMap.h"
#include "core/dom/NamedNodeMap.h"
#include "core/dom/NodeRareData.h"
@@ -38,6 +39,7 @@
namespace blink {
class HTMLElement;
+class CompositorProxiedPropertySet;
class ElementRareData : public NodeRareData {
public:
@@ -110,13 +112,9 @@ public:
bool hasPseudoElements() const;
void clearPseudoElements();
- uint32_t incrementProxyCount() { return ++m_proxyCount; }
- uint32_t decrementProxyCount()
- {
- ASSERT(m_proxyCount);
- return --m_proxyCount;
- }
- uint32_t proxyCount() const { return m_proxyCount; }
+ void incrementCompositorProxiedProperties(uint32_t properties);
+ void decrementCompositorProxiedProperties(uint32_t properties);
+ CompositorProxiedPropertySet* proxiedPropertyCounts() const { return m_proxiedProperties.get(); }
void setCustomElementDefinition(PassRefPtrWillBeRawPtr<CustomElementDefinition> definition) { m_customElementDefinition = definition; }
CustomElementDefinition* customElementDefinition() const { return m_customElementDefinition.get(); }
@@ -128,10 +126,10 @@ public:
DECLARE_TRACE_AFTER_DISPATCH();
private:
+ CompositorProxiedPropertySet& ensureCompositorProxiedPropertySet();
+ void clearCompositorProxiedPropertySet() { m_proxiedProperties = nullptr; }
+
short m_tabindex;
- // As m_proxyCount usually doesn't exceed 10bits (1024), if you want to add some booleans you
- // can steal some bits from m_proxyCount by using bitfields to prevent ElementRareData bloat.
- unsigned short m_proxyCount;
LayoutSize m_minimumSizeForResizing;
IntSize m_savedLayerScrollOffset;
@@ -143,6 +141,7 @@ private:
OwnPtrWillBeMember<AttrNodeList> m_attrNodeList;
PersistentWillBeMember<ElementAnimations> m_elementAnimations;
OwnPtrWillBeMember<InlineCSSStyleDeclaration> m_cssomWrapper;
+ OwnPtrWillBeMember<CompositorProxiedPropertySet> m_proxiedProperties;
RefPtr<ComputedStyle> m_computedStyle;
RefPtrWillBeMember<CustomElementDefinition> m_customElementDefinition;
@@ -163,7 +162,6 @@ inline LayoutSize defaultMinimumSizeForResizing()
inline ElementRareData::ElementRareData(LayoutObject* layoutObject)
: NodeRareData(layoutObject)
, m_tabindex(0)
- , m_proxyCount(0)
, m_minimumSizeForResizing(defaultMinimumSizeForResizing())
{
m_isElementRareData = true;
@@ -239,6 +237,25 @@ inline PseudoElement* ElementRareData::pseudoElement(PseudoId pseudoId) const
}
}
+inline void ElementRareData::incrementCompositorProxiedProperties(uint32_t properties)
+{
+ ensureCompositorProxiedPropertySet().increment(properties);
+}
+
+inline void ElementRareData::decrementCompositorProxiedProperties(uint32_t properties)
+{
+ m_proxiedProperties->decrement(properties);
+ if (m_proxiedProperties->isEmpty())
+ clearCompositorProxiedPropertySet();
+}
+
+inline CompositorProxiedPropertySet& ElementRareData::ensureCompositorProxiedPropertySet()
+{
+ if (!m_proxiedProperties)
+ m_proxiedProperties = CompositorProxiedPropertySet::create();
+ return *m_proxiedProperties;
+}
+
} // namespace
#endif // ElementRareData_h

Powered by Google App Engine
This is Rietveld 408576698