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

Unified Diff: Source/core/css/CSSValueObject.h

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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
« no previous file with comments | « Source/core/css/CSSValueList.cpp ('k') | Source/core/css/CSSValueObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSValueObject.h
diff --git a/Source/core/css/CSSValue.h b/Source/core/css/CSSValueObject.h
similarity index 86%
copy from Source/core/css/CSSValue.h
copy to Source/core/css/CSSValueObject.h
index 7bec2acc42b668100407563f551f0c63e2ee7c00..535e95bc89ec3ea52e5ea787ac5a3b3efaa8ead2 100644
--- a/Source/core/css/CSSValue.h
+++ b/Source/core/css/CSSValueObject.h
@@ -18,23 +18,20 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef CSSValue_h
-#define CSSValue_h
+#ifndef CSSValueObject_h
+#define CSSValueObject_h
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
-#include "platform/weborigin/KURL.h"
-#include "wtf/HashMap.h"
-#include "wtf/ListHashSet.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
namespace blink {
-class CORE_EXPORT CSSValue : public RefCountedWillBeGarbageCollectedFinalized<CSSValue> {
+class CORE_EXPORT CSSValueObject : public RefCountedWillBeGarbageCollectedFinalized<CSSValueObject> {
public:
#if ENABLE(OILPAN)
- // Override operator new to allocate CSSValue subtype objects onto
+ // Override operator new to allocate CSSValueObject subtype objects onto
// a dedicated heap.
GC_PLUGIN_IGNORE("crbug.com/443854")
void* operator new(size_t size)
@@ -43,8 +40,8 @@ public:
}
static void* allocateObject(size_t size, bool isEager)
{
- ThreadState* state = ThreadStateFor<ThreadingTrait<CSSValue>::Affinity>::state();
- return Heap::allocateOnHeapIndex(state, size, isEager ? ThreadState::EagerSweepHeapIndex : ThreadState::CSSValueHeapIndex, GCInfoTrait<CSSValue>::index());
+ ThreadState* state = ThreadStateFor<ThreadingTrait<CSSValueObject>::Affinity>::state();
+ return Heap::allocateOnHeapIndex(state, size, isEager ? ThreadState::EagerSweepHeapIndex : ThreadState::CSSValueHeapIndex, GCInfoTrait<CSSValueObject>::index());
}
#else
// Override RefCounted's deref() to ensure operator delete is called on
@@ -96,17 +93,17 @@ public:
bool hasFailedOrCanceledSubresources() const;
- bool equals(const CSSValue&) const;
+ bool equals(const CSSValueObject&) const;
void finalizeGarbageCollectedObject();
DEFINE_INLINE_TRACE_AFTER_DISPATCH() { }
DECLARE_TRACE();
- // ~CSSValue should be public, because non-public ~CSSValue causes C2248
- // error: 'blink::CSSValue::~CSSValue' : cannot access protected member
- // declared in class 'blink::CSSValue' when compiling
+ // ~CSSValueObject should be public, because non-public ~CSSValueObject causes C2248
+ // error: 'blink::CSSValueObject::~CSSValueObject' : cannot access protected member
+ // declared in class 'blink::CSSValueObject' when compiling
// 'source\wtf\refcounted.h' by using msvc.
- ~CSSValue() { }
+ ~CSSValueObject() { }
protected:
@@ -167,7 +164,7 @@ protected:
ClassType classType() const { return static_cast<ClassType>(m_classType); }
- explicit CSSValue(ClassType classType)
+ explicit CSSValueObject(ClassType classType)
: m_primitiveUnitType(0)
, m_hasCachedCSSText(false)
, m_isQuirkValue(false)
@@ -197,16 +194,17 @@ private:
unsigned m_classType : ClassTypeBits; // ClassType
};
-template<typename CSSValueType, size_t inlineCapacity>
-inline bool compareCSSValueVector(const WillBeHeapVector<RefPtrWillBeMember<CSSValueType>, inlineCapacity>& firstVector, const WillBeHeapVector<RefPtrWillBeMember<CSSValueType>, inlineCapacity>& secondVector)
+// TODO(sashab): Remove this; only compareCSSValueVector is needed.
+template<typename CSSValueObjectType, size_t inlineCapacity>
+inline bool compareCSSValueObjectVector(const WillBeHeapVector<RefPtrWillBeMember<CSSValueObjectType>, inlineCapacity>& firstVector, const WillBeHeapVector<RefPtrWillBeMember<CSSValueObjectType>, inlineCapacity>& secondVector)
{
size_t size = firstVector.size();
if (size != secondVector.size())
return false;
for (size_t i = 0; i < size; i++) {
- const RefPtrWillBeMember<CSSValueType>& firstPtr = firstVector[i];
- const RefPtrWillBeMember<CSSValueType>& secondPtr = secondVector[i];
+ const RefPtrWillBeMember<CSSValueObjectType>& firstPtr = firstVector[i];
+ const RefPtrWillBeMember<CSSValueObjectType>& secondPtr = secondVector[i];
if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals(*secondPtr)))
continue;
return false;
@@ -244,9 +242,6 @@ inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<C
return first->equals(*second);
}
-#define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \
- DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predicate)
-
} // namespace blink
-#endif // CSSValue_h
+#endif // CSSValueObject_h
« no previous file with comments | « Source/core/css/CSSValueList.cpp ('k') | Source/core/css/CSSValueObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698