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

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

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
« Source/core/css/StylePropertySet.h ('K') | « Source/core/css/StylePropertySet.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StylePropertySet.cpp
diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
index c58aaa973909c3427734ff4fcddeb35bc357a0b6..c97360c6e4d656273493c32b94e68b9cd14fb3c0 100644
--- a/Source/core/css/StylePropertySet.cpp
+++ b/Source/core/css/StylePropertySet.cpp
@@ -2,6 +2,7 @@
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
* Copyright (C) 2011 Research In Motion Limited. 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
@@ -51,7 +52,7 @@ static PropertySetCSSOMWrapperMap& propertySetCSSOMWrapperMap()
static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count)
{
- return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*) * count + sizeof(StylePropertyMetadata) * count;
+ return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*) * count + sizeof(uint16_t) * count;
}
PassRefPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
@@ -79,10 +80,11 @@ MutableStylePropertySet::MutableStylePropertySet(const CSSProperty* properties,
ImmutableStylePropertySet::ImmutableStylePropertySet(const CSSProperty* properties, unsigned length, CSSParserMode cssParserMode)
: StylePropertySet(cssParserMode, length)
{
- StylePropertyMetadata* metadataArray = const_cast<StylePropertyMetadata*>(this->metadataArray());
+ uint16_t* metadataArray = const_cast<uint16_t*>(this->metadataArray());
CSSValue** valueArray = const_cast<CSSValue**>(this->valueArray());
for (unsigned i = 0; i < length; ++i) {
- metadataArray[i] = properties[i].metadata();
+ StylePropertyMetadata metadata = properties[i].metadata();
+ metadataArray[i] = *(reinterpret_cast<uint16_t*>(&metadata));
Jeffrey Yasskin 2013/06/21 19:56:27 That reinterpret_cast is undefined behavior; use m
valueArray[i] = properties[i].value();
valueArray[i]->ref();
}
« Source/core/css/StylePropertySet.h ('K') | « Source/core/css/StylePropertySet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698