Changeset 62736 in webkit


Ignore:
Timestamp:
Jul 7, 2010 6:19:36 PM (14 years ago)
Author:
Darin Adler
Message:

2010-07-07 Darin Adler <Darin Adler>

Reviewed by Anders Carlsson.

Fix adoptRef assertion failures caused by stack-allocated ResourceHandle objects
https://bugs.webkit.org/show_bug.cgi?id=41823

  • platform/network/android/ResourceHandleAndroid.cpp: (WebCore::ResourceHandle::loadResourceSynchronously): Use adoptRef and new instead of allocating an object on the stack.
  • platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::loadResourceSynchronously): Ditto.
  • platform/network/qt/ResourceHandleQt.cpp: (WebCore::ResourceHandle::loadResourceSynchronously): Ditto.
  • platform/network/soup/ResourceHandleSoup.cpp: (WebCore::ResourceHandle::loadResourceSynchronously): Use create instead of allocating an object on the stack.
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r62735 r62736  
     12010-07-07  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Fix adoptRef assertion failures caused by stack-allocated ResourceHandle objects
     6        https://bugs.webkit.org/show_bug.cgi?id=41823
     7
     8        * platform/network/android/ResourceHandleAndroid.cpp:
     9        (WebCore::ResourceHandle::loadResourceSynchronously): Use adoptRef and new instead
     10        of allocating an object on the stack.
     11        * platform/network/curl/ResourceHandleCurl.cpp:
     12        (WebCore::ResourceHandle::loadResourceSynchronously): Ditto.
     13        * platform/network/qt/ResourceHandleQt.cpp:
     14        (WebCore::ResourceHandle::loadResourceSynchronously): Ditto.
     15
     16        * platform/network/soup/ResourceHandleSoup.cpp:
     17        (WebCore::ResourceHandle::loadResourceSynchronously): Use create instead of
     18        allocating an object on the stack.
     19
    1202010-07-07  Joseph Pecoraro  <joepeck@webkit.org>
    221
  • trunk/WebCore/platform/network/android/ResourceHandleAndroid.cpp

    r61768 r62736  
    147147{
    148148    SyncLoader s(error, response, data);
    149     ResourceHandle h(request, &s, false, false, false);
     149    RefPtr<ResourceHandle> h = adoptRef(new ResourceHandle(request, &s, false, false, false));
    150150    // This blocks until the load is finished.
    151     ResourceLoaderAndroid::start(&h, request, frame->loader()->client(), false, true);
     151    ResourceLoaderAndroid::start(h.get(), request, frame->loader()->client(), false, true);
    152152}
    153153
  • trunk/WebCore/platform/network/curl/ResourceHandleCurl.cpp

    r61768 r62736  
    191191{
    192192    WebCoreSynchronousLoader syncLoader;
    193     ResourceHandle handle(request, &syncLoader, true, false);
     193    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
    194194
    195195    ResourceHandleManager* manager = ResourceHandleManager::sharedInstance();
    196196
    197     manager->dispatchSynchronousJob(&handle);
     197    manager->dispatchSynchronousJob(handle.get());
    198198
    199199    error = syncLoader.resourceError();
  • trunk/WebCore/platform/network/qt/ResourceHandleQt.cpp

    r61768 r62736  
    190190{
    191191    WebCoreSynchronousLoader syncLoader;
    192     ResourceHandle handle(request, &syncLoader, true, false);
    193 
    194     ResourceHandleInternal *d = handle.getInternal();
     192    RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
     193
     194    ResourceHandleInternal* d = handle->getInternal();
    195195    if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
    196196        // If credentials were specified for this request, add them to the url,
     
    202202    }
    203203    d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
    204     d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal);
     204    d->m_job = new QNetworkReplyHandler(handle.get(), QNetworkReplyHandler::LoadNormal);
    205205
    206206    syncLoader.waitForCompletion();
  • trunk/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r61768 r62736  
    659659{
    660660    WebCoreSynchronousLoader syncLoader(error, response, data);
    661     ResourceHandle handle(request, &syncLoader, true, false);
    662 
    663     handle.start(frame);
     661    RefPtr<ResourceHandle> handle = create(request, &syncLoader, frame, true, false);
    664662    syncLoader.run();
    665663}
     
    930928
    931929}
    932 
Note: See TracChangeset for help on using the changeset viewer.