[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
abarth at webkit.org
abarth at webkit.org
Wed Dec 22 12:29:22 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d34b60020a29768a751fc220c88ac27ee401efb2
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 24 18:33:27 2010 +0000
2010-08-24 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
Partial deployment of adoptPtr to WebCore/html
https://bugs.webkit.org/show_bug.cgi?id=44507
Deploy adoptPtr to some more places in WebCore/html. The big chunk
that I haven't done yet is createRenderer, but that's going to be a big
patch unto itself.
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::formCollectionInfo):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::addElementAlias):
* html/HTMLInputElement.cpp:
(WebCore::createTypeMap):
(WebCore::HTMLInputElement::setInputType):
(WebCore::HTMLInputElement::parseMappedAttribute):
(WebCore::HTMLInputElement::attach):
(WebCore::HTMLInputElement::preDispatchEventHandler):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseMappedAttribute):
(WebCore::HTMLObjectElement::attach):
* html/HTMLToken.h:
(WebCore::HTMLToken::beginDOCTYPE):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::attach):
(WebCore::HTMLVideoElement::parseMappedAttribute):
* html/ValidityState.h:
(WebCore::ValidityState::create):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 437927f..24d9f5e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -5,6 +5,38 @@
Partial deployment of adoptPtr to WebCore/html
https://bugs.webkit.org/show_bug.cgi?id=44507
+ Deploy adoptPtr to some more places in WebCore/html. The big chunk
+ that I haven't done yet is createRenderer, but that's going to be a big
+ patch unto itself.
+
+ * html/HTMLFormCollection.cpp:
+ (WebCore::HTMLFormCollection::formCollectionInfo):
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::addElementAlias):
+ * html/HTMLInputElement.cpp:
+ (WebCore::createTypeMap):
+ (WebCore::HTMLInputElement::setInputType):
+ (WebCore::HTMLInputElement::parseMappedAttribute):
+ (WebCore::HTMLInputElement::attach):
+ (WebCore::HTMLInputElement::preDispatchEventHandler):
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::parseMappedAttribute):
+ (WebCore::HTMLObjectElement::attach):
+ * html/HTMLToken.h:
+ (WebCore::HTMLToken::beginDOCTYPE):
+ * html/HTMLVideoElement.cpp:
+ (WebCore::HTMLVideoElement::attach):
+ (WebCore::HTMLVideoElement::parseMappedAttribute):
+ * html/ValidityState.h:
+ (WebCore::ValidityState::create):
+
+2010-08-24 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Partial deployment of adoptPtr to WebCore/html
+ https://bugs.webkit.org/show_bug.cgi?id=44507
+
There's a lot of places that need adoptPtr in WebCore/html. This patch
does some of them. More will follow.
diff --git a/WebCore/html/HTMLFormCollection.cpp b/WebCore/html/HTMLFormCollection.cpp
index 7a2e63a..4147f29 100644
--- a/WebCore/html/HTMLFormCollection.cpp
+++ b/WebCore/html/HTMLFormCollection.cpp
@@ -39,7 +39,7 @@ using namespace HTMLNames;
inline CollectionCache* HTMLFormCollection::formCollectionInfo(HTMLFormElement* form)
{
if (!form->m_collectionCache)
- form->m_collectionCache.set(new CollectionCache);
+ form->m_collectionCache = adoptPtr(new CollectionCache);
return form->m_collectionCache.get();
}
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index d75de01..c53ea1d 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -529,7 +529,7 @@ void HTMLFormElement::addElementAlias(HTMLFormControlElement* element, const Ato
if (alias.isEmpty())
return;
if (!m_elementAliases)
- m_elementAliases.set(new AliasMap);
+ m_elementAliases = adoptPtr(new AliasMap);
m_elementAliases->set(alias.impl(), element);
}
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 3488cde..071f907 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -743,9 +743,9 @@ void HTMLInputElement::setType(const String& t)
}
typedef HashMap<String, HTMLInputElement::InputType, CaseFoldingHash> InputTypeMap;
-static const InputTypeMap* createTypeMap()
+static PassOwnPtr<InputTypeMap> createTypeMap()
{
- InputTypeMap* map = new InputTypeMap;
+ OwnPtr<InputTypeMap> map = adoptPtr(new InputTypeMap);
map->add("button", HTMLInputElement::BUTTON);
map->add("checkbox", HTMLInputElement::CHECKBOX);
map->add("color", HTMLInputElement::COLOR);
@@ -770,12 +770,12 @@ static const InputTypeMap* createTypeMap()
map->add("url", HTMLInputElement::URL);
map->add("week", HTMLInputElement::WEEK);
// No need to register "text" because it is the default type.
- return map;
+ return map.release();
}
void HTMLInputElement::setInputType(const String& t)
{
- static const InputTypeMap* typeMap = createTypeMap();
+ static const InputTypeMap* typeMap = createTypeMap().leakPtr();
InputType newType = t.isNull() ? TEXT : typeMap->get(t);
// IMPORTANT: Don't allow the type to be changed to FILE after the first
@@ -1082,7 +1082,7 @@ void HTMLInputElement::parseMappedAttribute(Attribute* attr)
} else if (attr->name() == srcAttr) {
if (renderer() && inputType() == IMAGE) {
if (!m_imageLoader)
- m_imageLoader.set(new HTMLImageLoader(this));
+ m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
}
} else if (attr->name() == usemapAttr || attr->name() == accesskeyAttr) {
@@ -1205,7 +1205,7 @@ void HTMLInputElement::attach()
if (inputType() == IMAGE) {
if (!m_imageLoader)
- m_imageLoader.set(new HTMLImageLoader(this));
+ m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElement();
if (renderer() && m_imageLoader->haveFiredBeforeLoadEvent()) {
RenderImage* imageObj = toRenderImage(renderer());
@@ -2048,7 +2048,7 @@ void* HTMLInputElement::preDispatchEventHandler(Event *evt)
if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
&& evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
- EventHandlingState* state = new EventHandlingState(indeterminate(), checked());
+ OwnPtr<EventHandlingState> state = adoptPtr(new EventHandlingState(indeterminate(), checked()));
if (inputType() == CHECKBOX) {
if (indeterminate())
@@ -2070,7 +2070,7 @@ void* HTMLInputElement::preDispatchEventHandler(Event *evt)
setIndeterminate(false);
setChecked(true, true);
}
- result = state;
+ result = state.leakPtr(); // FIXME: Check whether this actually ends up leaking.
}
return result;
}
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index 5989ec7..25e15bc 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -86,7 +86,7 @@ void HTMLObjectElement::parseMappedAttribute(Attribute* attr)
m_needWidgetUpdate = true;
if (renderer() && isImageType()) {
if (!m_imageLoader)
- m_imageLoader.set(new HTMLImageLoader(this));
+ m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
}
} else if (attr->name() == classidAttr) {
@@ -152,7 +152,7 @@ void HTMLObjectElement::attach()
if (isImage && renderer() && !m_useFallbackContent) {
if (!m_imageLoader)
- m_imageLoader.set(new HTMLImageLoader(this));
+ m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElement();
}
}
diff --git a/WebCore/html/HTMLToken.h b/WebCore/html/HTMLToken.h
index e42a829..42cddb8 100644
--- a/WebCore/html/HTMLToken.h
+++ b/WebCore/html/HTMLToken.h
@@ -128,7 +128,7 @@ public:
{
ASSERT(m_type == Uninitialized);
m_type = DOCTYPE;
- m_doctypeData.set(new DoctypeData());
+ m_doctypeData = adoptPtr(new DoctypeData());
}
void beginDOCTYPE(UChar character)
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp
index ed2d35c..cd9c7ec 100644
--- a/WebCore/html/HTMLVideoElement.cpp
+++ b/WebCore/html/HTMLVideoElement.cpp
@@ -76,7 +76,7 @@ void HTMLVideoElement::attach()
updateDisplayState();
if (shouldDisplayPosterImage()) {
if (!m_imageLoader)
- m_imageLoader.set(new HTMLImageLoader(this));
+ m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElement();
if (renderer()) {
RenderImage* imageRenderer = toRenderImage(renderer());
@@ -105,7 +105,7 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr)
#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
if (shouldDisplayPosterImage()) {
if (!m_imageLoader)
- m_imageLoader.set(new HTMLImageLoader(this));
+ m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
} else {
if (m_imageLoader)
diff --git a/WebCore/html/ValidityState.h b/WebCore/html/ValidityState.h
index 04f11a1..eecb9be 100644
--- a/WebCore/html/ValidityState.h
+++ b/WebCore/html/ValidityState.h
@@ -33,7 +33,7 @@ class ValidityState : public Noncopyable {
public:
static PassOwnPtr<ValidityState> create(HTMLFormControlElement* control)
{
- return new ValidityState(control);
+ return adoptPtr(new ValidityState(control));
}
void ref() { m_control->ref(); }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list