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

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

Issue 17448021: Make sure ImmutableStylePropertySet uses the new 16 bits size of StylePropertyMetadata. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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: Source/core/css/StylePropertySet.h
diff --git a/Source/core/css/StylePropertySet.h b/Source/core/css/StylePropertySet.h
index 7d40b4973e3e5c8d7adec51c4a4850937f80909b..182a39d29198b399ed4cb0f339a2f70577f31de5 100644
--- a/Source/core/css/StylePropertySet.h
+++ b/Source/core/css/StylePropertySet.h
@@ -1,6 +1,7 @@
/*
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
* Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -154,7 +155,7 @@ public:
unsigned propertyCount() const { return m_arraySize; }
const CSSValue** valueArray() const;
- const StylePropertyMetadata* metadataArray() const;
+ const uint16_t* metadataArray() const;
void* m_storage;
@@ -167,9 +168,9 @@ inline const CSSValue** ImmutableStylePropertySet::valueArray() const
return reinterpret_cast<const CSSValue**>(const_cast<const void**>((&static_cast<const ImmutableStylePropertySet*>(this)->m_storage)));
}
-inline const StylePropertyMetadata* ImmutableStylePropertySet::metadataArray() const
+inline const uint16_t* ImmutableStylePropertySet::metadataArray() const
{
- return reinterpret_cast<const StylePropertyMetadata*>(&reinterpret_cast<const char*>((&static_cast<const ImmutableStylePropertySet*>(this)->m_storage))[m_arraySize * sizeof(CSSValue*)]);
+ return reinterpret_cast<const uint16_t*>(&reinterpret_cast<const char*>((&static_cast<const ImmutableStylePropertySet*>(this)->m_storage))[m_arraySize * sizeof(CSSValue*)]);
Jeffrey Yasskin 2013/06/21 19:56:27 Do you actually need all these casts? 'this' shoul
}
class MutableStylePropertySet : public StylePropertySet {
@@ -230,7 +231,7 @@ inline StylePropertyMetadata StylePropertySet::PropertyReference::propertyMetada
{
if (m_propertySet.isMutable())
return static_cast<const MutableStylePropertySet&>(m_propertySet).m_propertyVector.at(m_index).metadata();
- return static_cast<const ImmutableStylePropertySet&>(m_propertySet).metadataArray()[m_index];
+ return StylePropertyMetadata(static_cast<const ImmutableStylePropertySet&>(m_propertySet).metadataArray()[m_index]);
}
inline const CSSValue* StylePropertySet::PropertyReference::propertyValue() const

Powered by Google App Engine
This is Rietveld 408576698