Changeset 223238 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Oct 12, 2017, 8:38:42 AM (8 years ago)
Author:
[email protected]
Message:

Remove out-parameter variants of copyToVector
https://bugs.webkit.org/show_bug.cgi?id=178155

Reviewed by Tim Horton.

Source/JavaScriptCore:

  • inspector/ScriptDebugServer.cpp:

(Inspector::ScriptDebugServer::dispatchBreakpointActionLog):
(Inspector::ScriptDebugServer::dispatchBreakpointActionSound):
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe):
(Inspector::ScriptDebugServer::dispatchDidParseSource):
(Inspector::ScriptDebugServer::dispatchFailedToParseSource):
(Inspector::ScriptDebugServer::dispatchFunctionToListeners):

Replace out-parameter based copyToVector, with one that returns a Vector.

Source/WebCore:

  • Modules/geolocation/Geolocation.cpp:

(WebCore::Geolocation::stopTimersForOneShots):
(WebCore::Geolocation::cancelAllRequests):
(WebCore::Geolocation::handleError):
(WebCore::Geolocation::makeSuccessCallbacks):

  • Modules/indexeddb/IDBDatabase.cpp:

(WebCore::IDBDatabase::transaction):

  • Modules/indexeddb/IDBGetAllResult.cpp:

(WebCore::IDBGetAllResult::allBlobFilePaths const):

  • Modules/indexeddb/server/MemoryIndex.cpp:

(WebCore::IDBServer::MemoryIndex::notifyCursorsOfValueChange):
(WebCore::IDBServer::MemoryIndex::notifyCursorsOfAllRecordsChanged):

  • css/CSSFontSelector.cpp:

(WebCore::CSSFontSelector::dispatchInvalidationCallbacks):

  • dom/Document.cpp:

(WebCore::Document::moveNodeIteratorsToNewDocument):
(WebCore::Document::resume):
(WebCore::Document::didAssociateFormControlsTimerFired):

  • dom/IdTargetObserverRegistry.cpp:

(WebCore::IdTargetObserverRegistry::notifyObserversInternal):

  • dom/MutationObserver.cpp:

(WebCore::MutationObserver::notifyMutationObservers):

  • dom/Node.cpp:

(WebCore::Document::invalidateNodeListAndCollectionCaches):

  • dom/RadioButtonGroups.cpp:
  • dom/ScriptExecutionContext.cpp:

(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):

  • loader/appcache/ApplicationCacheGroup.cpp:

(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
(WebCore::ApplicationCacheGroup::deliverDelayedMainResources):

  • loader/cache/MemoryCache.cpp:

(WebCore::MemoryCache::forEachResource):
(WebCore::MemoryCache::pruneDeadResourcesToSize):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::willDestroyCachedFrame):
(WebCore::DOMWindow::willDestroyDocumentInFrame):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::disconnectDOMWindowProperties):
(WebCore::DOMWindow::reconnectDOMWindowProperties):

  • page/FrameView.cpp:

(WebCore::collectAndProtectWidgets):

  • page/MemoryRelease.cpp:

(WebCore::releaseCriticalMemory):

  • page/Performance.cpp:

(WebCore::Performance::queueEntry):

  • platform/cocoa/PasteboardCocoa.mm:

(WebCore::Pasteboard::typesForLegacyUnsafeBindings):

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::FontCache::systemFontFamilies):

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

  • platform/ios/WebCoreMotionManager.mm:

(-[WebCoreMotionManager sendAccelerometerData:]):
(-[WebCoreMotionManager sendMotionData:withHeading:]):

  • platform/mac/PlatformPasteboardMac.mm:

(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

  • platform/network/cocoa/WebCoreNSURLSession.mm:

(-[WebCoreNSURLSession invalidateAndCancel]):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::endAndCommitUpdateScrollInfoAfterLayoutTransaction):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::setLogicalWidthForTextRun):

  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::FlexBoxIterator::next):

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::paintObject):

Replace out-parameter based copyToVector, with one that returns a Vector.

Source/WebKit:

  • Shared/API/Cocoa/_WKRemoteObjectInterface.mm:

(-[_WKRemoteObjectInterface debugDescription]):

  • Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:

(WebKit::dump):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::resetState):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::createNewWebProcess):

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::parameters):

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::pendingCookies const):

  • UIProcess/ios/ProcessAssertionIOS.mm:

(-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):

  • WebProcess/Cookies/WebCookieManager.cpp:

(WebKit::WebCookieManager::getHostnamesWithCookies):

  • WebProcess/Geolocation/WebGeolocationManager.cpp:

(WebKit::WebGeolocationManager::didChangePosition):
(WebKit::WebGeolocationManager::didFailToDeterminePosition):

  • WebProcess/Network/WebLoaderStrategy.cpp:

(WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):

Replace out-parameter based copyToVector, with one that returns a Vector.

Source/WebKitLegacy/ios:

  • Misc/WebGeolocationProviderIOS.mm:

(-[WebGeolocationProviderIOS _handlePendingInitialPosition:]):
(-[WebGeolocationProviderIOS positionChanged:]):
(-[WebGeolocationProviderIOS errorOccurred:]):
(-[WebGeolocationProviderIOS resetGeolocation]):

Replace out-parameter based copyToVector, with one that returns a Vector.

Source/WebKitLegacy/mac:

  • Plugins/WebNetscapePluginView.mm:

(-[WebNetscapePluginView destroyPlugin]):

  • WebView/WebHTMLRepresentation.mm:

(newArrayWithStrings):

Replace out-parameter based copyToVector, with one that returns a Vector.

Source/WTF:

  • wtf/HashMap.h:

(WTF::copyToVector): Deleted.

  • wtf/HashSet.h:

(WTF::copyToVector): Deleted.

Remove copyToVector.


  • wtf/Vector.h:

(WTF::copyToVectorSpecialization):

Add another version of copyToVector, called copyToVectorSpecialization, that allows
you to specify the entire specialization for the Vector you want to copy to. This
can be useful if you want your resulting Vector to have an inline capacity.

Tools:

  • DumpRenderTree/JavaScriptThreading.cpp:

(stopJavaScriptThreads):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r223237 r223238  
     12017-10-11  Sam Weinig  <[email protected]>
     2
     3        Remove out-parameter variants of copyToVector
     4        https://bugs.webkit.org/show_bug.cgi?id=178155
     5
     6        Reviewed by Tim Horton.
     7
     8        * inspector/ScriptDebugServer.cpp:
     9        (Inspector::ScriptDebugServer::dispatchBreakpointActionLog):
     10        (Inspector::ScriptDebugServer::dispatchBreakpointActionSound):
     11        (Inspector::ScriptDebugServer::dispatchBreakpointActionProbe):
     12        (Inspector::ScriptDebugServer::dispatchDidParseSource):
     13        (Inspector::ScriptDebugServer::dispatchFailedToParseSource):
     14        (Inspector::ScriptDebugServer::dispatchFunctionToListeners):
     15           
     16            Replace out-parameter based copyToVector, with one that returns a Vector.
     17
    1182017-10-12  Yusuke Suzuki  <[email protected]>
    219
  • trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp

    r212448 r223238  
    146146    SetForScope<bool> change(m_callingListeners, true);
    147147
    148     Vector<ScriptDebugListener*> listenersCopy;
    149     copyToVector(m_listeners, listenersCopy);
    150     for (auto* listener : listenersCopy)
     148    for (auto* listener : copyToVector(m_listeners))
    151149        listener->breakpointActionLog(*exec, message);
    152150}
     
    162160    SetForScope<bool> change(m_callingListeners, true);
    163161
    164     Vector<ScriptDebugListener*> listenersCopy;
    165     copyToVector(m_listeners, listenersCopy);
    166     for (auto* listener : listenersCopy)
     162    for (auto* listener : copyToVector(m_listeners))
    167163        listener->breakpointActionSound(breakpointActionIdentifier);
    168164}
     
    180176    unsigned sampleId = m_nextProbeSampleId++;
    181177
    182     Vector<ScriptDebugListener*> listenersCopy;
    183     copyToVector(m_listeners, listenersCopy);
    184     for (auto* listener : listenersCopy)
     178    for (auto* listener : copyToVector(m_listeners))
    185179        listener->breakpointActionProbe(*exec, action, m_currentProbeBatchId, sampleId, sampleValue);
    186180}
     
    222216        script.endColumn = sourceLength - lastLineStart;
    223217
    224     Vector<ScriptDebugListener*> copy;
    225     copyToVector(listeners, copy);
    226     for (size_t i = 0; i < copy.size(); ++i)
    227         copy[i]->didParseSource(sourceID, script);
     218    for (auto* listener : copyToVector(listeners))
     219        listener->didParseSource(sourceID, script);
    228220}
    229221
     
    234226    int firstLine = sourceProvider->startPosition().m_line.oneBasedInt();
    235227
    236     Vector<ScriptDebugListener*> copy;
    237     copyToVector(listeners, copy);
    238     for (size_t i = 0; i < copy.size(); ++i)
    239         copy[i]->failedToParseSource(url, data, firstLine, errorLine, errorMessage);
     228    for (auto* listener : copyToVector(listeners))
     229        listener->failedToParseSource(url, data, firstLine, errorLine, errorMessage);
    240230}
    241231
     
    272262void ScriptDebugServer::dispatchFunctionToListeners(const ListenerSet& listeners, JavaScriptExecutionCallback callback)
    273263{
    274     Vector<ScriptDebugListener*> copy;
    275     copyToVector(listeners, copy);
    276     for (size_t i = 0; i < copy.size(); ++i)
    277         (this->*callback)(copy[i]);
     264    for (auto* listener : copyToVector(listeners))
     265        (this->*callback)(listener);
    278266}
    279267
Note: See TracChangeset for help on using the changeset viewer.