Changeset 175648 in webkit
- Timestamp:
- Nov 5, 2014 4:16:27 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r175647 r175648 1 2014-11-05 Chris Dumez <cdumez@apple.com> 2 3 Allow constructing a PassRef from a Ref 4 https://bugs.webkit.org/show_bug.cgi?id=138389 5 6 Reviewed by Andreas Kling. 7 8 Allow constructing a PassRef from a Ref, similarly to PassRefPtr that 9 can be constructed from a RefPtr already. This avoids having to call 10 Ref::get() and simplifies the code a bit. 11 12 * wtf/PassRef.h: 13 (WTF::PassRef<T>::PassRef): 14 1 15 2014-11-05 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/Source/WTF/wtf/PassRef.h
r175583 r175648 41 41 PassRef(T&); 42 42 PassRef(PassRef&&); 43 template<typename U> PassRef(const Ref<U>&); 43 44 template<typename U> PassRef(PassRef<U>); 44 45 … … 97 98 #endif 98 99 { 100 } 101 102 template<typename T> template<typename U> inline PassRef<T>::PassRef(const Ref<U>& other) 103 : m_reference(const_cast<T&>(other.get())) 104 #ifndef NDEBUG 105 , m_gaveUpReference(false) 106 #endif 107 { 108 m_reference.ref(); 99 109 } 100 110 -
trunk/Source/WebCore/ChangeLog
r175647 r175648 1 2014-11-05 Chris Dumez <cdumez@apple.com> 2 3 Allow constructing a PassRef from a Ref 4 https://bugs.webkit.org/show_bug.cgi?id=138389 5 6 Reviewed by Andreas Kling. 7 8 Remove calls to Ref::get() now that a PassRef can be directly 9 constructed from a Ref. 10 11 No new tests, no behavior change. 12 13 * css/CSSValuePool.cpp: 14 (WebCore::CSSValuePool::createColorValue): 15 * css/CSSValuePool.h: 16 (WebCore::CSSValuePool::createInheritedValue): 17 (WebCore::CSSValuePool::createImplicitInitialValue): 18 (WebCore::CSSValuePool::createExplicitInitialValue): 19 * html/HTMLLinkElement.cpp: 20 (WebCore::HTMLLinkElement::setCSSStyleSheet): 21 1 22 2014-11-05 Dan Bernstein <mitz@apple.com> 2 23 -
trunk/Source/WebCore/css/CSSValuePool.cpp
r166486 r175648 70 70 // These are the empty and deleted values of the hash table. 71 71 if (rgbValue == Color::transparent) 72 return m_colorTransparent .get();72 return m_colorTransparent; 73 73 if (rgbValue == Color::white) 74 return m_colorWhite .get();74 return m_colorWhite; 75 75 // Just because it is common. 76 76 if (rgbValue == Color::black) 77 return m_colorBlack .get();77 return m_colorBlack; 78 78 79 79 // Remove one entry at random if the cache grows too large. -
trunk/Source/WebCore/css/CSSValuePool.h
r167936 r175648 46 46 PassRefPtr<CSSValueList> createFontFaceValue(const AtomicString&); 47 47 PassRef<CSSPrimitiveValue> createFontFamilyValue(const String&); 48 PassRef<CSSInheritedValue> createInheritedValue() { return m_inheritedValue .get(); }49 PassRef<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue .get(); }50 PassRef<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue .get(); }48 PassRef<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; } 49 PassRef<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; } 50 PassRef<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue; } 51 51 PassRef<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier); 52 52 PassRef<CSSPrimitiveValue> createIdentifierValue(CSSPropertyID identifier); -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r175583 r175648 329 329 330 330 Ref<StyleSheetContents> styleSheet(StyleSheetContents::create(href, parserContext)); 331 m_sheet = CSSStyleSheet::create(styleSheet .get(), this);331 m_sheet = CSSStyleSheet::create(styleSheet, this); 332 332 m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(m_media)); 333 333 m_sheet->setTitle(title()); … … 340 340 341 341 if (styleSheet.get().isCacheable()) 342 const_cast<CachedCSSStyleSheet*>(cachedStyleSheet)->saveParsedStyleSheet(styleSheet .get());342 const_cast<CachedCSSStyleSheet*>(cachedStyleSheet)->saveParsedStyleSheet(styleSheet); 343 343 } 344 344
Note: See TracChangeset
for help on using the changeset viewer.