Ignore:
Timestamp:
Jun 18, 2014, 12:40:25 PM (11 years ago)
Author:
[email protected]
Message:

Adopt modern C++11 loops and fix WebArchive creation functions
https://bugs.webkit.org/show_bug.cgi?id=134032

Reviewed by Andreas Kling.

Source/WebCore:
Use modern loops in a couple of places, fix DocumentLoader::subresources() to return a Vector,
and stop using Vectors of PassRefPtrs.

  • WebCore.exp.in:
  • dom/Document.cpp:

(WebCore::Document::textInserted):
(WebCore::Document::textRemoved):
(WebCore::Document::textNodesMerged):

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::subresources):
(WebCore::DocumentLoader::getSubresources): Deleted.

  • loader/DocumentLoader.h:
  • loader/appcache/ApplicationCache.cpp:

(WebCore::ApplicationCache::dump):

  • loader/appcache/ApplicationCache.h:

(WebCore::ApplicationCache::resources):
(WebCore::ApplicationCache::begin): Deleted.
(WebCore::ApplicationCache::end): Deleted.

  • loader/appcache/ApplicationCacheGroup.cpp:

(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):

  • loader/appcache/ApplicationCacheHost.cpp:

(WebCore::ApplicationCacheHost::fillResourceList):

  • loader/appcache/ApplicationCacheStorage.cpp:

(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::empty):
(WebCore::ApplicationCacheStorage::storeCopyOfCache):

  • loader/archive/cf/LegacyWebArchive.cpp:

(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):

  • loader/archive/cf/LegacyWebArchive.h:
  • xml/XMLHttpRequestProgressEventThrottle.cpp:

(WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):

Source/WebKit/mac:

  • WebView/WebArchive.mm:

(-[WebArchive initWithMainResource:subresources:subframeArchives:]):

  • WebView/WebDataSource.mm:

(-[WebDataSource subresources]):

Source/WebKit2:

  • Shared/APIWebArchive.cpp:

(API::WebArchive::WebArchive):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp

    r161896 r170113  
    141141
    142142    // Take over the deferred events before dispatching them which can potentially add more.
    143     Vector<RefPtr<Event>> deferredEvents;
    144     m_deferredEvents.swap(deferredEvents);
     143    auto deferredEvents = std::move(m_deferredEvents);
    145144
    146145    RefPtr<Event> deferredProgressEvent = m_deferredProgressEvent;
    147     m_deferredProgressEvent = 0;
    148 
    149     Vector<RefPtr<Event>>::const_iterator it = deferredEvents.begin();
    150     const Vector<RefPtr<Event>>::const_iterator end = deferredEvents.end();
    151     for (; it != end; ++it)
    152         dispatchEvent(*it);
     146    m_deferredProgressEvent = nullptr;
     147
     148    for (auto& deferredEvent : deferredEvents)
     149        dispatchEvent(deferredEvent.release());
    153150
    154151    // The progress event will be in the m_deferredEvents vector if the load was finished while suspended.
Note: See TracChangeset for help on using the changeset viewer.