Changeset 62791 in webkit


Ignore:
Timestamp:
Jul 8, 2010 9:08:33 AM (14 years ago)
Author:
vitalyr@chromium.org
Message:

2010-07-08 Vitaly Repeshko <vitalyr@chromium.org>

Reviewed by Pavel Feldman.

Fix adoptRef usage violations (mostly in chromium)
https://bugs.webkit.org/show_bug.cgi?id=41863

  • bindings/v8/V8DOMWrapper.cpp: (WebCore::V8DOMWrapper::wrapNativeNodeFilter):
  • bindings/v8/V8NodeFilterCondition.h: (WebCore::V8NodeFilterCondition::create):
  • bindings/v8/custom/V8HTMLAllCollectionCustom.cpp: (WebCore::getNamedItems):
  • bindings/v8/custom/V8HTMLCollectionCustom.cpp: (WebCore::getNamedItems):
  • bindings/v8/custom/V8HTMLFormElementCustom.cpp: (WebCore::V8HTMLFormElement::namedPropertyGetter):
  • bindings/v8/custom/V8HTMLSelectElementCustom.cpp: (WebCore::V8HTMLSelectElement::namedPropertyGetter):
  • bindings/v8/custom/V8NamedNodesCollection.h: (WebCore::V8NamedNodesCollection::create): (WebCore::V8NamedNodesCollection::V8NamedNodesCollection):
  • storage/IDBDatabaseRequest.cpp: (WebCore::IDBDatabaseRequest::IDBDatabaseRequest):
  • storage/IndexedDatabaseRequest.cpp: (WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest):

2010-07-08 Vitaly Repeshko <vitalyr@chromium.org>

Reviewed by Pavel Feldman.

Fix adoptRef usage violations (mostly in chromium)
https://bugs.webkit.org/show_bug.cgi?id=41863

  • src/IDBCallbacksProxy.cpp: (WebCore::IDBCallbacksProxy::create):
  • src/WebPopupMenuImpl.cpp: (WebKit::WebPopupMenu::create):
  • src/WebViewImpl.cpp: (WebKit::WebView::create):
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r62784 r62791  
     12010-07-08  Vitaly Repeshko  <vitalyr@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Fix adoptRef usage violations (mostly in chromium)
     6        https://bugs.webkit.org/show_bug.cgi?id=41863
     7
     8        * bindings/v8/V8DOMWrapper.cpp:
     9        (WebCore::V8DOMWrapper::wrapNativeNodeFilter):
     10        * bindings/v8/V8NodeFilterCondition.h:
     11        (WebCore::V8NodeFilterCondition::create):
     12        * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
     13        (WebCore::getNamedItems):
     14        * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
     15        (WebCore::getNamedItems):
     16        * bindings/v8/custom/V8HTMLFormElementCustom.cpp:
     17        (WebCore::V8HTMLFormElement::namedPropertyGetter):
     18        * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
     19        (WebCore::V8HTMLSelectElement::namedPropertyGetter):
     20        * bindings/v8/custom/V8NamedNodesCollection.h:
     21        (WebCore::V8NamedNodesCollection::create):
     22        (WebCore::V8NamedNodesCollection::V8NamedNodesCollection):
     23        * storage/IDBDatabaseRequest.cpp:
     24        (WebCore::IDBDatabaseRequest::IDBDatabaseRequest):
     25        * storage/IndexedDatabaseRequest.cpp:
     26        (WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest):
     27
    1282010-07-08  Xan Lopez  <xlopez@igalia.com>
    229
  • trunk/WebCore/bindings/v8/V8DOMWrapper.cpp

    r60932 r62791  
    225225        return 0;
    226226
    227     NodeFilterCondition* condition = new V8NodeFilterCondition(filter);
    228     return NodeFilter::create(condition);
     227    return NodeFilter::create(V8NodeFilterCondition::create(filter));
    229228}
    230229
  • trunk/WebCore/bindings/v8/V8NodeFilterCondition.h

    r41920 r62791  
    3434#include "NodeFilterCondition.h"
    3535#include <v8.h>
     36#include <wtf/PassRefPtr.h>
    3637
    3738// NodeFilter is a JavaScript function that takes a Node as parameter and returns a short (ACCEPT, SKIP, REJECT) as the result.
     
    4445    class V8NodeFilterCondition : public NodeFilterCondition {
    4546    public:
    46         explicit V8NodeFilterCondition(v8::Handle<v8::Value> filter);
     47        static PassRefPtr<V8NodeFilterCondition> create(v8::Handle<v8::Value> filter)
     48        {
     49            return adoptRef(new V8NodeFilterCondition(filter));
     50        }
     51
    4752        virtual ~V8NodeFilterCondition();
    4853
     
    5055
    5156    private:
     57        explicit V8NodeFilterCondition(v8::Handle<v8::Value> filter);
     58
    5259        mutable v8::Persistent<v8::Value> m_filter;
    5360    };
  • trunk/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp

    r54349 r62791  
    5353        return toV8(namedItems.at(0).release());
    5454
    55     NodeList* list = new V8NamedNodesCollection(namedItems);
    56     return toV8(list);
     55    return toV8(V8NamedNodesCollection::create(namedItems));
    5756}
    5857
  • trunk/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp

    r54349 r62791  
    5353        return toV8(namedItems.at(0).release());
    5454
    55     NodeList* list = new V8NamedNodesCollection(namedItems);
    56     return toV8(list);
     55    return toV8(V8NamedNodesCollection::create(namedItems));
    5756}
    5857
  • trunk/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp

    r58295 r62791  
    7878        return toV8(elements.at(0).release());
    7979
    80     NodeList* collection = new V8NamedNodesCollection(elements);
    81     return toV8(collection);
     80    return toV8(V8NamedNodesCollection::create(elements));
    8281}
    8382
  • trunk/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp

    r54305 r62791  
    7171        return toV8(items.at(0).release());
    7272
    73     NodeList* list = new V8NamedNodesCollection(items);
    74     return toV8(list);
     73    return toV8(V8NamedNodesCollection::create(items));
    7574}
    7675
  • trunk/WebCore/bindings/v8/custom/V8NamedNodesCollection.h

    r40873 r62791  
    3434#include "Node.h"
    3535#include "NodeList.h"
     36#include <wtf/PassRefPtr.h>
    3637#include <wtf/RefPtr.h>
    3738#include <wtf/Vector.h>
     
    4142    class V8NamedNodesCollection : public NodeList {
    4243    public:
    43         explicit V8NamedNodesCollection(const Vector<RefPtr<Node> >& nodes)
    44             : m_nodes(nodes) { }
     44        static PassRefPtr<NodeList> create(const Vector<RefPtr<Node> >& nodes)
     45        {
     46            return adoptRef(new V8NamedNodesCollection(nodes));
     47        }
     48
    4549        virtual unsigned length() const { return m_nodes.size(); }
    4650        virtual Node* item(unsigned) const;
     
    4852
    4953    private:
     54        explicit V8NamedNodesCollection(const Vector<RefPtr<Node> >& nodes)
     55            : m_nodes(nodes) { }
     56
    5057        Vector<RefPtr<Node> > m_nodes;
    5158    };
  • trunk/WebCore/storage/IDBDatabaseRequest.cpp

    r61015 r62791  
    4141{
    4242    m_this = IDBAny::create();
     43    // We pass a reference to this object before it can be adopted.
     44    relaxAdoptionRequirement();
    4345    m_this->set(this);
    4446}
  • trunk/WebCore/storage/IndexedDatabaseRequest.cpp

    r61120 r62791  
    4646{
    4747    m_this = IDBAny::create();
     48    // We pass a reference to this object before it can be adopted.
     49    relaxAdoptionRequirement();
    4850    m_this->set(this);
    4951}
     
    9597
    9698#endif // ENABLE(INDEXED_DATABASE)
    97 
  • trunk/WebKit/chromium/ChangeLog

    r62774 r62791  
     12010-07-08  Vitaly Repeshko  <vitalyr@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Fix adoptRef usage violations (mostly in chromium)
     6        https://bugs.webkit.org/show_bug.cgi?id=41863
     7
     8        * src/IDBCallbacksProxy.cpp:
     9        (WebCore::IDBCallbacksProxy::create):
     10        * src/WebPopupMenuImpl.cpp:
     11        (WebKit::WebPopupMenu::create):
     12        * src/WebViewImpl.cpp:
     13        (WebKit::WebView::create):
     14
    1152010-07-07  Alexander Pavlov  <apavlov@chromium.org>
    216
  • trunk/WebKit/chromium/src/IDBCallbacksProxy.cpp

    r62452 r62791  
    4545PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks)
    4646{
    47     return new IDBCallbacksProxy(callbacks);
     47    return adoptRef(new IDBCallbacksProxy(callbacks));
    4848}
    4949
     
    101101
    102102#endif // ENABLE(INDEXED_DATABASE)
    103 
  • trunk/WebKit/chromium/src/WebPopupMenuImpl.cpp

    r62039 r62791  
    5757WebPopupMenu* WebPopupMenu::create(WebWidgetClient* client)
    5858{
    59     return new WebPopupMenuImpl(client);
     59    // Pass the WebPopupMenuImpl's self-reference to the caller.
     60    return adoptRef(new WebPopupMenuImpl(client)).leakRef();
    6061}
    6162
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r62774 r62791  
    171171WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient)
    172172{
    173     return new WebViewImpl(client, devToolsClient);
     173    // Pass the WebViewImpl's self-reference to the caller.
     174    return adoptRef(new WebViewImpl(client, devToolsClient)).leakRef();
    174175}
    175176
Note: See TracChangeset for help on using the changeset viewer.