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

Side by Side Diff: sky/engine/core/css/StylePropertySet.cpp

Issue 678003003: Begin to remove heap/* (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/css/RuleSet.cpp ('k') | sky/engine/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. 5 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 30 matching lines...) Expand all
41 namespace blink { 41 namespace blink {
42 42
43 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) 43 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count)
44 { 44 {
45 return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*) * count + sizeof(StylePropertyMetadata) * count; 45 return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*) * count + sizeof(StylePropertyMetadata) * count;
46 } 46 }
47 47
48 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::cre ate(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode) 48 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::cre ate(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
49 { 49 {
50 ASSERT(count <= MaxArraySize); 50 ASSERT(count <= MaxArraySize);
51 #if ENABLE(OILPAN)
52 void* slot = Heap::allocate<StylePropertySet>(sizeForImmutableStylePropertyS etWithPropertyCount(count));
53 #else
54 void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCou nt(count)); 51 void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCou nt(count));
55 #endif // ENABLE(OILPAN)
56 return adoptRefWillBeNoop(new (slot) ImmutableStylePropertySet(properties, c ount, cssParserMode)); 52 return adoptRefWillBeNoop(new (slot) ImmutableStylePropertySet(properties, c ount, cssParserMode));
57 } 53 }
58 54
59 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> StylePropertySet::immutableCop yIfNeeded() const 55 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> StylePropertySet::immutableCop yIfNeeded() const
60 { 56 {
61 if (!isMutable()) 57 if (!isMutable())
62 return toImmutableStylePropertySet(const_cast<StylePropertySet*>(this)); 58 return toImmutableStylePropertySet(const_cast<StylePropertySet*>(this));
63 const MutableStylePropertySet* mutableThis = toMutableStylePropertySet(this) ; 59 const MutableStylePropertySet* mutableThis = toMutableStylePropertySet(this) ;
64 return ImmutableStylePropertySet::create(mutableThis->m_propertyVector.data( ), mutableThis->m_propertyVector.size(), cssParserMode()); 60 return ImmutableStylePropertySet::create(mutableThis->m_propertyVector.data( ), mutableThis->m_propertyVector.size(), cssParserMode());
65 } 61 }
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 result.appendLiteral(": "); 597 result.appendLiteral(": ");
602 result.append(propertyValue()->cssText()); 598 result.append(propertyValue()->cssText());
603 if (isImportant()) 599 if (isImportant())
604 result.appendLiteral(" !important"); 600 result.appendLiteral(" !important");
605 result.append(';'); 601 result.append(';');
606 return result.toString(); 602 return result.toString();
607 } 603 }
608 604
609 605
610 } // namespace blink 606 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/RuleSet.cpp ('k') | sky/engine/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698