Changeset 34432 in webkit


Ignore:
Timestamp:
Jun 7, 2008 3:51:37 PM (16 years ago)
Author:
Darin Adler
Message:

WebCore:

2008-06-07 Darin Adler <Darin Adler>

Reviewed by Mitz.

  • bindings/js/JSCanvasRenderingContext2DCustom.cpp: (WebCore::toHTMLCanvasStyle):
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::findOrCreateJSEventListener): (WebCore::JSDOMWindowBase::findOrCreateJSUnprotectedEventListener):
  • bindings/js/JSNodeFilterCondition.h: (WebCore::JSNodeFilterCondition::create):
  • bindings/js/JSNodeFilterCustom.cpp: (WebCore::toNodeFilter):
  • bindings/js/JSSVGLazyEventListener.h: (WebCore::JSSVGLazyEventListener::create):
  • bindings/js/JSSVGMatrixCustom.cpp: (WebCore::JSSVGMatrix::multiply): (WebCore::JSSVGMatrix::inverse): (WebCore::JSSVGMatrix::translate): (WebCore::JSSVGMatrix::scale): (WebCore::JSSVGMatrix::scaleNonUniform): (WebCore::JSSVGMatrix::rotate): (WebCore::JSSVGMatrix::rotateFromVector): (WebCore::JSSVGMatrix::flipX): (WebCore::JSSVGMatrix::flipY): (WebCore::JSSVGMatrix::skewX): (WebCore::JSSVGMatrix::skewY):
  • bindings/js/JSSVGPODTypeWrapper.h: (WebCore::JSSVGPODTypeWrapperCreatorReadWrite::create): (WebCore::JSSVGPODTypeWrapperCreatorReadWrite::JSSVGPODTypeWrapperCreatorReadWrite): (WebCore::JSSVGPODTypeWrapperCreatorReadOnly::create): (WebCore::JSSVGPODTypeWrapperCreatorReadOnly::JSSVGPODTypeWrapperCreatorReadOnly): (WebCore::JSSVGPODTypeWrapperCreatorForList::create): (WebCore::JSSVGPODTypeWrapperCreatorForList::JSSVGPODTypeWrapperCreatorForList): (WebCore::JSSVGPODTypeWrapperCache::lookupOrCreateWrapper): (WebCore::JSSVGPODTypeWrapperCache::forgetWrapper):
  • bindings/js/JSSVGPointListCustom.cpp: (WebCore::commonExit): (WebCore::commonExitReadOnly): (WebCore::JSSVGPointList::initialize): (WebCore::JSSVGPointList::getItem): (WebCore::JSSVGPointList::insertItemBefore): (WebCore::JSSVGPointList::replaceItem): (WebCore::JSSVGPointList::removeItem): (WebCore::JSSVGPointList::appendItem):
  • bindings/js/JSSVGTransformListCustom.cpp: (WebCore::JSSVGTransformList::initialize): (WebCore::JSSVGTransformList::getItem): (WebCore::JSSVGTransformList::insertItemBefore): (WebCore::JSSVGTransformList::replaceItem): (WebCore::JSSVGTransformList::removeItem): (WebCore::JSSVGTransformList::appendItem):
  • bindings/js/kjs_binding.cpp: (WebCore::setDOMException):
  • bindings/js/kjs_events.h: (WebCore::JSUnprotectedEventListener::create): (WebCore::JSEventListener::create): (WebCore::JSLazyEventListener::create):
  • bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::createHTMLEventHandler): (WebCore::KJSProxy::createSVGEventHandler):
  • bindings/objc/DOM.mm: (WebCore::ObjCNodeFilterCondition::create): (WebCore::ObjCNodeFilterCondition::ObjCNodeFilterCondition): (WebCore::ObjCNodeFilterCondition::acceptNode): (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]): (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]):
  • bindings/scripts/CodeGeneratorJS.pm:
  • css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForNinePieceImage): (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
  • css/CSSFontFace.h: (WebCore::CSSFontFace::create): (WebCore::CSSFontFace::CSSFontFace):
  • css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::addFontFaceRule):
  • css/CSSParser.cpp: (WebCore::CSSParser::parseDashboardRegions): (WebCore::CSSParser::parseCounterContent): (WebCore::CSSParser::parseShape): (WebCore::BorderImageParseContext::commitBorderImage):
  • css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
  • css/CSSSegmentedFontFace.h: (WebCore::CSSSegmentedFontFace::create):
  • css/Counter.h: (WebCore::Counter::create): (WebCore::Counter::Counter):
  • css/DashboardRegion.h: (WebCore::DashboardRegion::create): (WebCore::DashboardRegion::DashboardRegion):
  • css/Rect.h: (WebCore::Rect::create): (WebCore::Rect::Rect):
  • dom/ChildNodeList.h: (WebCore::ChildNodeList::create):
  • dom/ClassNodeList.h: (WebCore::ClassNodeList::create):
  • dom/Clipboard.h:
  • dom/DOMCoreException.h: (WebCore::DOMCoreException::create):
  • dom/DOMImplementation.cpp: (WebCore::DOMImplementation::instance):
  • dom/DOMImplementation.h: (WebCore::DOMImplementation::DOMImplementation):
  • dom/Document.cpp: (WebCore::Document::addWindowEventListener): (WebCore::Document::removeWindowEventListener): (WebCore::Document::setDecoder): (WebCore::Document::images): (WebCore::Document::applets): (WebCore::Document::embeds): (WebCore::Document::plugins): (WebCore::Document::objects): (WebCore::Document::scripts): (WebCore::Document::links): (WebCore::Document::forms): (WebCore::Document::anchors): (WebCore::Document::all): (WebCore::Document::windowNamedItems): (WebCore::Document::documentNamedItems):
  • dom/Document.h:
  • dom/DynamicNodeList.h:
  • dom/EventException.h: (WebCore::EventException::create): (WebCore::EventException::EventException):
  • dom/EventListener.h:
  • dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::removeEventListener):
  • dom/ExceptionBase.cpp: (WebCore::ExceptionBase::ExceptionBase):
  • dom/ExceptionBase.h:
  • dom/NameNodeList.h: (WebCore::NameNodeList::create):
  • dom/Node.cpp: (WebCore::Node::childNodes): (WebCore::Node::getElementsByTagNameNS): (WebCore::Node::getElementsByName): (WebCore::Node::getElementsByClassName): (WebCore::Node::querySelectorAll):
  • dom/NodeFilterCondition.h:
  • dom/NodeList.h:
  • dom/RangeException.h: (WebCore::RangeException::create): (WebCore::RangeException::RangeException):
  • dom/RegisteredEventListener.h: (WebCore::RegisteredEventListener::create):
  • dom/SelectorNodeList.cpp: (WebCore::createSelectorNodeList):
  • dom/SelectorNodeList.h:
  • dom/StaticNodeList.cpp: (WebCore::StaticNodeList::StaticNodeList):
  • dom/StaticNodeList.h: (WebCore::StaticNodeList::adopt):
  • dom/TagNodeList.h: (WebCore::TagNodeList::create):
  • history/HistoryItem.cpp: (WebCore::defaultNotifyHistoryItemChanged): (WebCore::HistoryItem::HistoryItem): (WebCore::HistoryItem::copy):
  • history/HistoryItem.h: (WebCore::HistoryItem::create):
  • html/CanvasGradient.h:
  • html/CanvasPattern.cpp: (WebCore::CanvasPattern::CanvasPattern):
  • html/CanvasPattern.h: (WebCore::CanvasPattern::create):
  • html/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::State::State): (WebCore::CanvasRenderingContext2D::setStrokeColor): (WebCore::CanvasRenderingContext2D::setFillColor): (WebCore::CanvasRenderingContext2D::createPattern):
  • html/CanvasStyle.cpp: (WebCore::CanvasStyle::CanvasStyle):
  • html/CanvasStyle.h: (WebCore::CanvasStyle::create):
  • html/HTMLCollection.cpp: (WebCore::HTMLCollection::HTMLCollection): (WebCore::HTMLCollection::create):
  • html/HTMLCollection.h:
  • html/HTMLElement.cpp: (WebCore::HTMLElement::children):
  • html/HTMLFormCollection.cpp: (WebCore::HTMLFormCollection::create):
  • html/HTMLFormCollection.h:
  • html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::elements):
  • html/HTMLMapElement.cpp: (WebCore::HTMLMapElement::areas):
  • html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::load): (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged): (WebCore::HTMLMediaElement::willSaveToCache):
  • html/HTMLNameCollection.h: (WebCore::HTMLNameCollection::create):
  • html/HTMLOptionsCollection.cpp: (WebCore::HTMLOptionsCollection::create):
  • html/HTMLOptionsCollection.h:
  • html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::options):
  • html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::rows): (WebCore::HTMLTableElement::tBodies):
  • html/HTMLTableRowElement.cpp: (WebCore::HTMLTableRowElement::cells):
  • html/HTMLTableRowsCollection.cpp: (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): (WebCore::HTMLTableRowsCollection::create):
  • html/HTMLTableRowsCollection.h:
  • html/HTMLTableSectionElement.cpp: (WebCore::HTMLTableSectionElement::rows):
  • html/MediaError.h: (WebCore::MediaError::create): (WebCore::MediaError::MediaError):
  • loader/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
  • loader/CachedFont.cpp: (WebCore::CachedFont::ensureSVGFontData):
  • loader/CachedXSLStyleSheet.cpp: (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::write): (WebCore::FrameLoader::createHistoryItem):
  • loader/ImageDocument.cpp: (WebCore::ImageEventListener::create): (WebCore::ImageEventListener::ImageEventListener): (WebCore::ImageDocument::createDocumentStructure):
  • loader/TextResourceDecoder.h: (WebCore::TextResourceDecoder::create):
  • page/Page.cpp: (WebCore::Page::userStyleSheet):
  • svg/SVGException.h: (WebCore::SVGException::create): (WebCore::SVGException::SVGException):
  • svg/animation/SVGSMILElement.cpp: (WebCore::ConditionEventListener::create): (WebCore::ConditionEventListener::ConditionEventListener): (WebCore::SVGSMILElement::connectConditions):
  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveData):
  • xml/XMLHttpRequestException.h: (WebCore::XMLHttpRequestException::create): (WebCore::XMLHttpRequestException::XMLHttpRequestException):
  • xml/XPathException.h: (WebCore::XPathException::create): (WebCore::XPathException::XPathException):
  • xml/XPathResult.cpp: (WebCore::InvalidatingEventListener::create): (WebCore::InvalidatingEventListener::InvalidatingEventListener): (WebCore::XPathResult::XPathResult):
  • xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::createDocumentFromSource):

WebKit/mac:

2008-06-07 Darin Adler <Darin Adler>

Reviewed by Mitz.

  • History/WebHistoryItem.mm: (-[WebHistoryItem init]): (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]): (-[WebHistoryItem initWithURL:target:parent:title:]): (-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]):
  • WebView/WebView.mm: (+[WebView _decodeData:]):

WebKit/win:

2008-06-07 Darin Adler <Darin Adler>

Reviewed by Mitz.

  • WebHistoryItem.cpp: (WebHistoryItem::createInstance): (WebHistoryItem::initFromDictionaryRepresentation): (WebHistoryItem::initWithURLString):
Location:
trunk
Files:
100 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r34426 r34432  
     12008-06-07  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Mitz.
     4
     5        - work on https://bugs.webkit.org/show_bug.cgi?id=17257
     6          start ref counts at 1 instead of 0 for speed
     7
     8        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
     9        (WebCore::toHTMLCanvasStyle):
     10        * bindings/js/JSDOMWindowBase.cpp:
     11        (WebCore::JSDOMWindowBase::findOrCreateJSEventListener):
     12        (WebCore::JSDOMWindowBase::findOrCreateJSUnprotectedEventListener):
     13        * bindings/js/JSNodeFilterCondition.h:
     14        (WebCore::JSNodeFilterCondition::create):
     15        * bindings/js/JSNodeFilterCustom.cpp:
     16        (WebCore::toNodeFilter):
     17        * bindings/js/JSSVGLazyEventListener.h:
     18        (WebCore::JSSVGLazyEventListener::create):
     19        * bindings/js/JSSVGMatrixCustom.cpp:
     20        (WebCore::JSSVGMatrix::multiply):
     21        (WebCore::JSSVGMatrix::inverse):
     22        (WebCore::JSSVGMatrix::translate):
     23        (WebCore::JSSVGMatrix::scale):
     24        (WebCore::JSSVGMatrix::scaleNonUniform):
     25        (WebCore::JSSVGMatrix::rotate):
     26        (WebCore::JSSVGMatrix::rotateFromVector):
     27        (WebCore::JSSVGMatrix::flipX):
     28        (WebCore::JSSVGMatrix::flipY):
     29        (WebCore::JSSVGMatrix::skewX):
     30        (WebCore::JSSVGMatrix::skewY):
     31        * bindings/js/JSSVGPODTypeWrapper.h:
     32        (WebCore::JSSVGPODTypeWrapperCreatorReadWrite::create):
     33        (WebCore::JSSVGPODTypeWrapperCreatorReadWrite::JSSVGPODTypeWrapperCreatorReadWrite):
     34        (WebCore::JSSVGPODTypeWrapperCreatorReadOnly::create):
     35        (WebCore::JSSVGPODTypeWrapperCreatorReadOnly::JSSVGPODTypeWrapperCreatorReadOnly):
     36        (WebCore::JSSVGPODTypeWrapperCreatorForList::create):
     37        (WebCore::JSSVGPODTypeWrapperCreatorForList::JSSVGPODTypeWrapperCreatorForList):
     38        (WebCore::JSSVGPODTypeWrapperCache::lookupOrCreateWrapper):
     39        (WebCore::JSSVGPODTypeWrapperCache::forgetWrapper):
     40        * bindings/js/JSSVGPointListCustom.cpp:
     41        (WebCore::commonExit):
     42        (WebCore::commonExitReadOnly):
     43        (WebCore::JSSVGPointList::initialize):
     44        (WebCore::JSSVGPointList::getItem):
     45        (WebCore::JSSVGPointList::insertItemBefore):
     46        (WebCore::JSSVGPointList::replaceItem):
     47        (WebCore::JSSVGPointList::removeItem):
     48        (WebCore::JSSVGPointList::appendItem):
     49        * bindings/js/JSSVGTransformListCustom.cpp:
     50        (WebCore::JSSVGTransformList::initialize):
     51        (WebCore::JSSVGTransformList::getItem):
     52        (WebCore::JSSVGTransformList::insertItemBefore):
     53        (WebCore::JSSVGTransformList::replaceItem):
     54        (WebCore::JSSVGTransformList::removeItem):
     55        (WebCore::JSSVGTransformList::appendItem):
     56        * bindings/js/kjs_binding.cpp:
     57        (WebCore::setDOMException):
     58        * bindings/js/kjs_events.h:
     59        (WebCore::JSUnprotectedEventListener::create):
     60        (WebCore::JSEventListener::create):
     61        (WebCore::JSLazyEventListener::create):
     62        * bindings/js/kjs_proxy.cpp:
     63        (WebCore::KJSProxy::createHTMLEventHandler):
     64        (WebCore::KJSProxy::createSVGEventHandler):
     65        * bindings/objc/DOM.mm:
     66        (WebCore::ObjCNodeFilterCondition::create):
     67        (WebCore::ObjCNodeFilterCondition::ObjCNodeFilterCondition):
     68        (WebCore::ObjCNodeFilterCondition::acceptNode):
     69        (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]):
     70        (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]):
     71        * bindings/scripts/CodeGeneratorJS.pm:
     72        * css/CSSComputedStyleDeclaration.cpp:
     73        (WebCore::valueForNinePieceImage):
     74        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     75        * css/CSSFontFace.h:
     76        (WebCore::CSSFontFace::create):
     77        (WebCore::CSSFontFace::CSSFontFace):
     78        * css/CSSFontSelector.cpp:
     79        (WebCore::CSSFontSelector::addFontFaceRule):
     80        * css/CSSParser.cpp:
     81        (WebCore::CSSParser::parseDashboardRegions):
     82        (WebCore::CSSParser::parseCounterContent):
     83        (WebCore::CSSParser::parseShape):
     84        (WebCore::BorderImageParseContext::commitBorderImage):
     85        * css/CSSSegmentedFontFace.cpp:
     86        (WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
     87        * css/CSSSegmentedFontFace.h:
     88        (WebCore::CSSSegmentedFontFace::create):
     89        * css/Counter.h:
     90        (WebCore::Counter::create):
     91        (WebCore::Counter::Counter):
     92        * css/DashboardRegion.h:
     93        (WebCore::DashboardRegion::create):
     94        (WebCore::DashboardRegion::DashboardRegion):
     95        * css/Rect.h:
     96        (WebCore::Rect::create):
     97        (WebCore::Rect::Rect):
     98        * dom/ChildNodeList.h:
     99        (WebCore::ChildNodeList::create):
     100        * dom/ClassNodeList.h:
     101        (WebCore::ClassNodeList::create):
     102        * dom/Clipboard.h:
     103        * dom/DOMCoreException.h:
     104        (WebCore::DOMCoreException::create):
     105        * dom/DOMImplementation.cpp:
     106        (WebCore::DOMImplementation::instance):
     107        * dom/DOMImplementation.h:
     108        (WebCore::DOMImplementation::DOMImplementation):
     109        * dom/Document.cpp:
     110        (WebCore::Document::addWindowEventListener):
     111        (WebCore::Document::removeWindowEventListener):
     112        (WebCore::Document::setDecoder):
     113        (WebCore::Document::images):
     114        (WebCore::Document::applets):
     115        (WebCore::Document::embeds):
     116        (WebCore::Document::plugins):
     117        (WebCore::Document::objects):
     118        (WebCore::Document::scripts):
     119        (WebCore::Document::links):
     120        (WebCore::Document::forms):
     121        (WebCore::Document::anchors):
     122        (WebCore::Document::all):
     123        (WebCore::Document::windowNamedItems):
     124        (WebCore::Document::documentNamedItems):
     125        * dom/Document.h:
     126        * dom/DynamicNodeList.h:
     127        * dom/EventException.h:
     128        (WebCore::EventException::create):
     129        (WebCore::EventException::EventException):
     130        * dom/EventListener.h:
     131        * dom/EventTarget.cpp:
     132        (WebCore::EventTarget::addEventListener):
     133        (WebCore::EventTarget::removeEventListener):
     134        * dom/ExceptionBase.cpp:
     135        (WebCore::ExceptionBase::ExceptionBase):
     136        * dom/ExceptionBase.h:
     137        * dom/NameNodeList.h:
     138        (WebCore::NameNodeList::create):
     139        * dom/Node.cpp:
     140        (WebCore::Node::childNodes):
     141        (WebCore::Node::getElementsByTagNameNS):
     142        (WebCore::Node::getElementsByName):
     143        (WebCore::Node::getElementsByClassName):
     144        (WebCore::Node::querySelectorAll):
     145        * dom/NodeFilterCondition.h:
     146        * dom/NodeList.h:
     147        * dom/RangeException.h:
     148        (WebCore::RangeException::create):
     149        (WebCore::RangeException::RangeException):
     150        * dom/RegisteredEventListener.h:
     151        (WebCore::RegisteredEventListener::create):
     152        * dom/SelectorNodeList.cpp:
     153        (WebCore::createSelectorNodeList):
     154        * dom/SelectorNodeList.h:
     155        * dom/StaticNodeList.cpp:
     156        (WebCore::StaticNodeList::StaticNodeList):
     157        * dom/StaticNodeList.h:
     158        (WebCore::StaticNodeList::adopt):
     159        * dom/TagNodeList.h:
     160        (WebCore::TagNodeList::create):
     161        * history/HistoryItem.cpp:
     162        (WebCore::defaultNotifyHistoryItemChanged):
     163        (WebCore::HistoryItem::HistoryItem):
     164        (WebCore::HistoryItem::copy):
     165        * history/HistoryItem.h:
     166        (WebCore::HistoryItem::create):
     167        * html/CanvasGradient.h:
     168        * html/CanvasPattern.cpp:
     169        (WebCore::CanvasPattern::CanvasPattern):
     170        * html/CanvasPattern.h:
     171        (WebCore::CanvasPattern::create):
     172        * html/CanvasRenderingContext2D.cpp:
     173        (WebCore::CanvasRenderingContext2D::State::State):
     174        (WebCore::CanvasRenderingContext2D::setStrokeColor):
     175        (WebCore::CanvasRenderingContext2D::setFillColor):
     176        (WebCore::CanvasRenderingContext2D::createPattern):
     177        * html/CanvasStyle.cpp:
     178        (WebCore::CanvasStyle::CanvasStyle):
     179        * html/CanvasStyle.h:
     180        (WebCore::CanvasStyle::create):
     181        * html/HTMLCollection.cpp:
     182        (WebCore::HTMLCollection::HTMLCollection):
     183        (WebCore::HTMLCollection::create):
     184        * html/HTMLCollection.h:
     185        * html/HTMLElement.cpp:
     186        (WebCore::HTMLElement::children):
     187        * html/HTMLFormCollection.cpp:
     188        (WebCore::HTMLFormCollection::create):
     189        * html/HTMLFormCollection.h:
     190        * html/HTMLFormElement.cpp:
     191        (WebCore::HTMLFormElement::elements):
     192        * html/HTMLMapElement.cpp:
     193        (WebCore::HTMLMapElement::areas):
     194        * html/HTMLMediaElement.cpp:
     195        (WebCore::HTMLMediaElement::load):
     196        (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
     197        (WebCore::HTMLMediaElement::willSaveToCache):
     198        * html/HTMLNameCollection.h:
     199        (WebCore::HTMLNameCollection::create):
     200        * html/HTMLOptionsCollection.cpp:
     201        (WebCore::HTMLOptionsCollection::create):
     202        * html/HTMLOptionsCollection.h:
     203        * html/HTMLSelectElement.cpp:
     204        (WebCore::HTMLSelectElement::options):
     205        * html/HTMLTableElement.cpp:
     206        (WebCore::HTMLTableElement::rows):
     207        (WebCore::HTMLTableElement::tBodies):
     208        * html/HTMLTableRowElement.cpp:
     209        (WebCore::HTMLTableRowElement::cells):
     210        * html/HTMLTableRowsCollection.cpp:
     211        (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
     212        (WebCore::HTMLTableRowsCollection::create):
     213        * html/HTMLTableRowsCollection.h:
     214        * html/HTMLTableSectionElement.cpp:
     215        (WebCore::HTMLTableSectionElement::rows):
     216        * html/MediaError.h:
     217        (WebCore::MediaError::create):
     218        (WebCore::MediaError::MediaError):
     219        * loader/CachedCSSStyleSheet.cpp:
     220        (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
     221        * loader/CachedFont.cpp:
     222        (WebCore::CachedFont::ensureSVGFontData):
     223        * loader/CachedXSLStyleSheet.cpp:
     224        (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
     225        * loader/FrameLoader.cpp:
     226        (WebCore::FrameLoader::write):
     227        (WebCore::FrameLoader::createHistoryItem):
     228        * loader/ImageDocument.cpp:
     229        (WebCore::ImageEventListener::create):
     230        (WebCore::ImageEventListener::ImageEventListener):
     231        (WebCore::ImageDocument::createDocumentStructure):
     232        * loader/TextResourceDecoder.h:
     233        (WebCore::TextResourceDecoder::create):
     234        * page/Page.cpp:
     235        (WebCore::Page::userStyleSheet):
     236        * svg/SVGException.h:
     237        (WebCore::SVGException::create):
     238        (WebCore::SVGException::SVGException):
     239        * svg/animation/SVGSMILElement.cpp:
     240        (WebCore::ConditionEventListener::create):
     241        (WebCore::ConditionEventListener::ConditionEventListener):
     242        (WebCore::SVGSMILElement::connectConditions):
     243        * xml/XMLHttpRequest.cpp:
     244        (WebCore::XMLHttpRequest::didReceiveData):
     245        * xml/XMLHttpRequestException.h:
     246        (WebCore::XMLHttpRequestException::create):
     247        (WebCore::XMLHttpRequestException::XMLHttpRequestException):
     248        * xml/XPathException.h:
     249        (WebCore::XPathException::create):
     250        (WebCore::XPathException::XPathException):
     251        * xml/XPathResult.cpp:
     252        (WebCore::InvalidatingEventListener::create):
     253        (WebCore::InvalidatingEventListener::InvalidatingEventListener):
     254        (WebCore::XPathResult::XPathResult):
     255        * xml/XSLTProcessor.cpp:
     256        (WebCore::XSLTProcessor::createDocumentFromSource):
     257
    12582008-06-07  Christian Dywan  <christian@twotoasts.de>
    2259
  • trunk/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp

    r33038 r34432  
    5353{
    5454    if (value->isString())
    55         return new CanvasStyle(value->toString(exec));
     55        return CanvasStyle::create(value->toString(exec));
    5656    if (!value->isObject())
    5757        return 0;
    5858    JSObject* object = static_cast<JSObject*>(value);
    5959    if (object->inherits(&JSCanvasGradient::s_info))
    60         return new CanvasStyle(static_cast<JSCanvasGradient*>(object)->impl());
     60        return CanvasStyle::create(static_cast<JSCanvasGradient*>(object)->impl());
    6161    if (object->inherits(&JSCanvasPattern::s_info))
    62         return new CanvasStyle(static_cast<JSCanvasPattern*>(object)->impl());
     62        return CanvasStyle::create(static_cast<JSCanvasPattern*>(object)->impl());
    6363    return 0;
    6464}
  • trunk/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp

    r33979 r34432  
    7474    if (!frame)
    7575        return jsUndefined();
    76     JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
     76    RefPtr<JSUnprotectedEventListener> listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
    7777    if (!listener)
    7878        return jsUndefined();
    79     impl()->addEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec));
     79    impl()->addEventListener(args[0]->toString(exec), listener.release(), args[2]->toBoolean(exec));
    8080    return jsUndefined();
    8181}
     
    8686    if (!frame)
    8787        return jsUndefined();
    88     JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
     88    JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findJSUnprotectedEventListener(args[1], true);
    8989    if (!listener)
    9090        return jsUndefined();
  • trunk/WebCore/bindings/js/JSDOMWindowBase.cpp

    r34355 r34432  
    818818}
    819819
    820 JSEventListener* JSDOMWindowBase::findOrCreateJSEventListener(JSValue* val, bool html)
     820PassRefPtr<JSEventListener> JSDOMWindowBase::findOrCreateJSEventListener(JSValue* val, bool html)
    821821{
    822822    JSEventListener* listener = findJSEventListener(val, html);
     
    829829
    830830    // Note that the JSEventListener constructor adds it to our jsEventListeners list
    831     return new JSEventListener(object, static_cast<JSDOMWindow*>(this), html);
     831    return JSEventListener::create(object, static_cast<JSDOMWindow*>(this), html).get();
    832832}
    833833
     
    841841}
    842842
    843 JSUnprotectedEventListener* JSDOMWindowBase::findOrCreateJSUnprotectedEventListener(JSValue* val, bool html)
     843PassRefPtr<JSUnprotectedEventListener> JSDOMWindowBase::findOrCreateJSUnprotectedEventListener(JSValue* val, bool html)
    844844{
    845845    JSUnprotectedEventListener* listener = findJSUnprotectedEventListener(val, html);
     
    851851
    852852    // The JSUnprotectedEventListener constructor adds it to our jsUnprotectedEventListeners map.
    853     return new JSUnprotectedEventListener(object, static_cast<JSDOMWindow*>(this), html);
     853    return JSUnprotectedEventListener::create(object, static_cast<JSDOMWindow*>(this), html).get();
    854854}
    855855
     
    10991099        return jsUndefined();
    11001100
    1101     if (JSEventListener* listener = window->findOrCreateJSEventListener(args[1])) {
     1101    if (RefPtr<JSEventListener> listener = window->findOrCreateJSEventListener(args[1])) {
    11021102        if (Document* doc = frame->document())
    1103             doc->addWindowEventListener(AtomicString(args[0]->toString(exec)), listener, args[2]->toBoolean(exec));
     1103            doc->addWindowEventListener(AtomicString(args[0]->toString(exec)), listener.release(), args[2]->toBoolean(exec));
    11041104    }
    11051105
  • trunk/WebCore/bindings/js/JSDOMWindowBase.h

    r34355 r34432  
    7777
    7878        // Finds or creates a wrapper of a JS EventListener. JS EventListener object is GC-protected.
    79         JSEventListener* findOrCreateJSEventListener(KJS::JSValue*, bool html = false);
     79        PassRefPtr<JSEventListener> findOrCreateJSEventListener(KJS::JSValue*, bool html = false);
    8080
    8181        // Finds a wrapper of a GC-unprotected JS EventListener, returns 0 if no existing one.
     
    8383
    8484        // Finds or creates a wrapper of a JS EventListener. JS EventListener object is *NOT* GC-protected.
    85         JSUnprotectedEventListener* findOrCreateJSUnprotectedEventListener(KJS::JSValue*, bool html = false);
     85        PassRefPtr<JSUnprotectedEventListener> findOrCreateJSUnprotectedEventListener(KJS::JSValue*, bool html = false);
    8686
    8787        void clear();
  • trunk/WebCore/bindings/js/JSEventTargetBase.cpp

    r33038 r34432  
    107107        return jsUndefined();
    108108
    109     if (JSEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSEventListener(args[1]))
    110         eventTarget->addEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec));
     109    if (RefPtr<JSEventListener> listener = toJSDOMWindow(frame)->findOrCreateJSEventListener(args[1]))
     110        eventTarget->addEventListener(args[0]->toString(exec), listener.release(), args[2]->toBoolean(exec));
    111111
    112112    return jsUndefined();
  • trunk/WebCore/bindings/js/JSNodeFilterCondition.h

    r30089 r34432  
    2222
    2323#include "NodeFilterCondition.h"
     24#include <wtf/PassRefPtr.h>
    2425
    2526namespace KJS {
     
    3334    class JSNodeFilterCondition : public NodeFilterCondition {
    3435    public:
    35         JSNodeFilterCondition(KJS::JSObject* filter);
     36        static PassRefPtr<JSNodeFilterCondition> create(KJS::JSObject* filter)
     37        {
     38            return adoptRef(new JSNodeFilterCondition(filter));
     39        }
     40
    3641        virtual short acceptNode(Node*, KJS::JSValue*& exception) const;
    3742        virtual void mark();
    3843
    39     protected:
     44    private:
     45        JSNodeFilterCondition(KJS::JSObject* filter);
    4046        KJS::JSObject* m_filter;
    4147    };
  • trunk/WebCore/bindings/js/JSNodeFilterCustom.cpp

    r33038 r34432  
    6161    KJS::JSObject* o = static_cast<KJS::JSObject*>(val);
    6262    if (o->implementsCall())
    63         return new NodeFilter(new JSNodeFilterCondition(o));
     63        return new NodeFilter(JSNodeFilterCondition::create(o));
    6464
    6565    return 0;
  • trunk/WebCore/bindings/js/JSSVGLazyEventListener.h

    r32584 r34432  
    11/*
    2     Copyright (C) 2006 Apple Computer, Inc.
    3                  
    4     This file is part of the WebKit project
     2    Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    53
    64    This library is free software; you can redistribute it and/or
     
    2220#ifndef JSSVGLazyEventListener_h
    2321#define JSSVGLazyEventListener_h
    24 #if ENABLE(SVG)
    2522
    2623#include "kjs_events.h"
     24
     25#if ENABLE(SVG)
    2726
    2827namespace WebCore {
     
    3029    class JSSVGLazyEventListener : public JSLazyEventListener {
    3130    public:
    32         JSSVGLazyEventListener(const String& functionName, const String& code, JSDOMWindow*, Node*, int lineNumber = 0);
     31        static PassRefPtr<JSSVGLazyEventListener> create(const String& functionName, const String& code, JSDOMWindow* window, Node* node, int lineNumber)
     32        {
     33            return adoptRef(new JSSVGLazyEventListener(functionName, code, window, node, lineNumber));
     34        }
    3335
    3436    private:
     37        JSSVGLazyEventListener(const String& functionName, const String& code, JSDOMWindow*, Node*, int lineNumber);
     38
    3539        virtual KJS::JSValue* eventParameterName() const;
    3640    };
     
    3943
    4044#endif // ENABLE(SVG)
     45
    4146#endif // JSSVGLazyEventListener_h
  • trunk/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp

    r33979 r34432  
    212212    if (!frame)
    213213        return jsUndefined();
    214     JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
     214    RefPtr<JSUnprotectedEventListener> listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
    215215    if (!listener)
    216216        return jsUndefined();
    217     impl()->addEventListener(args[0]->toString(exec), listener, args[2]->toBoolean(exec));
     217    impl()->addEventListener(args[0]->toString(exec), listener.release(), args[2]->toBoolean(exec));
    218218    return jsUndefined();
    219219}
     
    227227    if (!frame)
    228228        return jsUndefined();
    229     JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findOrCreateJSUnprotectedEventListener(args[1], true);
     229    JSUnprotectedEventListener* listener = toJSDOMWindow(frame)->findJSUnprotectedEventListener(args[1], true);
    230230    if (!listener)
    231231        return jsUndefined();
  • trunk/WebCore/bindings/js/kjs_binding.cpp

    r34355 r34432  
    279279    switch (description.type) {
    280280        case DOMExceptionType:
    281             errorObject = toJS(exec, new DOMCoreException(description));
     281            errorObject = toJS(exec, DOMCoreException::create(description));
    282282            break;
    283283        case RangeExceptionType:
    284             errorObject = toJS(exec, new RangeException(description));
     284            errorObject = toJS(exec, RangeException::create(description));
    285285            break;
    286286        case EventExceptionType:
    287             errorObject = toJS(exec, new EventException(description));
     287            errorObject = toJS(exec, EventException::create(description));
    288288            break;
    289289        case XMLHttpRequestExceptionType:
    290             errorObject = toJS(exec, new XMLHttpRequestException(description));
     290            errorObject = toJS(exec, XMLHttpRequestException::create(description));
    291291            break;
    292292#if ENABLE(SVG)
    293293        case SVGExceptionType:
    294             errorObject = toJS(exec, new SVGException(description), 0);
     294            errorObject = toJS(exec, SVGException::create(description).get(), 0);
    295295            break;
    296296#endif
    297297#if ENABLE(XPATH)
    298298        case XPathExceptionType:
    299             errorObject = toJS(exec, new XPathException(description));
     299            errorObject = toJS(exec, XPathException::create(description));
    300300            break;
    301301#endif
  • trunk/WebCore/bindings/js/kjs_events.cpp

    r34334 r34432  
    4141using namespace EventNames;
    4242
    43 JSAbstractEventListener::JSAbstractEventListener(bool html)
    44     : m_html(html)
    45 {
    46 }
    47 
    48 void JSAbstractEventListener::handleEvent(Event* ele, bool isWindowEvent)
    49 {
    50     Event* event = ele;
    51 
     43void JSAbstractEventListener::handleEvent(Event* event, bool isWindowEvent)
     44{
    5245    JSObject* listener = listenerObj();
    5346    if (!listener)
     
    114107            if (!retval->isUndefinedOrNull() && event->storesResultAsString())
    115108                event->storeResult(retval->toString(exec));
    116             if (m_html) {
     109            if (m_isHTML) {
    117110                bool retvalbool;
    118111                if (retval->getBoolean(retvalbool) && !retvalbool)
     
    128121bool JSAbstractEventListener::isHTMLEventListener() const
    129122{
    130     return m_html;
     123    return m_isHTML;
    131124}
    132125
    133126// -------------------------------------------------------------------------
    134127
    135 JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject* listener, JSDOMWindow* window, bool html)
    136     : JSAbstractEventListener(html)
     128JSUnprotectedEventListener::JSUnprotectedEventListener(JSObject* listener, JSDOMWindow* window, bool isHTML)
     129    : JSAbstractEventListener(isHTML)
    137130    , m_listener(listener)
    138131    , m_window(window)
    139132{
    140133    if (m_listener) {
    141         JSDOMWindow::UnprotectedListenersMap& listeners = html
     134        JSDOMWindow::UnprotectedListenersMap& listeners = isHTML
    142135            ? window->jsUnprotectedHTMLEventListeners() : window->jsUnprotectedEventListeners();
    143136        listeners.set(m_listener, this);
     
    195188// -------------------------------------------------------------------------
    196189
    197 JSEventListener::JSEventListener(JSObject* listener, JSDOMWindow* window, bool html)
    198     : JSAbstractEventListener(html)
     190JSEventListener::JSEventListener(JSObject* listener, JSDOMWindow* window, bool isHTML)
     191    : JSAbstractEventListener(isHTML)
    199192    , m_listener(listener)
    200193    , m_window(window)
    201194{
    202195    if (m_listener) {
    203         JSDOMWindow::ListenersMap& listeners = html
     196        JSDOMWindow::ListenersMap& listeners = isHTML
    204197            ? m_window->jsHTMLEventListeners() : m_window->jsEventListeners();
    205198        listeners.set(m_listener, this);
  • trunk/WebCore/bindings/js/kjs_events.h

    r34273 r34432  
    3333    class JSAbstractEventListener : public EventListener {
    3434    public:
    35         JSAbstractEventListener(bool html = false);
    36 
    3735        virtual void handleEvent(Event*, bool isWindowEvent);
    3836        virtual bool isHTMLEventListener() const;
     
    4038        virtual JSDOMWindow* window() const = 0;
    4139
     40    protected:
     41        JSAbstractEventListener(bool isHTML)
     42            : m_isHTML(isHTML)
     43        {
     44        }
     45
    4246    private:
    43         bool m_html;
     47        bool m_isHTML;
    4448    };
    4549
    4650    class JSUnprotectedEventListener : public JSAbstractEventListener {
    4751    public:
    48         JSUnprotectedEventListener(KJS::JSObject* listener, JSDOMWindow*, bool html = false);
     52        static PassRefPtr<JSUnprotectedEventListener> create(KJS::JSObject* listener, JSDOMWindow* window, bool isHTML)
     53        {
     54            return adoptRef(new JSUnprotectedEventListener(listener, window, isHTML));
     55        }
    4956        virtual ~JSUnprotectedEventListener();
    5057
     
    5562
    5663    private:
     64        JSUnprotectedEventListener(KJS::JSObject* listener, JSDOMWindow*, bool isHTML);
     65
    5766        KJS::JSObject* m_listener;
    5867        JSDOMWindow* m_window;
     
    6170    class JSEventListener : public JSAbstractEventListener {
    6271    public:
    63         JSEventListener(KJS::JSObject* listener, JSDOMWindow*, bool html = false);
     72        static PassRefPtr<JSEventListener> create(KJS::JSObject* listener, JSDOMWindow* window, bool isHTML)
     73        {
     74            return adoptRef(new JSEventListener(listener, window, isHTML));
     75        }
    6476        virtual ~JSEventListener();
    6577
     
    6981
    7082    protected:
     83        JSEventListener(KJS::JSObject* listener, JSDOMWindow*, bool isHTML);
     84
    7185        mutable KJS::ProtectedPtr<KJS::JSObject> m_listener;
    7286
     
    7791    class JSLazyEventListener : public JSEventListener {
    7892    public:
     93        static PassRefPtr<JSLazyEventListener> create(const String& functionName, const String& code, JSDOMWindow* window, Node* node, int lineNumber)
     94        {
     95            return adoptRef(new JSLazyEventListener(functionName, code, window, node, lineNumber));
     96        }
     97        virtual KJS::JSObject* listenerObj() const;
     98
     99    protected:
    79100        JSLazyEventListener(const String& functionName, const String& code, JSDOMWindow*, Node*, int lineNumber);
    80         virtual KJS::JSObject* listenerObj() const;
    81101
    82102    private:
  • trunk/WebCore/bindings/js/kjs_proxy.cpp

    r34279 r34432  
    124124}
    125125
    126 EventListener* KJSProxy::createHTMLEventHandler(const String& functionName, const String& code, Node* node)
     126PassRefPtr<EventListener> KJSProxy::createHTMLEventHandler(const String& functionName, const String& code, Node* node)
    127127{
    128128    initScriptIfNeeded();
    129129    JSLock lock;
    130     return new JSLazyEventListener(functionName, code, m_windowShell->window(), node, m_handlerLineno);
     130    return JSLazyEventListener::create(functionName, code, m_windowShell->window(), node, m_handlerLineno);
    131131}
    132132
    133133#if ENABLE(SVG)
    134 EventListener* KJSProxy::createSVGEventHandler(const String& functionName, const String& code, Node* node)
     134PassRefPtr<EventListener> KJSProxy::createSVGEventHandler(const String& functionName, const String& code, Node* node)
    135135{
    136136    initScriptIfNeeded();
    137137    JSLock lock;
    138     return new JSSVGLazyEventListener(functionName, code, m_windowShell->window(), node, m_handlerLineno);
     138    return JSSVGLazyEventListener::create(functionName, code, m_windowShell->window(), node, m_handlerLineno);
    139139}
    140140#endif
  • trunk/WebCore/bindings/js/kjs_proxy.h

    r34271 r34432  
    6161    KJS::JSValue* evaluate(const String& filename, int baseLine, const String& code);
    6262    void clear();
    63     EventListener* createHTMLEventHandler(const String& functionName, const String& code, Node*);
     63    PassRefPtr<EventListener> createHTMLEventHandler(const String& functionName, const String& code, Node*);
    6464#if ENABLE(SVG)
    65     EventListener* createSVGEventHandler(const String& functionName, const String& code, Node*);
     65    PassRefPtr<EventListener> createSVGEventHandler(const String& functionName, const String& code, Node*);
    6666#endif
    6767    void finishedWithEvent(Event*);
  • trunk/WebCore/bindings/objc/DOM.mm

    r34138 r34432  
    693693class ObjCNodeFilterCondition : public NodeFilterCondition {
    694694public:
    695     ObjCNodeFilterCondition(id <DOMNodeFilter>);
    696     virtual ~ObjCNodeFilterCondition();
     695    static PassRefPtr<ObjCNodeFilterCondition> create(id <DOMNodeFilter> filter)
     696    {
     697        return adoptRef(new ObjCNodeFilterCondition(filter));
     698    }
     699
    697700    virtual short acceptNode(Node*, JSValue*& exception) const;
    698701
    699702private:
    700     ObjCNodeFilterCondition(const ObjCNodeFilterCondition&);
    701     ObjCNodeFilterCondition &operator=(const ObjCNodeFilterCondition&);
    702 
    703     id <DOMNodeFilter> m_filter;
     703    ObjCNodeFilterCondition(id <DOMNodeFilter> filter)
     704        : m_filter(filter)
     705    {
     706    }
     707
     708    RetainPtr<id <DOMNodeFilter> > m_filter;
    704709};
    705 
    706 ObjCNodeFilterCondition::ObjCNodeFilterCondition(id <DOMNodeFilter> filter)
    707     : m_filter(filter)
    708 {
    709     ASSERT(m_filter);
    710     HardRetain(m_filter);
    711 }
    712 
    713 ObjCNodeFilterCondition::~ObjCNodeFilterCondition()
    714 {
    715     HardRelease(m_filter);
    716 }
    717710
    718711short ObjCNodeFilterCondition::acceptNode(Node* node, JSValue*&) const
     
    720713    if (!node)
    721714        return NodeFilter::FILTER_REJECT;
    722     return [m_filter acceptNode:[DOMNode _wrapNode:node]];
     715    return [m_filter.get() acceptNode:[DOMNode _wrapNode:node]];
    723716}
    724717
     
    735728    RefPtr<NodeFilter> cppFilter;
    736729    if (filter)
    737         cppFilter = new NodeFilter(new ObjCNodeFilterCondition(filter));
     730        cppFilter = new NodeFilter(ObjCNodeFilterCondition::create(filter));
    738731    ExceptionCode ec = 0;
    739732    RefPtr<NodeIterator> impl = [self _document]->createNodeIterator([root _node], whatToShow, cppFilter.release(), expandEntityReferences, ec);
     
    746739    RefPtr<NodeFilter> cppFilter;
    747740    if (filter)
    748         cppFilter = new NodeFilter(new ObjCNodeFilterCondition(filter));
     741        cppFilter = new NodeFilter(ObjCNodeFilterCondition::create(filter));
    749742    ExceptionCode ec = 0;
    750743    RefPtr<TreeWalker> impl = [self _document]->createTreeWalker([root _node], whatToShow, cppFilter.release(), expandEntityReferences, ec);
     
    782775}
    783776
    784 ObjCEventListener *ObjCEventListener::create(id <DOMEventListener> listener)
     777ObjCEventListener* ObjCEventListener::create(id <DOMEventListener> listener)
    785778{
    786779    ObjCEventListener* wrapper = find(listener);
    787     if (!wrapper)
     780    if (wrapper)
     781        wrapper->ref();
     782    else
    788783        wrapper = new ObjCEventListener(listener);
    789     wrapper->ref();
    790784    return wrapper;
    791785}
  • trunk/WebCore/css/CSSComputedStyleDeclaration.cpp

    r33572 r34432  
    303303        left = new CSSPrimitiveValue(image.m_slices.left.value(), CSSPrimitiveValue::CSS_NUMBER);
    304304
    305     RefPtr<Rect> rect = new Rect();
     305    RefPtr<Rect> rect = Rect::create();
    306306    rect->setTop(top);
    307307    rect->setRight(right);
     
    949949            DashboardRegion* previousRegion = 0;
    950950            for (unsigned i = 0; i < count; i++) {
    951                 RefPtr<DashboardRegion> region = new DashboardRegion;
     951                RefPtr<DashboardRegion> region = DashboardRegion::create();
    952952                StyleDashboardRegion styleRegion = regions[i];
    953953
     
    10021002        {
    10031003            if (style->hasClip()) {
    1004                 Rect* rect = new Rect();
     1004                RefPtr<Rect> rect = Rect::create();
    10051005                rect->setTop(new CSSPrimitiveValue(style->clip().top.value(), CSSPrimitiveValue::CSS_PX));
    10061006                rect->setRight(new CSSPrimitiveValue(style->clip().right.value(), CSSPrimitiveValue::CSS_PX));
    10071007                rect->setBottom(new CSSPrimitiveValue(style->clip().bottom.value(), CSSPrimitiveValue::CSS_PX));
    10081008                rect->setLeft(new CSSPrimitiveValue(style->clip().left.value(), CSSPrimitiveValue::CSS_PX));
    1009                 return new CSSPrimitiveValue(rect);
     1009                return new CSSPrimitiveValue(rect.release());
    10101010            }
    10111011            return 0;
  • trunk/WebCore/css/CSSFontFace.h

    r30122 r34432  
    2727#define CSSFontFace_h
    2828
     29#include <wtf/PassRefPtr.h>
    2930#include <wtf/RefCounted.h>
    3031#include <wtf/Vector.h>
     
    3940class CSSFontFace : public RefCounted<CSSFontFace> {
    4041public:
    41     CSSFontFace()
    42         : RefCounted<CSSFontFace>(0)
    43         , m_segmentedFontFace(0)
    44     {
    45     }
    46 
    47     virtual ~CSSFontFace();
     42    static PassRefPtr<CSSFontFace> create() { return adoptRef(new CSSFontFace); }
     43    ~CSSFontFace();
    4844
    4945    void setSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace) { m_segmentedFontFace = segmentedFontFace; }
    5046
    5147    bool isLoaded() const;
    52     virtual bool isValid() const;
     48    bool isValid() const;
    5349
    54     virtual void addSource(CSSFontFaceSource*);
     50    void addSource(CSSFontFaceSource*);
    5551
    5652    void fontLoaded(CSSFontFaceSource*);
    5753
    58     virtual SimpleFontData* getFontData(const FontDescription&, bool syntheticBold, bool syntheticItalic);
     54    SimpleFontData* getFontData(const FontDescription&, bool syntheticBold, bool syntheticItalic);
    5955
    6056private:
     57    CSSFontFace()
     58        : m_segmentedFontFace(0)
     59    {
     60    }
     61
    6162    CSSSegmentedFontFace* m_segmentedFontFace;
    6263    Vector<CSSFontFaceSource*> m_sources;
  • trunk/WebCore/css/CSSFontSelector.cpp

    r31653 r34432  
    155155
    156156    // Each item in the src property's list is a single CSSFontFaceSource. Put them all into a CSSFontFace.
    157     CSSFontFace* fontFace = 0;
     157    RefPtr<CSSFontFace> fontFace;
    158158
    159159    int i;
     
    202202
    203203        if (!fontFace)
    204             fontFace = new CSSFontFace();
     204            fontFace = CSSFontFace::create();
    205205
    206206        if (source) {
     
    218218    ASSERT(fontFace);
    219219
    220     if (fontFace && !fontFace->isValid()) {
    221         delete fontFace;
    222         return;
    223     }
     220    if (fontFace && !fontFace->isValid())
     221        return;
    224222
    225223    // Hash under every single family name.
     
    268266        CSSSegmentedFontFace* segmentedFontFace = m_fonts.get(hash).get();
    269267        if (!segmentedFontFace) {
    270             segmentedFontFace = new CSSSegmentedFontFace(this);
    271             m_fonts.set(hash, segmentedFontFace);
     268            RefPtr<CSSSegmentedFontFace> newFace = CSSSegmentedFontFace::create(this);
     269            segmentedFontFace = newFace.get();
     270            m_fonts.set(hash, newFace.release());
    272271        }
    273272        if (rangeList) {
     
    275274            // any character not overlaid by explicit @font-face rules for the family.
    276275            if (!segmentedFontFace->numRanges() && FontCache::fontExists(fontDescription, familyName)) {
    277                 CSSFontFace* implicitFontFace = new CSSFontFace();
     276                RefPtr<CSSFontFace> implicitFontFace = CSSFontFace::create();
    278277                implicitFontFace->addSource(new CSSFontFaceSource(familyName));
    279278                ASSERT(implicitFontFace->isValid());
    280                 segmentedFontFace->overlayRange(0, 0x7FFFFFFF, implicitFontFace);
     279                segmentedFontFace->overlayRange(0, 0x7FFFFFFF, implicitFontFace.release());
    281280            }
    282281
     
    287286            }
    288287        } else
    289             segmentedFontFace->overlayRange(0, 0x7FFFFFFF, fontFace);
     288            segmentedFontFace->overlayRange(0, 0x7FFFFFFF, fontFace.release());
    290289    }
    291290}
  • trunk/WebCore/css/CSSParser.cpp

    r34423 r34432  
    23842384    }
    23852385       
    2386     RefPtr<DashboardRegion> firstRegion = new DashboardRegion;
     2386    RefPtr<DashboardRegion> firstRegion = DashboardRegion::create();
    23872387    DashboardRegion* region = 0;
    23882388
     
    23912391            region = firstRegion.get();
    23922392        } else {
    2393             RefPtr<DashboardRegion> nextRegion = new DashboardRegion();
     2393            RefPtr<DashboardRegion> nextRegion = DashboardRegion::create();
    23942394            region->m_next = nextRegion;
    23952395            region = nextRegion.get();
     
    25462546    }
    25472547
    2548     return new CSSPrimitiveValue(new Counter(identifier.release(), listStyle.release(), separator.release()));
     2548    return new CSSPrimitiveValue(Counter::create(identifier.release(), listStyle.release(), separator.release()));
    25492549}
    25502550
     
    25592559    if (args->size() != 4 && args->size() != 7)
    25602560        return false;
    2561     Rect *rect = new Rect();
     2561    RefPtr<Rect> rect = Rect::create();
    25622562    bool valid = true;
    25632563    int i = 0;
     
    25902590    }
    25912591    if (valid) {
    2592         addProperty(propId, new CSSPrimitiveValue(rect), important);
     2592        addProperty(propId, new CSSPrimitiveValue(rect.release()), important);
    25932593        m_valueList->next();
    25942594        return true;
    25952595    }
    2596     delete rect;
    25972596    return false;
    25982597}
     
    33163315             
    33173316        // Now build a rect value to hold all four of our primitive values.
    3318         RefPtr<Rect> rect = new Rect;
     3317        RefPtr<Rect> rect = Rect::create();
    33193318        rect->setTop(m_top);
    33203319        rect->setRight(m_right);
  • trunk/WebCore/css/CSSSegmentedFontFace.cpp

    r30392 r34432  
    3636
    3737CSSSegmentedFontFace::CSSSegmentedFontFace(CSSFontSelector* fontSelector)
    38     : RefCounted<CSSSegmentedFontFace>(0)
    39     , m_fontSelector(fontSelector)
     38    : m_fontSelector(fontSelector)
    4039{
    4140}
  • trunk/WebCore/css/CSSSegmentedFontFace.h

    r29663 r34432  
    6161class CSSSegmentedFontFace : public RefCounted<CSSSegmentedFontFace> {
    6262public:
    63     CSSSegmentedFontFace(CSSFontSelector*);
     63    static PassRefPtr<CSSSegmentedFontFace> create(CSSFontSelector* selector) { return adoptRef(new CSSSegmentedFontFace(selector)); }
    6464    ~CSSSegmentedFontFace();
    6565
     
    7676
    7777private:
     78    CSSSegmentedFontFace(CSSFontSelector*);
     79
    7880    void pruneTable();
    7981
  • trunk/WebCore/css/Counter.h

    r30122 r34432  
    11/*
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
    5  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
     3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
    64 *
    75 * This library is free software; you can redistribute it and/or
     
    2624#include "CSSPrimitiveValue.h"
    2725#include "PlatformString.h"
    28 #include <wtf/RefCounted.h>
    29 #include <wtf/PassRefPtr.h>
    3026
    3127namespace WebCore {
     
    3329class Counter : public RefCounted<Counter> {
    3430public:
    35     Counter(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator)
    36         : RefCounted<Counter>(0)
    37         , m_identifier(identifier)
    38         , m_listStyle(listStyle)
    39         , m_separator(separator)
     31    static PassRefPtr<Counter> create(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator)
    4032    {
     33        return adoptRef(new Counter(identifier, listStyle, separator));
    4134    }
    4235
     
    5144    void setSeparator(PassRefPtr<CSSPrimitiveValue> separator) { m_separator = separator; }
    5245
    53 protected:
    54     RefPtr<CSSPrimitiveValue> m_identifier; // String
    55     RefPtr<CSSPrimitiveValue> m_listStyle;  // int
    56     RefPtr<CSSPrimitiveValue> m_separator;  // String
     46private:
     47    Counter(PassRefPtr<CSSPrimitiveValue> identifier, PassRefPtr<CSSPrimitiveValue> listStyle, PassRefPtr<CSSPrimitiveValue> separator)
     48        : m_identifier(identifier)
     49        , m_listStyle(listStyle)
     50        , m_separator(separator)
     51    {
     52    }
     53
     54    RefPtr<CSSPrimitiveValue> m_identifier; // string
     55    RefPtr<CSSPrimitiveValue> m_listStyle; // int
     56    RefPtr<CSSPrimitiveValue> m_separator; // string
    5757};
    5858
  • trunk/WebCore/css/DashboardRegion.h

    r32700 r34432  
    11/*
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
    53 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
     
    2422#define DashboardRegion_h
    2523
    26 #include <wtf/Platform.h>
     24#include "Rect.h"
    2725
    2826#if ENABLE(DASHBOARD_SUPPORT)
    29 #include "Rect.h"
    3027
    3128namespace WebCore {
     
    3330class DashboardRegion : public Rect {
    3431public:
    35     DashboardRegion() : m_isCircle(0), m_isRectangle(0) { }
     32    static PassRefPtr<DashboardRegion> create() { return adoptRef(new DashboardRegion); }
    3633
    3734    RefPtr<DashboardRegion> m_next;
     
    4037    bool m_isCircle : 1;
    4138    bool m_isRectangle : 1;
     39
     40private:
     41    DashboardRegion() : m_isCircle(false), m_isRectangle(false) { }
    4242};
    4343
    4444} // namespace
     45
    4546#endif
    4647
  • trunk/WebCore/css/Rect.h

    r30122 r34432  
    11/*
    22 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
    3  * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
     3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
    44 *
    55 * This library is free software; you can redistribute it and/or
     
    2323
    2424#include "CSSPrimitiveValue.h"
    25 #include <wtf/RefCounted.h>
    26 #include <wtf/PassRefPtr.h>
    2725#include <wtf/RefPtr.h>
    2826
     
    3129    class Rect : public RefCounted<Rect> {
    3230    public:
    33         Rect() : RefCounted<Rect>(0) { }
    34         virtual ~Rect() { }
     31        static RefPtr<Rect> create() { return adoptRef(new Rect); }
    3532
    3633        CSSPrimitiveValue* top() const { return m_top.get(); }
     
    4441        void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }
    4542
     43    protected:
     44        Rect() { }
     45
    4646    private:
    4747        RefPtr<CSSPrimitiveValue> m_top;
  • trunk/WebCore/dom/ChildNodeList.h

    r31144 r34432  
    2626
    2727#include "DynamicNodeList.h"
     28#include <wtf/PassRefPtr.h>
    2829
    2930namespace WebCore {
     
    3132    class ChildNodeList : public DynamicNodeList {
    3233    public:
    33         ChildNodeList(PassRefPtr<Node> rootNode, DynamicNodeList::Caches*);
     34        static PassRefPtr<ChildNodeList> create(PassRefPtr<Node> rootNode, Caches* caches)
     35        {
     36            return adoptRef(new ChildNodeList(rootNode, caches));
     37        }
    3438
    3539        virtual unsigned length() const;
     
    3741
    3842    protected:
     43        ChildNodeList(PassRefPtr<Node> rootNode, Caches*);
     44
    3945        virtual bool nodeMatches(Node*) const;
    4046    };
  • trunk/WebCore/dom/ClassNodeList.h

    r31435 r34432  
    3838    class ClassNodeList : public DynamicNodeList {
    3939    public:
    40         ClassNodeList(PassRefPtr<Node> rootNode, const String& classNames, DynamicNodeList::Caches*);
     40        static PassRefPtr<ClassNodeList> create(PassRefPtr<Node> rootNode, const String& classNames, Caches* caches)
     41        {
     42            return adoptRef(new ClassNodeList(rootNode, classNames, caches));
     43        }
    4144
    4245    private:
     46        ClassNodeList(PassRefPtr<Node> rootNode, const String& classNames, Caches*);
     47
    4348        virtual bool nodeMatches(Node*) const;
    4449
  • trunk/WebCore/dom/Clipboard.h

    r27776 r34432  
    11/*
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
    53 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
    64 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
    7  * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
     5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
    86 *
    97 * This library is free software; you can redistribute it and/or
     
    2725#define Clipboard_h
    2826
    29 #include <wtf/HashSet.h>
    30 #include "AtomicString.h"
    3127#include "ClipboardAccessPolicy.h"
    3228#include "DragActions.h"
     
    3430#include "IntPoint.h"
    3531#include "Node.h"
    36 #include <wtf/RefCounted.h>
    3732
    3833namespace WebCore {
    39 
    40     class CachedImage;
    41     class Element;
    42     class Frame;
    43     class Image;
    44     class KURL;
    45     class Range;
    46     class String;
    4734
    4835    // State available during IE's events for drag and drop and copy/paste
    4936    class Clipboard : public RefCounted<Clipboard> {
    5037    public:
    51         Clipboard(ClipboardAccessPolicy policy, bool isForDragging);
    5238        virtual ~Clipboard() { }
    5339
     
    7460        virtual void setDragImageElement(Node*, const IntPoint&) = 0;
    7561       
    76         //Provides the DOM specified
    77         virtual DragImageRef createDragImage(IntPoint& dragLoc) const = 0;
     62        virtual DragImageRef createDragImage(IntPoint& dragLocation) const = 0;
    7863        virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*) = 0;
    7964        virtual void writeURL(const KURL&, const String&, Frame*) = 0;
     
    9277       
    9378    protected:
     79        Clipboard(ClipboardAccessPolicy, bool isForDragging);
     80
    9481        ClipboardAccessPolicy policy() const { return m_policy; }
    9582        bool dragStarted() const { return m_dragStarted; }
  • trunk/WebCore/dom/DOMCoreException.h

    r29663 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3636    class DOMCoreException : public ExceptionBase {
    3737    public:
     38        static PassRefPtr<DOMCoreException> create(const ExceptionCodeDescription& description)
     39        {
     40            return adoptRef(new DOMCoreException(description));
     41        }
     42
     43    private:
    3844        DOMCoreException(const ExceptionCodeDescription& description)
    3945            : ExceptionBase(description)
  • trunk/WebCore/dom/DOMImplementation.cpp

    r34379 r34432  
    276276DOMImplementation* DOMImplementation::instance()
    277277{
    278     static RefPtr<DOMImplementation> i = new DOMImplementation;
    279     return i.get();
     278    static DOMImplementation* staticInstance = new DOMImplementation;
     279    return staticInstance;
    280280}
    281281
  • trunk/WebCore/dom/DOMImplementation.h

    r30122 r34432  
    11/*
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    64 *           (C) 2001 Dirk Mueller (mueller@kde.org)
    7  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
     5 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
    86 *
    97 * This library is free software; you can redistribute it and/or
     
    4341class DOMImplementation : public RefCounted<DOMImplementation> {
    4442public:
    45     DOMImplementation() : RefCounted<DOMImplementation>(0) { }
    46     virtual ~DOMImplementation();
     43    ~DOMImplementation();
    4744
    4845    // DOM methods & attributes for DOMImplementation
     
    7067    static bool isXMLMIMEType(const String& MIMEType);
    7168    static bool isTextMIMEType(const String& MIMEType);
     69
     70private:
     71    DOMImplementation() { }
    7272};
    7373
  • trunk/WebCore/dom/Document.cpp

    r34370 r34432  
    26262626}
    26272627
    2628 EventListener *Document::getHTMLWindowEventListener(const AtomicString &eventType)
     2628EventListener *Document::getHTMLWindowEventListener(const AtomicString& eventType)
    26292629{
    26302630    RegisteredEventListenerList::iterator it = m_windowEventListeners.begin();
    2631        for (; it != m_windowEventListeners.end(); ++it)
    2632         if ( (*it)->eventType() == eventType && (*it)->listener()->isHTMLEventListener())
     2631    for (; it != m_windowEventListeners.end(); ++it) {
     2632        if ((*it)->eventType() == eventType && (*it)->listener()->isHTMLEventListener())
    26332633            return (*it)->listener();
     2634    }
    26342635    return 0;
    26352636}
    26362637
    2637 void Document::removeHTMLWindowEventListener(const AtomicString &eventType)
     2638void Document::removeHTMLWindowEventListener(const AtomicString& eventType)
    26382639{
    26392640    RegisteredEventListenerList::iterator it = m_windowEventListeners.begin();
    2640     for (; it != m_windowEventListeners.end(); ++it)
    2641         if ( (*it)->eventType() == eventType && (*it)->listener()->isHTMLEventListener()) {
    2642             if (eventType == ((AtomicString)unloadEvent))
     2641    for (; it != m_windowEventListeners.end(); ++it) {
     2642        if ((*it)->eventType() == eventType && (*it)->listener()->isHTMLEventListener()) {
     2643            if (eventType == unloadEvent)
    26432644                removePendingFrameUnloadEventCount();
    2644             else if (eventType == ((AtomicString)beforeunloadEvent))
     2645            else if (eventType == beforeunloadEvent)
    26452646                removePendingFrameBeforeUnloadEventCount();
    26462647            m_windowEventListeners.remove(it);
    26472648            return;
    26482649        }
     2650    }
    26492651}
    26502652
    26512653void Document::addWindowEventListener(const AtomicString &eventType, PassRefPtr<EventListener> listener, bool useCapture)
    26522654{
    2653     if (eventType == ((AtomicString)unloadEvent))
     2655    if (eventType == unloadEvent)
    26542656        addPendingFrameUnloadEventCount();
    2655     else if (eventType == ((AtomicString)beforeunloadEvent))
     2657    else if (eventType == beforeunloadEvent)
    26562658        addPendingFrameBeforeUnloadEventCount();
    26572659    // Remove existing identical listener set with identical arguments.
    26582660    // The DOM 2 spec says that "duplicate instances are discarded" in this case.
    26592661    removeWindowEventListener(eventType, listener.get(), useCapture);
    2660     m_windowEventListeners.append(new RegisteredEventListener(eventType, listener, useCapture));
    2661 }
    2662 
    2663 void Document::removeWindowEventListener(const AtomicString &eventType, EventListener *listener, bool useCapture)
    2664 {
    2665     RegisteredEventListener rl(eventType, listener, useCapture);
     2662    m_windowEventListeners.append(RegisteredEventListener::create(eventType, listener, useCapture));
     2663}
     2664
     2665void Document::removeWindowEventListener(const AtomicString& eventType, EventListener* listener, bool useCapture)
     2666{
    26662667    RegisteredEventListenerList::iterator it = m_windowEventListeners.begin();
    2667     for (; it != m_windowEventListeners.end(); ++it)
    2668         if (*(*it) == rl) {
    2669             if (eventType == ((AtomicString)unloadEvent))
     2668    for (; it != m_windowEventListeners.end(); ++it) {
     2669        RegisteredEventListener& r = **it;
     2670        if (r.eventType() == eventType && r.listener() == listener && r.useCapture() == useCapture) {
     2671            if (eventType == unloadEvent)
    26702672                removePendingFrameUnloadEventCount();
    2671             else if (eventType == ((AtomicString)beforeunloadEvent))
     2673            else if (eventType == beforeunloadEvent)
    26722674                removePendingFrameBeforeUnloadEventCount();
    26732675            m_windowEventListeners.remove(it);
    26742676            return;
    26752677        }
     2678    }
    26762679}
    26772680
     
    29872990}
    29882991
    2989 void Document::setDecoder(TextResourceDecoder *decoder)
     2992void Document::setDecoder(PassRefPtr<TextResourceDecoder> decoder)
    29902993{
    29912994    m_decoder = decoder;
     
    36423645PassRefPtr<HTMLCollection> Document::images()
    36433646{
    3644     return new HTMLCollection(this, HTMLCollection::DocImages);
     3647    return HTMLCollection::create(this, HTMLCollection::DocImages);
    36453648}
    36463649
    36473650PassRefPtr<HTMLCollection> Document::applets()
    36483651{
    3649     return new HTMLCollection(this, HTMLCollection::DocApplets);
     3652    return HTMLCollection::create(this, HTMLCollection::DocApplets);
    36503653}
    36513654
    36523655PassRefPtr<HTMLCollection> Document::embeds()
    36533656{
    3654     return new HTMLCollection(this, HTMLCollection::DocEmbeds);
     3657    return HTMLCollection::create(this, HTMLCollection::DocEmbeds);
    36553658}
    36563659
     
    36583661{
    36593662    // This is an alias for embeds() required for the JS DOM bindings.
    3660     return new HTMLCollection(this, HTMLCollection::DocEmbeds);
     3663    return HTMLCollection::create(this, HTMLCollection::DocEmbeds);
    36613664}
    36623665
    36633666PassRefPtr<HTMLCollection> Document::objects()
    36643667{
    3665     return new HTMLCollection(this, HTMLCollection::DocObjects);
     3668    return HTMLCollection::create(this, HTMLCollection::DocObjects);
    36663669}
    36673670
    36683671PassRefPtr<HTMLCollection> Document::scripts()
    36693672{
    3670     return new HTMLCollection(this, HTMLCollection::DocScripts);
     3673    return HTMLCollection::create(this, HTMLCollection::DocScripts);
    36713674}
    36723675
    36733676PassRefPtr<HTMLCollection> Document::links()
    36743677{
    3675     return new HTMLCollection(this, HTMLCollection::DocLinks);
     3678    return HTMLCollection::create(this, HTMLCollection::DocLinks);
    36763679}
    36773680
    36783681PassRefPtr<HTMLCollection> Document::forms()
    36793682{
    3680     return new HTMLCollection(this, HTMLCollection::DocForms);
     3683    return HTMLCollection::create(this, HTMLCollection::DocForms);
    36813684}
    36823685
    36833686PassRefPtr<HTMLCollection> Document::anchors()
    36843687{
    3685     return new HTMLCollection(this, HTMLCollection::DocAnchors);
     3688    return HTMLCollection::create(this, HTMLCollection::DocAnchors);
    36863689}
    36873690
    36883691PassRefPtr<HTMLCollection> Document::all()
    36893692{
    3690     return new HTMLCollection(this, HTMLCollection::DocAll);
     3693    return HTMLCollection::create(this, HTMLCollection::DocAll);
    36913694}
    36923695
    36933696PassRefPtr<HTMLCollection> Document::windowNamedItems(const String &name)
    36943697{
    3695     return new HTMLNameCollection(this, HTMLCollection::WindowNamedItems, name);
     3698    return HTMLNameCollection::create(this, HTMLCollection::WindowNamedItems, name);
    36963699}
    36973700
    36983701PassRefPtr<HTMLCollection> Document::documentNamedItems(const String &name)
    36993702{
    3700     return new HTMLNameCollection(this, HTMLCollection::DocumentNamedItems, name);
     3703    return HTMLNameCollection::create(this, HTMLCollection::DocumentNamedItems, name);
    37013704}
    37023705
  • trunk/WebCore/dom/Document.h

    r34315 r34432  
    885885    bool shouldCreateRenderers();
    886886   
    887     void setDecoder(TextResourceDecoder*);
     887    void setDecoder(PassRefPtr<TextResourceDecoder>);
    888888    TextResourceDecoder* decoder() const { return m_decoder.get(); }
    889889
  • trunk/WebCore/dom/DynamicNodeList.h

    r31144 r34432  
    4949        };
    5050
    51         DynamicNodeList(PassRefPtr<Node> rootNode);
    52         DynamicNodeList(PassRefPtr<Node> rootNode, Caches*);
    5351        virtual ~DynamicNodeList();
    5452
     
    6462
    6563    protected:
     64        DynamicNodeList(PassRefPtr<Node> rootNode);
     65        DynamicNodeList(PassRefPtr<Node> rootNode, Caches*);
     66
    6667        virtual bool nodeMatches(Node*) const = 0;
    6768
  • trunk/WebCore/dom/EventException.h

    r29663 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3636    class EventException : public ExceptionBase {
    3737    public:
    38         EventException(const ExceptionCodeDescription& description)
    39             : ExceptionBase(description)
     38        static PassRefPtr<EventException> create(const ExceptionCodeDescription& description)
    4039        {
     40            return adoptRef(new EventException(description));
    4141        }
    4242
     
    4747            UNSPECIFIED_EVENT_TYPE_ERR = EventExceptionOffset
    4848        };
     49
     50    private:
     51        EventException(const ExceptionCodeDescription& description)
     52            : ExceptionBase(description)
     53        {
     54        }
    4955    };
    5056
  • trunk/WebCore/dom/EventListener.h

    r30122 r34432  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc.
     2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    3030    class EventListener : public RefCounted<EventListener> {
    3131    public:
    32         EventListener() : RefCounted<EventListener>(0) { }
    3332        virtual ~EventListener() { }
    3433        virtual void handleEvent(Event*, bool isWindowEvent = false) = 0;
  • trunk/WebCore/dom/EventTarget.cpp

    r32006 r34432  
    126126        referenceNode->document()->registerDisconnectedNodeWithEventListeners(referenceNode);
    127127
    128     referenceNode->m_regdListeners->append(new RegisteredEventListener(eventType, listener.get(), useCapture));
     128    referenceNode->m_regdListeners->append(RegisteredEventListener::create(eventType, listener, useCapture));
    129129}
    130130
     
    135135        return;
    136136
    137     RegisteredEventListener rl(eventType, listener, useCapture);
    138 
    139137    RegisteredEventListenerList::Iterator end = referenceNode->m_regdListeners->end();
    140138    for (RegisteredEventListenerList::Iterator it = referenceNode->m_regdListeners->begin(); it != end; ++it) {
    141          if (*(*it).get() == rl) {
     139        RegisteredEventListener& r = **it;
     140        if (r.eventType() == eventType && r.listener() == listener && r.useCapture() == useCapture) {
    142141            (*it)->setRemoved(true);
    143142            it = referenceNode->m_regdListeners->remove(it);
  • trunk/WebCore/dom/EventTargetNode.cpp

    r33006 r34432  
    396396    removeHTMLEventListener(eventType);
    397397    if (listener)
    398         addEventListener(eventType, listener.get(), false);
     398        addEventListener(eventType, listener, false);
    399399}
    400400
  • trunk/WebCore/dom/ExceptionBase.cpp

    r30122 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333
    3434ExceptionBase::ExceptionBase(const ExceptionCodeDescription& description)
    35     : RefCounted<ExceptionBase>(0)
     35    : m_code(description.code)
     36    , m_name(description.name)
    3637{
    37     m_code = description.code;
    38     if (description.name) {
    39         m_name = description.name;
     38    if (description.name)
    4039        m_message = String::format("%s: %s Exception %d", description.name, description.typeName, description.code);
    41     } else
     40    else
    4241        m_message = String::format("%s Exception %d", description.typeName, description.code);
    4342}
  • trunk/WebCore/dom/ExceptionBase.h

    r29663 r34432  
    3838    class ExceptionBase : public RefCounted<ExceptionBase> {
    3939    public:
    40         ExceptionBase(const ExceptionCodeDescription&);
    41 
    4240        unsigned short code() const { return m_code; }
    4341        String name() const { return m_name; }
     
    4543
    4644        String toString() const;
     45
     46    protected:
     47        ExceptionBase(const ExceptionCodeDescription&);
    4748
    4849    private:
  • trunk/WebCore/dom/NameNodeList.h

    r31144 r34432  
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2001 Dirk Mueller (mueller@kde.org)
    5  * Copyright (C) 2004, 2007 Apple Inc. All rights reserved.
     5 * Copyright (C) 2004, 2007m 2008 Apple Inc. All rights reserved.
    66 *
    77 * This library is free software; you can redistribute it and/or
     
    2525#define NameNodeList_h
    2626
     27#include "AtomicString.h"
    2728#include "DynamicNodeList.h"
    28 #include "AtomicString.h"
    2929
    3030namespace WebCore {
     
    3535    class NameNodeList : public DynamicNodeList {
    3636    public:
    37         NameNodeList(PassRefPtr<Node> rootNode, const String& name, DynamicNodeList::Caches*);
     37        static PassRefPtr<NameNodeList> create(PassRefPtr<Node> rootNode, const String& name, Caches* caches)
     38        {
     39            return adoptRef(new NameNodeList(rootNode, name, caches));
     40        }
    3841
    3942    private:
     43        NameNodeList(PassRefPtr<Node> rootNode, const String& name, Caches*);
     44
    4045        virtual bool nodeMatches(Node*) const;
    4146
  • trunk/WebCore/dom/Node.cpp

    r34344 r34432  
    211211    }
    212212
    213     return new ChildNodeList(this, &m_nodeLists->m_childNodeListCaches);
     213    return ChildNodeList::create(this, &m_nodeLists->m_childNodeListCaches);
    214214}
    215215
     
    12031203    if (document()->isHTMLDocument())
    12041204        name = localName.lower();
    1205     return new TagNodeList(this, namespaceURI.isEmpty() ? nullAtom : AtomicString(namespaceURI), name);
     1205    return TagNodeList::create(this, namespaceURI.isEmpty() ? nullAtom : AtomicString(namespaceURI), name);
    12061206}
    12071207
     
    12171217        result.first->second = new DynamicNodeList::Caches;
    12181218   
    1219     return new NameNodeList(this, elementName, result.first->second);
     1219    return NameNodeList::create(this, elementName, result.first->second);
    12201220}
    12211221
     
    12311231        result.first->second = new DynamicNodeList::Caches;
    12321232   
    1233     return new ClassNodeList(this, classNames, result.first->second);
     1233    return ClassNodeList::create(this, classNames, result.first->second);
    12341234}
    12351235
     
    12791279    }
    12801280   
    1281     SelectorNodeList* resultList = new SelectorNodeList(this, static_cast<CSSStyleRule*>(rule.get())->selector());
    1282 
    1283     return resultList;
     1281    return createSelectorNodeList(this, static_cast<CSSStyleRule*>(rule.get())->selector());
    12841282}
    12851283
  • trunk/WebCore/dom/NodeFilterCondition.h

    r30122 r34432  
    3838    class NodeFilterCondition : public RefCounted<NodeFilterCondition> {
    3939    public:
    40         NodeFilterCondition() : RefCounted<NodeFilterCondition>(0) { }
    4140        virtual ~NodeFilterCondition() { }
    42         virtual short acceptNode(Node*, KJS::JSValue*& exception) const;
     41        virtual short acceptNode(Node*, KJS::JSValue*& exception) const = 0;
    4342        virtual void mark() { }
    4443    };
  • trunk/WebCore/dom/NodeList.h

    r30122 r34432  
    3434    class NodeList : public RefCounted<NodeList> {
    3535    public:
    36         NodeList() : RefCounted<NodeList>(0) { }
    3736        virtual ~NodeList() { }
    3837
  • trunk/WebCore/dom/RangeException.h

    r29663 r34432  
    3434    class RangeException : public ExceptionBase {
    3535    public:
    36         RangeException(const ExceptionCodeDescription& description)
    37             : ExceptionBase(description)
     36        static PassRefPtr<RangeException> create(const ExceptionCodeDescription& description)
    3837        {
     38            return adoptRef(new RangeException(description));
    3939        }
    4040
     
    4646            INVALID_NODE_TYPE_ERR
    4747        };
     48
     49    private:
     50        RangeException(const ExceptionCodeDescription& description)
     51            : ExceptionBase(description)
     52        {
     53        }
    4854    };
    4955
  • trunk/WebCore/dom/RegisteredEventListener.cpp

    r30122 r34432  
    1 /**
    2  * This file is part of the DOM implementation for KDE.
    3  *
     1/*
    42 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
    53 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
    64 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
    7  * Copyright (C) 2003, 2005, 2006 Apple Computer, Inc.
     5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
    86 *
    97 * This library is free software; you can redistribute it and/or
     
    3129
    3230RegisteredEventListener::RegisteredEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
    33     : RefCounted<RegisteredEventListener>(0)
    34     , m_eventType(eventType)
     31    : m_eventType(eventType)
    3532    , m_listener(listener)
    3633    , m_useCapture(useCapture)
  • trunk/WebCore/dom/RegisteredEventListener.h

    r27776 r34432  
    11/*
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
    53 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
    64 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
    7  * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
     5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
    86 *
    97 * This library is free software; you can redistribute it and/or
     
    2826
    2927#include "AtomicString.h"
    30 #include <wtf/RefCounted.h>
    3128
    3229namespace WebCore {
     
    3633    class RegisteredEventListener : public RefCounted<RegisteredEventListener> {
    3734    public:
    38         RegisteredEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
     35        static PassRefPtr<RegisteredEventListener> create(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
     36        {
     37            return adoptRef(new RegisteredEventListener(eventType, listener, useCapture));
     38        }
    3939
    4040        const AtomicString& eventType() const { return m_eventType; }
     
    4646   
    4747    private:
     48        RegisteredEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
     49
    4850        AtomicString m_eventType;
    4951        RefPtr<EventListener> m_listener;
  • trunk/WebCore/dom/SelectorNodeList.cpp

    r33939 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434#include "Document.h"
    3535#include "Element.h"
    36 #include "Node.h"
    3736
    3837namespace WebCore {
    3938
    40 SelectorNodeList::SelectorNodeList(PassRefPtr<Node> rootNode, CSSSelector* querySelector)
     39PassRefPtr<StaticNodeList> createSelectorNodeList(PassRefPtr<Node> rootNode, CSSSelector* querySelector)
    4140{
     41    Vector<RefPtr<Node> > nodes;
    4242    Document* document = rootNode->document();
    4343    CSSStyleSelector::SelectorChecker selectorChecker(document, !document->inCompatMode());
     
    4747            for (CSSSelector* selector = querySelector; selector; selector = selector->next()) {
    4848                if (selectorChecker.checkSelector(selector, element)) {
    49                     m_nodes.append(n);
     49                    nodes.append(n);
    5050                    break;
    5151                }
     
    5353        }
    5454    }
     55    return StaticNodeList::adopt(nodes);
    5556}
    5657
  • trunk/WebCore/dom/SelectorNodeList.h

    r29663 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131
    3232#include "StaticNodeList.h"
    33 #include <wtf/Forward.h>
    3433
    3534namespace WebCore {
    3635
    37     class Node;
    3836    class CSSSelector;
    3937
    40     class SelectorNodeList : public StaticNodeList {
    41     public:
    42         SelectorNodeList(PassRefPtr<Node> rootNode, CSSSelector*);
    43     };
     38    PassRefPtr<StaticNodeList> createSelectorNodeList(PassRefPtr<Node> rootNode, CSSSelector*);
    4439
    4540} // namespace WebCore
  • trunk/WebCore/dom/StaticNodeList.cpp

    r29663 r34432  
    3030#include "StaticNodeList.h"
    3131
    32 #include "AtomicString.h"
    33 #include "Node.h"
    3432#include "Element.h"
    3533
  • trunk/WebCore/dom/StaticNodeList.h

    r29663 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131
    3232#include "NodeList.h"
     33#include <wtf/PassRefPtr.h>
    3334#include <wtf/RefPtr.h>
    3435#include <wtf/Vector.h>
     
    4041    class StaticNodeList : public NodeList {
    4142    public:
    42         // Derived classes should build up the Vector in their constructor.
    43         StaticNodeList() { }
    44         virtual ~StaticNodeList() { }
     43        // Adopts the contents of the nodes vector.
     44        static PassRefPtr<StaticNodeList> adopt(Vector<RefPtr<Node> >& nodes)
     45        {
     46            return adoptRef(new StaticNodeList(nodes));
     47        }
    4548
    4649        virtual unsigned length() const;
     
    4851        virtual Node* itemWithName(const AtomicString&) const;
    4952
    50     protected:
     53    private:
     54        StaticNodeList(Vector<RefPtr<Node> >& nodes)
     55        {
     56            m_nodes.swap(nodes);
     57        }
    5158        Vector<RefPtr<Node> > m_nodes;
    5259    };
  • trunk/WebCore/dom/TagNodeList.h

    r28988 r34432  
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2001 Dirk Mueller (mueller@kde.org)
    5  * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
     5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
    66 * Copyright (C) 2007 Trolltech ASA
    77 *
     
    3333    class TagNodeList : public DynamicNodeList {
    3434    public:
     35        static PassRefPtr<TagNodeList> create(PassRefPtr<Node> rootNode, const AtomicString& namespaceURI, const AtomicString& localName)
     36        {
     37            return adoptRef(new TagNodeList(rootNode, namespaceURI, localName));
     38        }
     39
     40    private:
    3541        TagNodeList(PassRefPtr<Node> rootNode, const AtomicString& namespaceURI, const AtomicString& localName);
    3642
    37     private:
    3843        virtual bool nodeMatches(Node*) const;
    3944
  • trunk/WebCore/history/HistoryItem.cpp

    r31606 r34432  
    3939namespace WebCore {
    4040
    41 static void defaultNotifyHistoryItemChanged() {}
     41static void defaultNotifyHistoryItemChanged()
     42{
     43}
     44
    4245void (*notifyHistoryItemChanged)() = defaultNotifyHistoryItemChanged;
    4346
    4447HistoryItem::HistoryItem()
    45     : RefCounted<HistoryItem>(0)
    46     , m_lastVisitedTime(0)
     48    : m_lastVisitedTime(0)
    4749    , m_isInPageCache(false)
    4850    , m_isTargetItem(false)
     
    5254
    5355HistoryItem::HistoryItem(const String& urlString, const String& title, double time)
    54     : RefCounted<HistoryItem>(0)
    55     , m_urlString(urlString)
     56    : m_urlString(urlString)
    5657    , m_originalURLString(urlString)
    5758    , m_title(title)
     
    6566
    6667HistoryItem::HistoryItem(const String& urlString, const String& title, const String& alternateTitle, double time)
    67     : RefCounted<HistoryItem>(0)
    68     , m_urlString(urlString)
     68    : m_urlString(urlString)
    6969    , m_originalURLString(urlString)
    7070    , m_title(title)
     
    7878}
    7979
    80 HistoryItem::HistoryItem(const KURL& url, const String& title)
    81     : RefCounted<HistoryItem>(0)
    82     , m_urlString(url.string())
    83     , m_originalURLString(url.string())
    84     , m_title(title)
    85     , m_lastVisitedTime(0)
    86     , m_isInPageCache(false)
    87     , m_isTargetItem(false)
    88     , m_visitCount(0)
    89 {   
    90     iconDatabase()->retainIconForPageURL(m_urlString);
    91 }
    92 
    9380HistoryItem::HistoryItem(const KURL& url, const String& target, const String& parent, const String& title)
    94     : RefCounted<HistoryItem>(0)
    95     , m_urlString(url.string())
     81    : m_urlString(url.string())
    9682    , m_originalURLString(url.string())
    9783    , m_target(target)
     
    11298}
    11399
    114 HistoryItem::HistoryItem(const HistoryItem& item)
    115     : RefCounted<HistoryItem>(0)
     100inline HistoryItem::HistoryItem(const HistoryItem& item)
     101    : RefCounted<HistoryItem>(1)
    116102    , m_urlString(item.m_urlString)
    117103    , m_originalURLString(item.m_originalURLString)
     
    140126PassRefPtr<HistoryItem> HistoryItem::copy() const
    141127{
    142     return new HistoryItem(*this);
     128    return adoptRef(new HistoryItem(*this));
    143129}
    144130
  • trunk/WebCore/history/HistoryItem.h

    r30243 r34432  
    5959
    6060public:
    61     HistoryItem();
    62     HistoryItem(const String& urlString, const String& title, double lastVisited);
    63     HistoryItem(const String& urlString, const String& title, const String& alternateTitle, double lastVisited);
    64     HistoryItem(const KURL& url, const String& title);
    65     HistoryItem(const KURL& url, const String& target, const String& parent, const String& title);
     61    static PassRefPtr<HistoryItem> create() { return adoptRef(new HistoryItem); }
     62    static PassRefPtr<HistoryItem> create(const String& urlString, const String& title, double lastVisited)
     63    {
     64        return adoptRef(new HistoryItem(urlString, title, lastVisited));
     65    }
     66    static PassRefPtr<HistoryItem> create(const String& urlString, const String& title, const String& alternateTitle, double lastVisited)
     67    {
     68        return adoptRef(new HistoryItem(urlString, title, alternateTitle, lastVisited));
     69    }
     70    static PassRefPtr<HistoryItem> create(const KURL& url, const String& target, const String& parent, const String& title)
     71    {
     72        return adoptRef(new HistoryItem(url, target, parent, title));
     73    }
    6674   
    6775    ~HistoryItem();
     
    147155
    148156private:
     157    HistoryItem();
     158    HistoryItem(const String& urlString, const String& title, double lastVisited);
     159    HistoryItem(const String& urlString, const String& title, const String& alternateTitle, double lastVisited);
     160    HistoryItem(const KURL& url, const String& target, const String& parent, const String& title);
     161
    149162    HistoryItem(const HistoryItem&);
    150163   
  • trunk/WebCore/html/CanvasGradient.h

    r34366 r34432  
    2828#define CanvasGradient_h
    2929
    30 #include "FloatPoint.h"
    3130#include "Gradient.h"
    3231#include <wtf/PassRefPtr.h>
    3332#include <wtf/RefCounted.h>
    34 #include <wtf/Vector.h>
    3533
    3634namespace WebCore {
  • trunk/WebCore/html/CanvasPattern.cpp

    r31834 r34432  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6767
    6868CanvasPattern::CanvasPattern(CGImageRef image, bool repeatX, bool repeatY, bool originClean)
    69     : RefCounted<CanvasPattern>(0)
    70     , m_platformImage(image)
     69    : m_platformImage(image)
    7170    , m_cachedImage(0)
    7271    , m_repeatX(repeatX)
     
    7978
    8079CanvasPattern::CanvasPattern(cairo_surface_t* surface, bool repeatX, bool repeatY, bool originClean)
    81     : RefCounted<CanvasPattern>(0)
    82     , m_platformImage(cairo_surface_reference(surface))
     80    : m_platformImage(cairo_surface_reference(surface))
    8381    , m_cachedImage(0)
    8482    , m_repeatX(repeatX)
     
    9189
    9290CanvasPattern::CanvasPattern(CachedImage* cachedImage, bool repeatX, bool repeatY, bool originClean)
    93     : RefCounted<CanvasPattern>(0)
    94 #if PLATFORM(CG) || PLATFORM(CAIRO)
    95     , m_platformImage(0)
    96 #endif
    97     , m_cachedImage(cachedImage)
     91    : m_cachedImage(cachedImage)
    9892    , m_repeatX(repeatX)
    9993    , m_repeatY(repeatY)
    10094    , m_originClean(originClean)
    10195{
     96#if PLATFORM(CAIRO)
     97    m_platformImage = 0;
     98#endif
    10299    if (cachedImage)
    103100        cachedImage->addClient(this);
  • trunk/WebCore/html/CanvasPattern.h

    r30869 r34432  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828
    2929#include "CachedResourceClient.h"
     30#include <wtf/PassRefPtr.h>
    3031#include <wtf/RefCounted.h>
    3132
     
    4950
    5051#if PLATFORM(CG)
    51         CanvasPattern(CGImageRef, bool repeatX, bool repeatY, bool originClean);
     52        static PassRefPtr<CanvasPattern> create(CGImageRef image, bool repeatX, bool repeatY, bool originClean)
     53        {
     54            return adoptRef(new CanvasPattern(image, repeatX, repeatY, originClean));
     55        }
    5256#elif PLATFORM(CAIRO)
    53         CanvasPattern(cairo_surface_t*, bool repeatX, bool repeatY, bool originClean);
     57        static PassRefPtr<CanvasPattern> create(cairo_surface_t* surface, bool repeatX, bool repeatY, bool originClean)
     58        {
     59            return adoptRef(new CanvasPattern(surface, repeatX, repeatY, originClean));
     60        }
    5461#endif
    55         CanvasPattern(CachedImage*, bool repeatX, bool repeatY, bool originClean);
    56         ~CanvasPattern();
     62        static PassRefPtr<CanvasPattern> create(CachedImage* image, bool repeatX, bool repeatY, bool originClean)
     63        {
     64            return adoptRef(new CanvasPattern(image, repeatX, repeatY, originClean));
     65        }
     66        virtual ~CanvasPattern();
    5767
    5868#if PLATFORM(CG)
     
    7383    private:
    7484#if PLATFORM(CG)
     85        CanvasPattern(CGImageRef, bool repeatX, bool repeatY, bool originClean);
     86#elif PLATFORM(CAIRO)
     87        CanvasPattern(cairo_surface_t*, bool repeatX, bool repeatY, bool originClean);
     88#endif
     89        CanvasPattern(CachedImage*, bool repeatX, bool repeatY, bool originClean);
     90
     91#if PLATFORM(CG)
    7592        const RetainPtr<CGImageRef> m_platformImage;
    7693#elif PLATFORM(CAIRO)
  • trunk/WebCore/html/CanvasRenderingContext2D.cpp

    r34366 r34432  
    8282
    8383CanvasRenderingContext2D::State::State()
    84     : m_strokeStyle(new CanvasStyle("black"))
    85     , m_fillStyle(new CanvasStyle("black"))
     84    : m_strokeStyle(CanvasStyle::create("black"))
     85    , m_fillStyle(CanvasStyle::create("black"))
    8686    , m_lineWidth(1)
    8787    , m_lineCap(ButtCap)
     
    368368void CanvasRenderingContext2D::setStrokeColor(const String& color)
    369369{
    370     setStrokeStyle(new CanvasStyle(color));
     370    setStrokeStyle(CanvasStyle::create(color));
    371371}
    372372
    373373void CanvasRenderingContext2D::setStrokeColor(float grayLevel)
    374374{
    375     setStrokeStyle(new CanvasStyle(grayLevel, 1));
     375    setStrokeStyle(CanvasStyle::create(grayLevel, 1));
    376376}
    377377
    378378void CanvasRenderingContext2D::setStrokeColor(const String& color, float alpha)
    379379{
    380     setStrokeStyle(new CanvasStyle(color, alpha));
     380    setStrokeStyle(CanvasStyle::create(color, alpha));
    381381}
    382382
    383383void CanvasRenderingContext2D::setStrokeColor(float grayLevel, float alpha)
    384384{
    385     setStrokeStyle(new CanvasStyle(grayLevel, alpha));
     385    setStrokeStyle(CanvasStyle::create(grayLevel, alpha));
    386386}
    387387
    388388void CanvasRenderingContext2D::setStrokeColor(float r, float g, float b, float a)
    389389{
    390     setStrokeStyle(new CanvasStyle(r, g, b, a));
     390    setStrokeStyle(CanvasStyle::create(r, g, b, a));
    391391}
    392392
    393393void CanvasRenderingContext2D::setStrokeColor(float c, float m, float y, float k, float a)
    394394{
    395     setStrokeStyle(new CanvasStyle(c, m, y, k, a));
     395    setStrokeStyle(CanvasStyle::create(c, m, y, k, a));
    396396}
    397397
    398398void CanvasRenderingContext2D::setFillColor(const String& color)
    399399{
    400     setFillStyle(new CanvasStyle(color));
     400    setFillStyle(CanvasStyle::create(color));
    401401}
    402402
    403403void CanvasRenderingContext2D::setFillColor(float grayLevel)
    404404{
    405     setFillStyle(new CanvasStyle(grayLevel, 1));
     405    setFillStyle(CanvasStyle::create(grayLevel, 1));
    406406}
    407407
    408408void CanvasRenderingContext2D::setFillColor(const String& color, float alpha)
    409409{
    410     setFillStyle(new CanvasStyle(color, 1));
     410    setFillStyle(CanvasStyle::create(color, 1));
    411411}
    412412
    413413void CanvasRenderingContext2D::setFillColor(float grayLevel, float alpha)
    414414{
    415     setFillStyle(new CanvasStyle(grayLevel, alpha));
     415    setFillStyle(CanvasStyle::create(grayLevel, alpha));
    416416}
    417417
    418418void CanvasRenderingContext2D::setFillColor(float r, float g, float b, float a)
    419419{
    420     setFillStyle(new CanvasStyle(r, g, b, a));
     420    setFillStyle(CanvasStyle::create(r, g, b, a));
    421421}
    422422
    423423void CanvasRenderingContext2D::setFillColor(float c, float m, float y, float k, float a)
    424424{
    425     setFillStyle(new CanvasStyle(c, m, y, k, a));
     425    setFillStyle(CanvasStyle::create(c, m, y, k, a));
    426426}
    427427
     
    11201120        originClean = m_canvas->document()->securityOrigin()->canAccess(origin.get());
    11211121    }
    1122     return new CanvasPattern(image->cachedImage(), repeatX, repeatY, originClean);
     1122    return CanvasPattern::create(image->cachedImage(), repeatX, repeatY, originClean);
    11231123}
    11241124
     
    11331133    // FIXME: Do this through platform-independent GraphicsContext API.
    11341134#if PLATFORM(CG)
    1135     CGImageRef image = canvas->createPlatformImage();
     1135    RetainPtr<CGImageRef> image = canvas->createPlatformImage();
    11361136    if (!image)
    11371137        return 0;
    1138     PassRefPtr<CanvasPattern> pattern = new CanvasPattern(image, repeatX, repeatY, canvas->originClean());
    1139     CGImageRelease(image);
    1140     return pattern;
     1138    return CanvasPattern::create(image.get(), repeatX, repeatY, canvas->originClean());
    11411139#elif PLATFORM(CAIRO)
    11421140    cairo_surface_t* surface = canvas->createPlatformImage();
    11431141    if (!surface)
    11441142        return 0;
    1145     PassRefPtr<CanvasPattern> pattern = new CanvasPattern(surface, repeatX, repeatY, canvas->originClean());
     1143    RefPtr<CanvasPattern> pattern = CanvasPattern::create(surface, repeatX, repeatY, canvas->originClean());
    11461144    cairo_surface_destroy(surface);
    1147     return pattern;
     1145    return pattern.release();
    11481146#else
    11491147    notImplemented();
  • trunk/WebCore/html/CanvasStyle.cpp

    r30122 r34432  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    33 * Copyright (C) 2007 Trolltech ASA
    44 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
     
    4848
    4949CanvasStyle::CanvasStyle(const String& color)
    50     : RefCounted<CanvasStyle>(0)
    51     , m_type(ColorString)
     50    : m_type(ColorString)
    5251    , m_color(color)
    5352{
     
    5554
    5655CanvasStyle::CanvasStyle(float grayLevel)
    57     : RefCounted<CanvasStyle>(0)
    58     , m_type(GrayLevel)
     56    : m_type(GrayLevel)
    5957    , m_alpha(1)
    6058    , m_grayLevel(grayLevel)
     
    6361
    6462CanvasStyle::CanvasStyle(const String& color, float alpha)
    65     : RefCounted<CanvasStyle>(0)
    66     , m_type(ColorStringWithAlpha), m_color(color), m_alpha(alpha)
     63    : m_type(ColorStringWithAlpha), m_color(color), m_alpha(alpha)
    6764{
    6865}
    6966
    7067CanvasStyle::CanvasStyle(float grayLevel, float alpha)
    71     : RefCounted<CanvasStyle>(0)
    72     , m_type(GrayLevel), m_alpha(alpha), m_grayLevel(grayLevel)
     68    : m_type(GrayLevel), m_alpha(alpha), m_grayLevel(grayLevel)
    7369{
    7470}
    7571
    7672CanvasStyle::CanvasStyle(float r, float g, float b, float a)
    77     : RefCounted<CanvasStyle>(0)
    78     , m_type(RGBA), m_alpha(a), m_red(r), m_green(g), m_blue(b)
     73    : m_type(RGBA), m_alpha(a), m_red(r), m_green(g), m_blue(b)
    7974{
    8075}
    8176
    8277CanvasStyle::CanvasStyle(float c, float m, float y, float k, float a)
    83     : RefCounted<CanvasStyle>(0)
    84     , m_type(CMYKA), m_alpha(a), m_cyan(c), m_magenta(m), m_yellow(y), m_black(k)
     78    : m_type(CMYKA), m_alpha(a), m_cyan(c), m_magenta(m), m_yellow(y), m_black(k)
    8579{
    8680}
    8781
    8882CanvasStyle::CanvasStyle(PassRefPtr<CanvasGradient> gradient)
    89     : RefCounted<CanvasStyle>(0)
    90     , m_type(gradient ? Gradient : ColorString), m_gradient(gradient)
     83    : m_type(gradient ? Gradient : ColorString), m_gradient(gradient)
    9184{
    9285}
    9386
    9487CanvasStyle::CanvasStyle(PassRefPtr<CanvasPattern> pattern)
    95     : RefCounted<CanvasStyle>(0)
    96     , m_type(pattern ? ImagePattern : ColorString), m_pattern(pattern)
     88    : m_type(pattern ? ImagePattern : ColorString), m_pattern(pattern)
    9789{
    9890}
  • trunk/WebCore/html/CanvasStyle.h

    r31607 r34432  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3737    class CanvasStyle : public RefCounted<CanvasStyle> {
    3838    public:
    39         CanvasStyle(const String& color);
    40         CanvasStyle(float grayLevel);
    41         CanvasStyle(const String& color, float alpha);
    42         CanvasStyle(float grayLevel, float alpha);
    43         CanvasStyle(float r, float g, float b, float a);
    44         CanvasStyle(float c, float m, float y, float k, float a);
    45         CanvasStyle(PassRefPtr<CanvasGradient>);
    46         CanvasStyle(PassRefPtr<CanvasPattern>);
     39        static PassRefPtr<CanvasStyle> create(const String& color) { return adoptRef(new CanvasStyle(color)); }
     40        static PassRefPtr<CanvasStyle> create(float grayLevel) { return adoptRef(new CanvasStyle(grayLevel)); }
     41        static PassRefPtr<CanvasStyle> create(const String& color, float alpha) { return adoptRef(new CanvasStyle(color, alpha)); }
     42        static PassRefPtr<CanvasStyle> create(float grayLevel, float alpha) { return adoptRef(new CanvasStyle(grayLevel, alpha)); }
     43        static PassRefPtr<CanvasStyle> create(float r, float g, float b, float a) { return adoptRef(new CanvasStyle(r, g, b, a)); }
     44        static PassRefPtr<CanvasStyle> create(float c, float m, float y, float k, float a) { return adoptRef(new CanvasStyle(c, m, y, k, a)); }
     45        static PassRefPtr<CanvasStyle> create(PassRefPtr<CanvasGradient> gradient) { return adoptRef(new CanvasStyle(gradient)); }
     46        static PassRefPtr<CanvasStyle> create(PassRefPtr<CanvasPattern> pattern) { return adoptRef(new CanvasStyle(pattern)); }
    4747
    4848        String color() const { return m_color; }
     
    5757
    5858    private:
     59        CanvasStyle(const String& color);
     60        CanvasStyle(float grayLevel);
     61        CanvasStyle(const String& color, float alpha);
     62        CanvasStyle(float grayLevel, float alpha);
     63        CanvasStyle(float r, float g, float b, float a);
     64        CanvasStyle(float c, float m, float y, float k, float a);
     65        CanvasStyle(PassRefPtr<CanvasGradient>);
     66        CanvasStyle(PassRefPtr<CanvasPattern>);
     67
    5968        enum Type { ColorString, ColorStringWithAlpha, GrayLevel, RGBA, CMYKA, Gradient, ImagePattern };
    6069
  • trunk/WebCore/html/HTMLCollection.cpp

    r30443 r34432  
    3737
    3838HTMLCollection::HTMLCollection(PassRefPtr<Node> base, Type type)
    39     : RefCounted<HTMLCollection>(0)
    40     , m_idsDone(false)
     39    : m_idsDone(false)
    4140    , m_base(base)
    4241    , m_type(type)
     
    4746
    4847HTMLCollection::HTMLCollection(PassRefPtr<Node> base, Type type, CollectionInfo* info)
    49     : RefCounted<HTMLCollection>(0)
    50     , m_idsDone(false)
     48    : m_idsDone(false)
    5149    , m_base(base)
    5250    , m_type(type)
     
    5452    , m_ownsInfo(false)
    5553{
     54}
     55
     56PassRefPtr<HTMLCollection> HTMLCollection::create(PassRefPtr<Node> base, Type type)
     57{
     58    return adoptRef(new HTMLCollection(base, type));
    5659}
    5760
  • trunk/WebCore/html/HTMLCollection.h

    r29101 r34432  
    7777    static const unsigned NumNamedDocumentCachedTypes = DocumentNamedItems - WindowNamedItems + 1;
    7878
    79     HTMLCollection(PassRefPtr<Node> base, Type);
     79    static PassRefPtr<HTMLCollection> create(PassRefPtr<Node> base, Type);
    8080    virtual ~HTMLCollection();
    8181   
     
    140140
    141141private:
     142    HTMLCollection(PassRefPtr<Node> base, Type);
     143
    142144    virtual Element* itemAfter(Element*) const;
    143145    virtual unsigned calcLength() const;
  • trunk/WebCore/html/HTMLElement.cpp

    r33577 r34432  
    704704PassRefPtr<HTMLCollection> HTMLElement::children()
    705705{
    706     return new HTMLCollection(this, HTMLCollection::NodeChildren);
     706    return HTMLCollection::create(this, HTMLCollection::NodeChildren);
    707707}
    708708
  • trunk/WebCore/html/HTMLFormCollection.cpp

    r30443 r34432  
    4646    : HTMLCollection(form.get(), Other, formCollectionInfo(form.get()))
    4747{
     48}
     49
     50PassRefPtr<HTMLFormCollection> HTMLFormCollection::create(PassRefPtr<HTMLFormElement> form)
     51{
     52    return adoptRef(new HTMLFormCollection(form));
    4853}
    4954
  • trunk/WebCore/html/HTMLFormCollection.h

    r28327 r34432  
    22 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    4  * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
     4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
    55 *
    66 * This library is free software; you can redistribute it and/or
     
    3636class HTMLFormCollection : public HTMLCollection {
    3737public:
    38     HTMLFormCollection(PassRefPtr<HTMLFormElement>);
    39     ~HTMLFormCollection();
     38    static PassRefPtr<HTMLFormCollection> create(PassRefPtr<HTMLFormElement>);
     39
     40    virtual ~HTMLFormCollection();
    4041
    4142    virtual Node* item(unsigned index) const;
     
    4647
    4748private:
     49    HTMLFormCollection(PassRefPtr<HTMLFormElement>);
     50
    4851    virtual void updateNameCache() const;
    4952    virtual unsigned calcLength() const;
  • trunk/WebCore/html/HTMLFormElement.cpp

    r32666 r34432  
    619619PassRefPtr<HTMLCollection> HTMLFormElement::elements()
    620620{
    621     return new HTMLFormCollection(this);
     621    return HTMLFormCollection::create(this);
    622622}
    623623
  • trunk/WebCore/html/HTMLMapElement.cpp

    r30431 r34432  
    9696PassRefPtr<HTMLCollection> HTMLMapElement::areas()
    9797{
    98     return new HTMLCollection(this, HTMLCollection::MapAreas);
     98    return HTMLCollection::create(this, HTMLCollection::MapAreas);
    9999}
    100100
  • trunk/WebCore/html/HTMLMediaElement.cpp

    r34369 r34432  
    278278    if (m_begun) {
    279279        m_begun = false;
    280         m_error = new MediaError(MediaError::MEDIA_ERR_ABORTED);
     280        m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED);
    281281        initAndDispatchProgressEvent(abortEvent);
    282282        if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
     
    364364        //m_player = 0;
    365365        // FIXME better error handling
    366         m_error = new MediaError(MediaError::MEDIA_ERR_NETWORK);
     366        m_error = MediaError::create(MediaError::MEDIA_ERR_NETWORK);
    367367        m_begun = false;
    368368        m_progressEventTimer.stop();
     
    10031003        m_progressEventTimer.stop();
    10041004
    1005         m_error = new MediaError(MediaError::MEDIA_ERR_ABORTED);
     1005        m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED);
    10061006        m_begun = false;
    10071007        initAndDispatchProgressEvent(abortEvent);
  • trunk/WebCore/html/HTMLNameCollection.h

    r28327 r34432  
    3333class HTMLNameCollection : public HTMLCollection {
    3434public:
    35     HTMLNameCollection(PassRefPtr<Document>, Type, const String& name);
     35    static PassRefPtr<HTMLNameCollection> create(PassRefPtr<Document> document, Type type, const String& name)
     36    {
     37        return adoptRef(new HTMLNameCollection(document, type, name));
     38    }
    3639   
    3740private:
     41    HTMLNameCollection(PassRefPtr<Document>, Type, const String& name);
     42
    3843    virtual Element* itemAfter(Element*) const;
    3944
  • trunk/WebCore/html/HTMLOptionsCollection.cpp

    r28584 r34432  
    3333    : HTMLCollection(select.get(), SelectOptions, select->collectionInfo())
    3434{
     35}
     36
     37PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(PassRefPtr<HTMLSelectElement> select)
     38{
     39    return adoptRef(new HTMLOptionsCollection(select));
    3540}
    3641
  • trunk/WebCore/html/HTMLOptionsCollection.h

    r28584 r34432  
    33 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
    44 *           (C) 2000 Dirk Mueller (mueller@kde.org)
    5  * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
     5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
    66 *
    77 * This library is free software; you can redistribute it and/or
     
    3636class HTMLOptionsCollection : public HTMLCollection {
    3737public:
    38     HTMLOptionsCollection(PassRefPtr<HTMLSelectElement>);
     38    static PassRefPtr<HTMLOptionsCollection> create(PassRefPtr<HTMLSelectElement>);
    3939
    4040    void add(PassRefPtr<HTMLOptionElement>, ExceptionCode&);
     
    4646
    4747    void setLength(unsigned, ExceptionCode&);
     48
     49private:
     50    HTMLOptionsCollection(PassRefPtr<HTMLSelectElement>);
    4851};
    4952
  • trunk/WebCore/html/HTMLSelectElement.cpp

    r34405 r34432  
    493493PassRefPtr<HTMLOptionsCollection> HTMLSelectElement::options()
    494494{
    495     return new HTMLOptionsCollection(this);
     495    return HTMLOptionsCollection::create(this);
    496496}
    497497
  • trunk/WebCore/html/HTMLTableElement.cpp

    r31357 r34432  
    659659PassRefPtr<HTMLCollection> HTMLTableElement::rows()
    660660{
    661     return new HTMLTableRowsCollection(this);
     661    return HTMLTableRowsCollection::create(this);
    662662}
    663663
    664664PassRefPtr<HTMLCollection> HTMLTableElement::tBodies()
    665665{
    666     return new HTMLCollection(this, HTMLCollection::TableTBodies);
     666    return HTMLCollection::create(this, HTMLCollection::TableTBodies);
    667667}
    668668
  • trunk/WebCore/html/HTMLTableRowElement.cpp

    r28327 r34432  
    168168PassRefPtr<HTMLCollection> HTMLTableRowElement::cells()
    169169{
    170     return new HTMLCollection(this, HTMLCollection::TRCells);
     170    return HTMLCollection::create(this, HTMLCollection::TRCells);
    171171}
    172172
  • trunk/WebCore/html/HTMLTableRowsCollection.cpp

    r29101 r34432  
    150150
    151151HTMLTableRowsCollection::HTMLTableRowsCollection(PassRefPtr<HTMLTableElement> table)
    152     : HTMLCollection(table, Other)
     152    : HTMLCollection(table, Other, 0)
    153153{
     154}
     155
     156PassRefPtr<HTMLTableRowsCollection> HTMLTableRowsCollection::create(PassRefPtr<HTMLTableElement> table)
     157{
     158    return adoptRef(new HTMLTableRowsCollection(table));
    154159}
    155160
  • trunk/WebCore/html/HTMLTableRowsCollection.h

    r29101 r34432  
    3939class HTMLTableRowsCollection : public HTMLCollection {
    4040public:
    41     HTMLTableRowsCollection(PassRefPtr<HTMLTableElement>);
     41    static PassRefPtr<HTMLTableRowsCollection> create(PassRefPtr<HTMLTableElement>);
    4242
    4343    static HTMLTableRowElement* rowAfter(HTMLTableElement*, HTMLTableRowElement*);
     
    4545
    4646private:
     47    HTMLTableRowsCollection(PassRefPtr<HTMLTableElement>);
     48
    4749    virtual Element* itemAfter(Element*) const;
    4850};
  • trunk/WebCore/html/HTMLTableSectionElement.cpp

    r29647 r34432  
    170170PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows()
    171171{
    172     return new HTMLCollection(this, HTMLCollection::TSectionRows);
     172    return HTMLCollection::create(this, HTMLCollection::TSectionRows);
    173173}
    174174
  • trunk/WebCore/html/MediaError.h

    r30122 r34432  
    3737    enum Code { MEDIA_ERR_ABORTED = 1, MEDIA_ERR_NETWORK, MEDIA_ERR_DECODE };
    3838
    39     MediaError(Code code) : RefCounted<MediaError>(0), m_code(code) { }
     39    static PassRefPtr<MediaError> create(Code code) { return adoptRef(new MediaError(code)); }
    4040
    4141    Code code() const { return m_code; }
    4242
    4343private:
     44    MediaError(Code code) : m_code(code) { }
     45
    4446    Code m_code;
    4547};
  • trunk/WebCore/loader/CachedCSSStyleSheet.cpp

    r31834 r34432  
    3939CachedCSSStyleSheet::CachedCSSStyleSheet(const String& url, const String& charset)
    4040    : CachedResource(url, CSSStyleSheet)
    41     , m_decoder(new TextResourceDecoder("text/css", charset))
     41    , m_decoder(TextResourceDecoder::create("text/css", charset))
    4242{
    4343    // Prefer text/css but accept any type (dell.com serves a stylesheet
  • trunk/WebCore/loader/CachedFont.cpp

    r31834 r34432  
    136136        m_externalSVGDocument->open();
    137137
    138         TextResourceDecoder decoder("application/xml");
    139         m_externalSVGDocument->write(decoder.decode(m_data->data(), m_data->size()));
    140         if (decoder.sawError()) {
     138        RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
     139        m_externalSVGDocument->write(decoder->decode(m_data->data(), m_data->size()));
     140        if (decoder->sawError()) {
    141141            m_externalSVGDocument.clear();
    142142            return 0;
  • trunk/WebCore/loader/CachedXSLStyleSheet.cpp

    r31834 r34432  
    4343CachedXSLStyleSheet::CachedXSLStyleSheet(const String &url)
    4444    : CachedResource(url, XSLStyleSheet)
    45     , m_decoder(new TextResourceDecoder("text/xsl"))
     45    , m_decoder(TextResourceDecoder::create("text/xsl"))
    4646{
    4747    // It's XML we want.
  • trunk/WebCore/loader/FrameLoader.cpp

    r34273 r34432  
    997997    if (!m_decoder) {
    998998        Settings* settings = m_frame->settings();
    999         m_decoder = new TextResourceDecoder(m_responseMIMEType, settings ? settings->defaultTextEncodingName() : String());
     999        m_decoder = TextResourceDecoder::create(m_responseMIMEType, settings ? settings->defaultTextEncodingName() : String());
    10001000        if (m_encoding.isEmpty()) {
    10011001            Frame* parentFrame = m_frame->tree()->parent();
     
    39753975        originalURL = blankURL();
    39763976   
    3977     RefPtr<HistoryItem> item = new HistoryItem(url, m_frame->tree()->name(), m_frame->tree()->parent() ? m_frame->tree()->parent()->tree()->name() : "", docLoader ? docLoader->title() : "");
     3977    RefPtr<HistoryItem> item = HistoryItem::create(url, m_frame->tree()->name(), m_frame->tree()->parent() ? m_frame->tree()->parent()->tree()->name() : "", docLoader ? docLoader->title() : "");
    39783978    item->setOriginalURLString(originalURL.string());
    39793979   
  • trunk/WebCore/loader/ImageDocument.cpp

    r31155 r34432  
    5353class ImageEventListener : public EventListener {
    5454public:
    55     ImageEventListener(ImageDocument* doc) : m_doc(doc) { }
     55    static PassRefPtr<ImageEventListener> create(ImageDocument* document) { return adoptRef(new ImageEventListener(document)); }
    5656    virtual void handleEvent(Event*, bool isWindowEvent);
    5757
    5858private:
     59    ImageEventListener(ImageDocument* document) : m_doc(document) { }
    5960    ImageDocument* m_doc;
    6061};
     
    174175    if (shouldShrinkToFit()) {
    175176        // Add event listeners
    176         RefPtr<EventListener> listener = new ImageEventListener(this);
     177        RefPtr<EventListener> listener = ImageEventListener::create(this);
    177178        addWindowEventListener("resize", listener, false);
    178179        imageElement->addEventListener("click", listener.release(), false);
  • trunk/WebCore/loader/TextResourceDecoder.cpp

    r34202 r34432  
    321321
    322322TextResourceDecoder::TextResourceDecoder(const String& mimeType, const TextEncoding& specifiedDefaultEncoding)
    323     : RefCounted<TextResourceDecoder>(0)
    324     , m_contentType(determineContentType(mimeType))
     323    : m_contentType(determineContentType(mimeType))
    325324    , m_decoder(defaultEncoding(m_contentType, specifiedDefaultEncoding))
    326325    , m_source(DefaultEncoding)
  • trunk/WebCore/loader/TextResourceDecoder.h

    r31316 r34432  
    11/*
    2     This file is part of the KDE libraries
    3 
    42    Copyright (C) 1999 Lars Knoll (knoll@mpi-hd.mpg.de)
    53    Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
    6     Copyright (C) 2006 Apple Computer, Inc.
     4    Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    75
    86    This library is free software; you can redistribute it and/or
     
    2624#define TextResourceDecoder_h
    2725
    28 #include "PlatformString.h"
    29 #include <wtf/RefCounted.h>
    3026#include "TextDecoder.h"
    31 #include <wtf/Vector.h>
    3227
    3328namespace WebCore {
     
    4540    };
    4641
    47     TextResourceDecoder(const String& mimeType, const TextEncoding& defaultEncoding = TextEncoding());
     42    static PassRefPtr<TextResourceDecoder> create(const String& mimeType, const TextEncoding& defaultEncoding = TextEncoding())
     43    {
     44        return adoptRef(new TextResourceDecoder(mimeType, defaultEncoding));
     45    }
    4846    ~TextResourceDecoder();
    4947
     
    5755
    5856private:
     57    TextResourceDecoder(const String& mimeType, const TextEncoding& defaultEncoding);
     58
    5959    enum ContentType { PlainText, HTML, XML, CSS }; // PlainText is equivalent to directly using TextDecoder.
    6060    static ContentType determineContentType(const String& mimeType);
  • trunk/WebCore/loader/appcache/DOMApplicationCache.h

    r32006 r34432  
    7979    using RefCounted<DOMApplicationCache>::deref;
    8080
    81     void setOnCheckingListener(EventListener* eventListener) { m_onCheckingListener = eventListener; }
     81    void setOnCheckingListener(PassRefPtr<EventListener> eventListener) { m_onCheckingListener = eventListener; }
    8282    EventListener* onCheckingListener() const { return m_onCheckingListener.get(); }
    8383
    84     void setOnErrorListener(EventListener* eventListener) { m_onErrorListener = eventListener; }
     84    void setOnErrorListener(PassRefPtr<EventListener> eventListener) { m_onErrorListener = eventListener; }
    8585    EventListener* onErrorListener() const { return m_onErrorListener.get(); }
    8686
    87     void setOnNoUpdateListener(EventListener* eventListener) { m_onNoUpdateListener = eventListener; }
     87    void setOnNoUpdateListener(PassRefPtr<EventListener> eventListener) { m_onNoUpdateListener = eventListener; }
    8888    EventListener* onNoUpdateListener() const { return m_onNoUpdateListener.get(); }
    8989
    90     void setOnDownloadingListener(EventListener* eventListener) { m_onDownloadingListener = eventListener; }
     90    void setOnDownloadingListener(PassRefPtr<EventListener> eventListener) { m_onDownloadingListener = eventListener; }
    9191    EventListener* onDownloadingListener() const { return m_onDownloadingListener.get(); }
    9292   
    93     void setOnProgressListener(EventListener* eventListener) { m_onProgressListener = eventListener; }
     93    void setOnProgressListener(PassRefPtr<EventListener> eventListener) { m_onProgressListener = eventListener; }
    9494    EventListener* onProgressListener() const { return m_onProgressListener.get(); }
    9595
    96     void setOnUpdateReadyListener(EventListener* eventListener) { m_onUpdateReadyListener = eventListener; }
     96    void setOnUpdateReadyListener(PassRefPtr<EventListener> eventListener) { m_onUpdateReadyListener = eventListener; }
    9797    EventListener* onUpdateReadyListener() const { return m_onUpdateReadyListener.get(); }
    9898
    99     void setOnCachedListener(EventListener* eventListener) { m_onCachedListener = eventListener; }
     99    void setOnCachedListener(PassRefPtr<EventListener> eventListener) { m_onCachedListener = eventListener; }
    100100    EventListener* onCachedListener() const { return m_onCachedListener.get(); }
    101101   
     
    112112   
    113113private:
    114     DOMApplicationCache(Frame* frame);
    115     void callListener(const AtomicString& eventType, EventListener* listener);
     114    DOMApplicationCache(Frame*);
     115    void callListener(const AtomicString& eventType, EventListener*);
    116116   
    117117    virtual void refEventTarget() { ref(); }
  • trunk/WebCore/page/Page.cpp

    r33585 r34432  
    436436        return m_userStyleSheet;
    437437
    438     m_userStyleSheet = TextResourceDecoder("text/css").decode(data->data(), data->size());
     438    m_userStyleSheet = TextResourceDecoder::create("text/css")->decode(data->data(), data->size());
    439439
    440440    return m_userStyleSheet;
  • trunk/WebCore/svg/SVGException.h

    r29663 r34432  
    11/*
    22 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
    3  * Copyright (C) 2006 Apple Computer, Inc.
     3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    44 *
    55 * This library is free software; you can redistribute it and/or
     
    2323#define SVGException_h
    2424
     25#include "ExceptionBase.h"
     26
    2527#if ENABLE(SVG)
    26 
    27 #include "ExceptionBase.h"
    2828
    2929namespace WebCore {
     
    3131    class SVGException : public ExceptionBase {
    3232    public:
    33         SVGException(const ExceptionCodeDescription& description)
    34             : ExceptionBase(description)
     33        static PassRefPtr<SVGException> create(const ExceptionCodeDescription& description)
    3534        {
     35            return adoptRef(new SVGException(description));
    3636        }
    3737
     
    4444            SVG_MATRIX_NOT_INVERTABLE   = SVGExceptionOffset + 2
    4545        };
     46
     47    private:
     48        SVGException(const ExceptionCodeDescription& description)
     49            : ExceptionBase(description)
     50        {
     51        }
    4652    };
    4753
  • trunk/WebCore/svg/animation/SVGSMILElement.cpp

    r32498 r34432  
    5454class ConditionEventListener : public EventListener {
    5555public:
     56    static PassRefPtr<ConditionEventListener> create(SVGSMILElement* animation, Element* eventBase, SVGSMILElement::Condition* condition)
     57    {
     58        return adoptRef(new ConditionEventListener(animation, eventBase, condition));
     59    }
     60
     61    void unregister()
     62    {
     63        // If this has only one ref then the event base is dead already and we don't need to remove ourself.
     64        if (!hasOneRef())
     65            m_eventBase->removeEventListener(m_condition->m_name, this, false);
     66    }
     67
     68    virtual void handleEvent(Event* event, bool isWindowEvent)
     69    {
     70        m_animation->handleConditionEvent(event, m_condition);
     71    }
     72
     73private:
    5674    ConditionEventListener(SVGSMILElement* animation, Element* eventBase, SVGSMILElement::Condition* condition)
    5775        : m_animation(animation)
     
    6280    }
    6381
    64     void unregister()
    65     {
    66         // If this has only one ref then the event base is dead already and we don't need to remove ourself.
    67         if (!hasOneRef())
    68             m_eventBase->removeEventListener(m_condition->m_name, this, false);
    69     }
    70 
    71     virtual void handleEvent(Event* event, bool isWindowEvent)
    72     {
    73         m_animation->handleConditionEvent(event, m_condition);
    74     }
    75 private:
    7682    SVGSMILElement* m_animation;
    7783    SVGSMILElement::Condition* m_condition;
     
    378384                continue;
    379385            ASSERT(!condition.m_eventListener);
    380             condition.m_eventListener = new ConditionEventListener(this, eventBase, &condition);
     386            condition.m_eventListener = ConditionEventListener::create(this, eventBase, &condition);
    381387        } else if (condition.m_type == Condition::Syncbase) {
    382388            ASSERT(!condition.m_baseID.isEmpty());
  • trunk/WebCore/xml/XMLHttpRequest.cpp

    r34041 r34432  
    206206}
    207207
    208 void XMLHttpRequest::setOnReadyStateChangeListener(EventListener* eventListener)
     208void XMLHttpRequest::setOnReadyStateChangeListener(PassRefPtr<EventListener> eventListener)
    209209{
    210210    m_onReadyStateChangeListener = eventListener;
     
    221221}
    222222
    223 void XMLHttpRequest::setOnLoadListener(EventListener* eventListener)
     223void XMLHttpRequest::setOnLoadListener(PassRefPtr<EventListener> eventListener)
    224224{
    225225    m_onLoadListener = eventListener;
    226226}
    227227
    228 void XMLHttpRequest::setOnProgressListener(EventListener* eventListener)
     228void XMLHttpRequest::setOnProgressListener(PassRefPtr<EventListener> eventListener)
    229229{
    230230    m_onProgressListener = eventListener;
     
    934934    if (!m_decoder) {
    935935        if (!m_responseEncoding.isEmpty())
    936             m_decoder = new TextResourceDecoder("text/plain", m_responseEncoding);
     936            m_decoder = TextResourceDecoder::create("text/plain", m_responseEncoding);
    937937        // allow TextResourceDecoder to look inside the m_response if it's XML or HTML
    938938        else if (responseIsXML())
    939             m_decoder = new TextResourceDecoder("application/xml");
     939            m_decoder = TextResourceDecoder::create("application/xml");
    940940        else if (responseMIMEType() == "text/html")
    941             m_decoder = new TextResourceDecoder("text/html", "UTF-8");
     941            m_decoder = TextResourceDecoder::create("text/html", "UTF-8");
    942942        else
    943             m_decoder = new TextResourceDecoder("text/plain", "UTF-8");
     943            m_decoder = TextResourceDecoder::create("text/plain", "UTF-8");
    944944    }
    945945    if (len == 0)
  • trunk/WebCore/xml/XMLHttpRequest.h

    r34041 r34432  
    6666    Document* responseXML() const;
    6767
    68     void setOnReadyStateChangeListener(EventListener*);
     68    void setOnReadyStateChangeListener(PassRefPtr<EventListener>);
    6969    EventListener* onReadyStateChangeListener() const;
    70     void setOnLoadListener(EventListener*);
     70    void setOnLoadListener(PassRefPtr<EventListener>);
    7171    EventListener* onLoadListener() const;
    72     void setOnProgressListener(EventListener*);
     72    void setOnProgressListener(PassRefPtr<EventListener>);
    7373    EventListener* onProgressListener() const;
    7474
  • trunk/WebCore/xml/XMLHttpRequestException.h

    r33559 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3636    class XMLHttpRequestException : public ExceptionBase {
    3737    public:
    38         XMLHttpRequestException(const ExceptionCodeDescription& description)
    39             : ExceptionBase(description)
     38        static PassRefPtr<XMLHttpRequestException> create(const ExceptionCodeDescription& description)
    4039        {
     40            return adoptRef(new XMLHttpRequestException(description));
    4141        }
    4242
     
    4848            ABORT_ERR
    4949        };
     50
     51    private:
     52        XMLHttpRequestException(const ExceptionCodeDescription& description)
     53            : ExceptionBase(description)
     54        {
     55        }
    5056    };
    5157
  • trunk/WebCore/xml/XPathException.h

    r29663 r34432  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030#define XPathException_h
    3131
     32#include "ExceptionBase.h"
     33
    3234#if ENABLE(XPATH)
    33 
    34 #include "ExceptionBase.h"
    3535
    3636namespace WebCore {
     
    3838    class XPathException : public ExceptionBase {
    3939    public:
    40         XPathException(const ExceptionCodeDescription& description)
    41             : ExceptionBase(description)
     40        static PassRefPtr<XPathException> create(const ExceptionCodeDescription& description)
    4241        {
     42            return adoptRef(new XPathException(description));
    4343        }
    4444
     
    5050            TYPE_ERR
    5151        };
     52
     53    private:
     54        XPathException(const ExceptionCodeDescription& description)
     55            : ExceptionBase(description)
     56        {
     57        }
    5258    };
    5359
  • trunk/WebCore/xml/XPathResult.cpp

    r30419 r34432  
    4343class InvalidatingEventListener : public EventListener {
    4444public:
     45    static PassRefPtr<InvalidatingEventListener> create(XPathResult* result) { return adoptRef(new InvalidatingEventListener(result)); }
     46    virtual void handleEvent(Event*, bool) { m_result->invalidateIteratorState(); }
     47
     48private:
    4549    InvalidatingEventListener(XPathResult* result) : m_result(result) { }
    46     virtual void handleEvent(Event*, bool) { m_result->invalidateIteratorState(); }
    47 private:
    4850    XPathResult* m_result;
    4951};
     
    5355    , m_eventTarget(eventTarget)
    5456{
    55     m_eventListener = new InvalidatingEventListener(this);
     57    m_eventListener = InvalidatingEventListener::create(this);
    5658    m_eventTarget->addEventListener(EventNames::DOMSubtreeModifiedEvent, m_eventListener, false);
    5759    switch (m_value.type()) {
  • trunk/WebCore/xml/XSLTProcessor.cpp

    r34187 r34432  
    270270    result->open();
    271271   
    272     RefPtr<TextResourceDecoder> decoder = new TextResourceDecoder(sourceMIMEType);
     272    RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIMEType);
    273273    decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncoding(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader);
    274     result->setDecoder(decoder.get());
     274    result->setDecoder(decoder.release());
    275275   
    276276    result->write(documentSource);
  • trunk/WebKit/mac/ChangeLog

    r34351 r34432  
     12008-06-07  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Mitz.
     4
     5        - work on https://bugs.webkit.org/show_bug.cgi?id=17257
     6          start ref counts at 1 instead of 0 for speed
     7
     8        * History/WebHistoryItem.mm:
     9        (-[WebHistoryItem init]):
     10        (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
     11        (-[WebHistoryItem initWithURL:target:parent:title:]):
     12        (-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]):
     13        * WebView/WebView.mm:
     14        (+[WebView _decodeData:]):
     15
    1162008-06-03  Oliver Hunt  <oliver@apple.com>
    217
  • trunk/WebKit/mac/History/WebHistoryItem.mm

    r31260 r34432  
    9292- (id)init
    9393{
    94     return [self initWithWebCoreHistoryItem:(new HistoryItem)];
     94    return [self initWithWebCoreHistoryItem:HistoryItem::create()];
    9595}
    9696
     
    9898{
    9999    WebCoreThreadViolationCheck();
    100     return [self initWithWebCoreHistoryItem:(new HistoryItem(URLString, title, time))];
     100    return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, time)];
    101101}
    102102
     
    277277- (id)initWithURL:(NSURL *)URL target:(NSString *)target parent:(NSString *)parent title:(NSString *)title
    278278{
    279     return [self initWithWebCoreHistoryItem:(new HistoryItem(URL, target, parent, title))];
     279    return [self initWithWebCoreHistoryItem:HistoryItem::create(URL, target, parent, title)];
    280280}
    281281
    282282- (id)initWithURLString:(NSString *)URLString title:(NSString *)title displayTitle:(NSString *)displayTitle lastVisitedTimeInterval:(NSTimeInterval)time
    283283{
    284     return [self initWithWebCoreHistoryItem:(new HistoryItem(URLString, title, displayTitle, time))];
     284    return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, displayTitle, time)];
    285285}
    286286
  • trunk/WebKit/mac/WebView/WebView.mm

    r34189 r34432  
    11931193{
    11941194    HTMLNames::init(); // this method is used for importing bookmarks at startup, so HTMLNames are likely to be uninitialized yet
    1195     RefPtr<TextResourceDecoder> decoder = new TextResourceDecoder("text/html"); // bookmark files are HTML
     1195    RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/html"); // bookmark files are HTML
    11961196    String result = decoder->decode(static_cast<const char*>([data bytes]), [data length]);
    11971197    result += decoder->flush();
  • trunk/WebKit/win/ChangeLog

    r34346 r34432  
     12008-06-07  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Mitz.
     4
     5        - work on https://bugs.webkit.org/show_bug.cgi?id=17257
     6          start ref counts at 1 instead of 0 for speed
     7
     8        * WebHistoryItem.cpp:
     9        (WebHistoryItem::createInstance):
     10        (WebHistoryItem::initFromDictionaryRepresentation):
     11        (WebHistoryItem::initWithURLString):
     12
    1132008-05-30  Steve Falkenburg  <sfalken@apple.com>
    214
  • trunk/WebKit/win/WebHistoryItem.cpp

    r31212 r34432  
    6969WebHistoryItem* WebHistoryItem::createInstance()
    7070{
    71     WebHistoryItem* instance = new WebHistoryItem(new HistoryItem);
     71    WebHistoryItem* instance = new WebHistoryItem(HistoryItem::create());
    7272    instance->AddRef();
    7373    return instance;
     
    127127
    128128    historyItemWrappers().remove(m_historyItem.get());
    129     m_historyItem = new HistoryItem(urlStringRef, titleRef, lastVisitedTime);
     129    m_historyItem = HistoryItem::create(urlStringRef, titleRef, lastVisitedTime);
    130130    historyItemWrappers().set(m_historyItem.get(), this);
    131131
     
    361361{
    362362    historyItemWrappers().remove(m_historyItem.get());
    363     m_historyItem = new HistoryItem(String(urlString, SysStringLen(urlString)), String(title, SysStringLen(title)), MarshallingHelpers::DATEToCFAbsoluteTime(lastVisited));
     363    m_historyItem = HistoryItem::create(String(urlString, SysStringLen(urlString)), String(title, SysStringLen(title)), MarshallingHelpers::DATEToCFAbsoluteTime(lastVisited));
    364364    historyItemWrappers().set(m_historyItem.get(), this);
    365365
Note: See TracChangeset for help on using the changeset viewer.