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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 18228003: Remove AtomicStringImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2999 matching lines...) Expand 10 before | Expand all | Expand 10 after
3010 ensureElementRareData()->setHasPendingResources(true); 3010 ensureElementRareData()->setHasPendingResources(true);
3011 } 3011 }
3012 3012
3013 void Element::clearHasPendingResources() 3013 void Element::clearHasPendingResources()
3014 { 3014 {
3015 ensureElementRareData()->setHasPendingResources(false); 3015 ensureElementRareData()->setHasPendingResources(false);
3016 } 3016 }
3017 3017
3018 struct PresentationAttributeCacheKey { 3018 struct PresentationAttributeCacheKey {
3019 PresentationAttributeCacheKey() : tagName(0) { } 3019 PresentationAttributeCacheKey() : tagName(0) { }
3020 AtomicStringImpl* tagName; 3020 StringImpl* tagName;
3021 // Only the values need refcounting. 3021 // Only the values need refcounting.
3022 Vector<pair<AtomicStringImpl*, AtomicString>, 3> attributesAndValues; 3022 Vector<pair<StringImpl*, AtomicString>, 3> attributesAndValues;
3023 }; 3023 };
3024 3024
3025 struct PresentationAttributeCacheEntry { 3025 struct PresentationAttributeCacheEntry {
3026 WTF_MAKE_FAST_ALLOCATED; 3026 WTF_MAKE_FAST_ALLOCATED;
3027 public: 3027 public:
3028 PresentationAttributeCacheKey key; 3028 PresentationAttributeCacheKey key;
3029 RefPtr<StylePropertySet> value; 3029 RefPtr<StylePropertySet> value;
3030 }; 3030 };
3031 3031
3032 typedef HashMap<unsigned, OwnPtr<PresentationAttributeCacheEntry>, AlreadyHashed > PresentationAttributeCache; 3032 typedef HashMap<unsigned, OwnPtr<PresentationAttributeCacheEntry>, AlreadyHashed > PresentationAttributeCache;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
3232 inlineStyleChanged(); 3232 inlineStyleChanged();
3233 } 3233 }
3234 3234
3235 void Element::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const 3235 void Element::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
3236 { 3236 {
3237 ASSERT(isStyledElement()); 3237 ASSERT(isStyledElement());
3238 if (const StylePropertySet* inlineStyle = elementData() ? elementData()->inl ineStyle() : 0) 3238 if (const StylePropertySet* inlineStyle = elementData() ? elementData()->inl ineStyle() : 0)
3239 inlineStyle->addSubresourceStyleURLs(urls, document()->elementSheet()->c ontents()); 3239 inlineStyle->addSubresourceStyleURLs(urls, document()->elementSheet()->c ontents());
3240 } 3240 }
3241 3241
3242 static inline bool attributeNameSort(const pair<AtomicStringImpl*, AtomicString> & p1, const pair<AtomicStringImpl*, AtomicString>& p2) 3242 static inline bool attributeNameSort(const pair<StringImpl*, AtomicString>& p1, const pair<StringImpl*, AtomicString>& p2)
3243 { 3243 {
3244 // Sort based on the attribute name pointers. It doesn't matter what the ord er is as long as it is always the same. 3244 // Sort based on the attribute name pointers. It doesn't matter what the ord er is as long as it is always the same.
3245 return p1.first < p2.first; 3245 return p1.first < p2.first;
3246 } 3246 }
3247 3247
3248 void Element::makePresentationAttributeCacheKey(PresentationAttributeCacheKey& r esult) const 3248 void Element::makePresentationAttributeCacheKey(PresentationAttributeCacheKey& r esult) const
3249 { 3249 {
3250 ASSERT(isStyledElement()); 3250 ASSERT(isStyledElement());
3251 // FIXME: Enable for SVG. 3251 // FIXME: Enable for SVG.
3252 if (namespaceURI() != xhtmlNamespaceURI) 3252 if (namespaceURI() != xhtmlNamespaceURI)
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
3566 return 0; 3566 return 0;
3567 } 3567 }
3568 3568
3569 Attribute* UniqueElementData::attributeItem(unsigned index) 3569 Attribute* UniqueElementData::attributeItem(unsigned index)
3570 { 3570 {
3571 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3571 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3572 return &m_attributeVector.at(index); 3572 return &m_attributeVector.at(index);
3573 } 3573 }
3574 3574
3575 } // namespace WebCore 3575 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698