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

Side by Side Diff: third_party/WebKit/Source/core/css/StylePropertySet.cpp

Issue 1474213002: [PartitionAlloc] Annotate common Blink types for heap profiling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctti
Patch Set: Mark template specialisations as WTF_EXPORT 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 unified diff | Download patch
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 { 45 {
46 return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(RawPtrWill BeMember<CSSValue>) * count + sizeof(StylePropertyMetadata) * count; 46 return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(RawPtrWill BeMember<CSSValue>) * count + sizeof(StylePropertyMetadata) * count;
47 } 47 }
48 48
49 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::cre ate(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode) 49 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::cre ate(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
50 { 50 {
51 ASSERT(count <= MaxArraySize); 51 ASSERT(count <= MaxArraySize);
52 #if ENABLE(OILPAN) 52 #if ENABLE(OILPAN)
53 void* slot = Heap::allocate<StylePropertySet>(sizeForImmutableStylePropertyS etWithPropertyCount(count)); 53 void* slot = Heap::allocate<StylePropertySet>(sizeForImmutableStylePropertyS etWithPropertyCount(count));
54 #else 54 #else
55 void* slot = WTF::Partitions::fastMalloc(sizeForImmutableStylePropertySetWit hPropertyCount(count), WTF_HEAP_PROFILER_TYPE_NAME(ImmutableStylePropertySet)); 55 void* slot = WTF::Partitions::fastMalloc(sizeForImmutableStylePropertySetWit hPropertyCount(count), "blink::ImmutableStylePropertySet");
56 #endif // ENABLE(OILPAN) 56 #endif // ENABLE(OILPAN)
57 return adoptRefWillBeNoop(new (slot) ImmutableStylePropertySet(properties, c ount, cssParserMode)); 57 return adoptRefWillBeNoop(new (slot) ImmutableStylePropertySet(properties, c ount, cssParserMode));
58 } 58 }
59 59
60 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> StylePropertySet::immutableCop yIfNeeded() const 60 PassRefPtrWillBeRawPtr<ImmutableStylePropertySet> StylePropertySet::immutableCop yIfNeeded() const
61 { 61 {
62 if (!isMutable()) 62 if (!isMutable())
63 return toImmutableStylePropertySet(const_cast<StylePropertySet*>(this)); 63 return toImmutableStylePropertySet(const_cast<StylePropertySet*>(this));
64 const MutableStylePropertySet* mutableThis = toMutableStylePropertySet(this) ; 64 const MutableStylePropertySet* mutableThis = toMutableStylePropertySet(this) ;
65 return ImmutableStylePropertySet::create(mutableThis->m_propertyVector.data( ), mutableThis->m_propertyVector.size(), cssParserMode()); 65 return ImmutableStylePropertySet::create(mutableThis->m_propertyVector.data( ), mutableThis->m_propertyVector.size(), cssParserMode());
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 { 585 {
586 return adoptRefWillBeNoop(new MutableStylePropertySet(cssParserMode)); 586 return adoptRefWillBeNoop(new MutableStylePropertySet(cssParserMode));
587 } 587 }
588 588
589 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create( const CSSProperty* properties, unsigned count) 589 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create( const CSSProperty* properties, unsigned count)
590 { 590 {
591 return adoptRefWillBeNoop(new MutableStylePropertySet(properties, count)); 591 return adoptRefWillBeNoop(new MutableStylePropertySet(properties, count));
592 } 592 }
593 593
594 } // namespace blink 594 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValue.h ('k') | third_party/WebKit/Source/core/css/StyleRule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698