Changeset 65917 in webkit
- Timestamp:
- Aug 24, 2010 11:33:27 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65916 r65917 1 2010-08-24 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Partial deployment of adoptPtr to WebCore/html 6 https://bugs.webkit.org/show_bug.cgi?id=44507 7 8 Deploy adoptPtr to some more places in WebCore/html. The big chunk 9 that I haven't done yet is createRenderer, but that's going to be a big 10 patch unto itself. 11 12 * html/HTMLFormCollection.cpp: 13 (WebCore::HTMLFormCollection::formCollectionInfo): 14 * html/HTMLFormElement.cpp: 15 (WebCore::HTMLFormElement::addElementAlias): 16 * html/HTMLInputElement.cpp: 17 (WebCore::createTypeMap): 18 (WebCore::HTMLInputElement::setInputType): 19 (WebCore::HTMLInputElement::parseMappedAttribute): 20 (WebCore::HTMLInputElement::attach): 21 (WebCore::HTMLInputElement::preDispatchEventHandler): 22 * html/HTMLObjectElement.cpp: 23 (WebCore::HTMLObjectElement::parseMappedAttribute): 24 (WebCore::HTMLObjectElement::attach): 25 * html/HTMLToken.h: 26 (WebCore::HTMLToken::beginDOCTYPE): 27 * html/HTMLVideoElement.cpp: 28 (WebCore::HTMLVideoElement::attach): 29 (WebCore::HTMLVideoElement::parseMappedAttribute): 30 * html/ValidityState.h: 31 (WebCore::ValidityState::create): 32 1 33 2010-08-24 Adam Barth <abarth@webkit.org> 2 34 -
trunk/WebCore/html/HTMLFormCollection.cpp
r61094 r65917 40 40 { 41 41 if (!form->m_collectionCache) 42 form->m_collectionCache .set(new CollectionCache);42 form->m_collectionCache = adoptPtr(new CollectionCache); 43 43 return form->m_collectionCache.get(); 44 44 } -
trunk/WebCore/html/HTMLFormElement.cpp
r64110 r65917 530 530 return; 531 531 if (!m_elementAliases) 532 m_elementAliases .set(new AliasMap);532 m_elementAliases = adoptPtr(new AliasMap); 533 533 m_elementAliases->set(alias.impl(), element); 534 534 } -
trunk/WebCore/html/HTMLInputElement.cpp
r65077 r65917 744 744 745 745 typedef HashMap<String, HTMLInputElement::InputType, CaseFoldingHash> InputTypeMap; 746 static const InputTypeMap*createTypeMap()747 { 748 InputTypeMap* map = new InputTypeMap;746 static PassOwnPtr<InputTypeMap> createTypeMap() 747 { 748 OwnPtr<InputTypeMap> map = adoptPtr(new InputTypeMap); 749 749 map->add("button", HTMLInputElement::BUTTON); 750 750 map->add("checkbox", HTMLInputElement::CHECKBOX); … … 771 771 map->add("week", HTMLInputElement::WEEK); 772 772 // No need to register "text" because it is the default type. 773 return map ;773 return map.release(); 774 774 } 775 775 776 776 void HTMLInputElement::setInputType(const String& t) 777 777 { 778 static const InputTypeMap* typeMap = createTypeMap() ;778 static const InputTypeMap* typeMap = createTypeMap().leakPtr(); 779 779 InputType newType = t.isNull() ? TEXT : typeMap->get(t); 780 780 … … 1083 1083 if (renderer() && inputType() == IMAGE) { 1084 1084 if (!m_imageLoader) 1085 m_imageLoader .set(new HTMLImageLoader(this));1085 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 1086 1086 m_imageLoader->updateFromElementIgnoringPreviousError(); 1087 1087 } … … 1206 1206 if (inputType() == IMAGE) { 1207 1207 if (!m_imageLoader) 1208 m_imageLoader .set(new HTMLImageLoader(this));1208 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 1209 1209 m_imageLoader->updateFromElement(); 1210 1210 if (renderer() && m_imageLoader->haveFiredBeforeLoadEvent()) { … … 2049 2049 && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) { 2050 2050 2051 EventHandlingState* state = new EventHandlingState(indeterminate(), checked());2051 OwnPtr<EventHandlingState> state = adoptPtr(new EventHandlingState(indeterminate(), checked())); 2052 2052 2053 2053 if (inputType() == CHECKBOX) { … … 2071 2071 setChecked(true, true); 2072 2072 } 2073 result = state ;2073 result = state.leakPtr(); // FIXME: Check whether this actually ends up leaking. 2074 2074 } 2075 2075 return result; -
trunk/WebCore/html/HTMLObjectElement.cpp
r65468 r65917 87 87 if (renderer() && isImageType()) { 88 88 if (!m_imageLoader) 89 m_imageLoader .set(new HTMLImageLoader(this));89 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 90 90 m_imageLoader->updateFromElementIgnoringPreviousError(); 91 91 } … … 153 153 if (isImage && renderer() && !m_useFallbackContent) { 154 154 if (!m_imageLoader) 155 m_imageLoader .set(new HTMLImageLoader(this));155 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 156 156 m_imageLoader->updateFromElement(); 157 157 } -
trunk/WebCore/html/HTMLToken.h
r65132 r65917 129 129 ASSERT(m_type == Uninitialized); 130 130 m_type = DOCTYPE; 131 m_doctypeData .set(new DoctypeData());131 m_doctypeData = adoptPtr(new DoctypeData()); 132 132 } 133 133 -
trunk/WebCore/html/HTMLVideoElement.cpp
r64997 r65917 77 77 if (shouldDisplayPosterImage()) { 78 78 if (!m_imageLoader) 79 m_imageLoader .set(new HTMLImageLoader(this));79 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 80 80 m_imageLoader->updateFromElement(); 81 81 if (renderer()) { … … 106 106 if (shouldDisplayPosterImage()) { 107 107 if (!m_imageLoader) 108 m_imageLoader .set(new HTMLImageLoader(this));108 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 109 109 m_imageLoader->updateFromElementIgnoringPreviousError(); 110 110 } else { -
trunk/WebCore/html/ValidityState.h
r64805 r65917 34 34 static PassOwnPtr<ValidityState> create(HTMLFormControlElement* control) 35 35 { 36 return new ValidityState(control);36 return adoptPtr(new ValidityState(control)); 37 37 } 38 38
Note: See TracChangeset
for help on using the changeset viewer.