Diff
Modified: trunk/Source/WTF/ChangeLog (201332 => 201333)
--- trunk/Source/WTF/ChangeLog 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WTF/ChangeLog 2016-05-24 16:50:26 UTC (rev 201333)
@@ -1,3 +1,15 @@
+2016-05-24 Chris Dumez <[email protected]>
+
+ Use auto for some of our lambda function parameters
+ https://bugs.webkit.org/show_bug.cgi?id=158001
+
+ Reviewed by Darin Adler.
+
+ Use auto for some of our lambda function parameters now that we build with c++14.
+
+ * wtf/BubbleSort.h:
+ (WTF::bubbleSort):
+
2016-05-23 Chris Dumez <[email protected]>
Speed up move of vectors of POD types that have an inline buffer
Modified: trunk/Source/WTF/wtf/BubbleSort.h (201332 => 201333)
--- trunk/Source/WTF/wtf/BubbleSort.h 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WTF/wtf/BubbleSort.h 2016-05-24 16:50:26 UTC (rev 201333)
@@ -89,8 +89,7 @@
{
bubbleSort(
begin, end,
- [] (const typename std::iterator_traits<IteratorType>::value_type& left,
- const typename std::iterator_traits<IteratorType>::value_type& right) -> bool {
+ [](auto& left, auto& right) {
return left < right;
});
}
Modified: trunk/Source/WebCore/ChangeLog (201332 => 201333)
--- trunk/Source/WebCore/ChangeLog 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/ChangeLog 2016-05-24 16:50:26 UTC (rev 201333)
@@ -1,3 +1,65 @@
+2016-05-24 Chris Dumez <[email protected]>
+
+ Use auto for some of our lambda function parameters
+ https://bugs.webkit.org/show_bug.cgi?id=158001
+
+ Reviewed by Darin Adler.
+
+ Use auto for some of our lambda function parameters now that we build with c++14.
+
+ * Modules/mediasource/MediaSource.cpp:
+ (WebCore::MediaSource::buffered):
+ (WebCore::MediaSource::monitorSourceBuffers):
+ (WebCore::MediaSource::endOfStream):
+ * Modules/mediasource/SampleMap.cpp:
+ (WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRangeFromEnd):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::ariaSelectedRows):
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
+ * css/CSSValueList.cpp:
+ (WebCore::CSSValueList::removeAll):
+ * css/MediaList.cpp:
+ (WebCore::MediaQuerySet::remove):
+ * css/MediaQuery.cpp:
+ (WebCore::MediaQuery::MediaQuery):
+ * css/MediaQueryMatcher.cpp:
+ (WebCore::MediaQueryMatcher::removeListener):
+ * dom/Document.cpp:
+ (WebCore::Document::validateAutoSizingNodes):
+ * dom/Element.cpp:
+ (WebCore::Element::detachAttrNodeFromElementWithValue):
+ * dom/MutationObserver.cpp:
+ (WebCore::MutationObserver::deliverAllMutations):
+ * dom/Node.cpp:
+ (WebCore::Node::unregisterMutationObserver):
+ * html/LinkIconCollector.cpp:
+ * inspector/InspectorIndexedDBAgent.cpp:
+ (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::loadDataURL):
+ * page/CaptionUserPreferences.cpp:
+ (WebCore::CaptionUserPreferences::sortedTrackListForMenu):
+ * page/CaptionUserPreferencesMediaAF.cpp:
+ (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu):
+ * page/animation/AnimationController.cpp:
+ (WebCore::AnimationControllerPrivate::clear):
+ * platform/graphics/FontCascade.cpp:
+ (WebCore::pruneUnreferencedEntriesFromFontCascadeCache):
+ * platform/graphics/FontCascadeFonts.cpp:
+ (WebCore::FontCascadeFonts::pruneSystemFallbacks):
+ * platform/graphics/PathUtilities.cpp:
+ (WebCore::addIntersectionPoints):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
+ * platform/graphics/texmap/TextureMapperGL.cpp:
+ (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
+ * platform/mac/HIDGamepad.cpp:
+ (WebCore::HIDGamepad::initElements):
+ * svg/SVGToOTFFontConversion.cpp:
+ (WebCore::SVGToOTFFontConverter::appendLigatureSubtable):
+ (WebCore::SVGToOTFFontConverter::finishAppendingKERNSubtable):
+
2016-05-24 Antti Koivisto <[email protected]>
REGRESSION (r196629): Safari can get into a state where switching Reader theme doesn't apply to the webpage
Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (201332 => 201333)
--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -141,7 +141,7 @@
std::unique_ptr<PlatformTimeRanges> MediaSource::buffered() const
{
- if (m_buffered && m_activeSourceBuffers->length() && std::all_of(m_activeSourceBuffers->begin(), m_activeSourceBuffers->end(), [] (RefPtr<SourceBuffer>& buffer) { return !buffer->isBufferedDirty(); }))
+ if (m_buffered && m_activeSourceBuffers->length() && std::all_of(m_activeSourceBuffers->begin(), m_activeSourceBuffers->end(), [](auto& buffer) { return !buffer->isBufferedDirty(); }))
return std::make_unique<PlatformTimeRanges>(*m_buffered);
m_buffered = std::make_unique<PlatformTimeRanges>();
@@ -264,7 +264,7 @@
// playback position:
auto begin = m_activeSourceBuffers->begin();
auto end = m_activeSourceBuffers->end();
- if (std::all_of(begin, end, [](RefPtr<SourceBuffer>& sourceBuffer) {
+ if (std::all_of(begin, end, [](auto& sourceBuffer) {
return !sourceBuffer->hasCurrentTime();
})) {
// 1. Set the HTMLMediaElement.readyState attribute to HAVE_METADATA.
@@ -278,7 +278,7 @@
// ↳ If buffered for all objects in activeSourceBuffers contain TimeRanges that include the current
// playback position and enough data to ensure uninterrupted playback:
- if (std::all_of(begin, end, [](RefPtr<SourceBuffer>& sourceBuffer) {
+ if (std::all_of(begin, end, [](auto& sourceBuffer) {
return sourceBuffer->hasFutureTime() && sourceBuffer->canPlayThrough();
})) {
// 1. Set the HTMLMediaElement.readyState attribute to HAVE_ENOUGH_DATA.
@@ -295,7 +295,7 @@
// ↳ If buffered for all objects in activeSourceBuffers contain a TimeRange that includes
// the current playback position and some time beyond the current playback position, then run the following steps:
- if (std::all_of(begin, end, [](RefPtr<SourceBuffer>& sourceBuffer) {
+ if (std::all_of(begin, end, [](auto& sourceBuffer) {
return sourceBuffer->hasFutureTime();
})) {
// 1. Set the HTMLMediaElement.readyState attribute to HAVE_FUTURE_DATA.
@@ -426,7 +426,7 @@
// 2. If the updating attribute equals true on any SourceBuffer in sourceBuffers, then throw an
// INVALID_STATE_ERR exception and abort these steps.
- if (std::any_of(m_sourceBuffers->begin(), m_sourceBuffers->end(), [](RefPtr<SourceBuffer>& sourceBuffer) { return sourceBuffer->updating(); })) {
+ if (std::any_of(m_sourceBuffers->begin(), m_sourceBuffers->end(), [](auto& sourceBuffer) { return sourceBuffer->updating(); })) {
ec = INVALID_STATE_ERR;
return;
}
Modified: trunk/Source/WebCore/Modules/mediasource/SampleMap.cpp (201332 => 201333)
--- trunk/Source/WebCore/Modules/mediasource/SampleMap.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/Modules/mediasource/SampleMap.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -244,11 +244,11 @@
PresentationOrderSampleMap::iterator_range PresentationOrderSampleMap::findSamplesWithinPresentationRangeFromEnd(const MediaTime& beginTime, const MediaTime& endTime)
{
- reverse_iterator rangeEnd = std::find_if(rbegin(), rend(), [&beginTime] (PresentationOrderSampleMap::MapType::value_type value) {
+ reverse_iterator rangeEnd = std::find_if(rbegin(), rend(), [&beginTime](auto& value) {
return value.second->presentationTime() <= beginTime;
});
- reverse_iterator rangeStart = std::find_if(rbegin(), rangeEnd, [&endTime] (PresentationOrderSampleMap::MapType::value_type value) {
+ reverse_iterator rangeStart = std::find_if(rbegin(), rangeEnd, [&endTime](auto& value) {
return value.second->presentationTime() <= endTime;
});
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (201332 => 201333)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -3245,7 +3245,7 @@
}
// Get all the rows.
- auto rowsIteration = [&](const AccessibilityChildrenVector& rows) {
+ auto rowsIteration = [&](auto& rows) {
for (auto& row : rows) {
if (row->isSelected()) {
result.append(row);
Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (201332 => 201333)
--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -2802,7 +2802,7 @@
ASSERT(hasBlobURLs());
RefPtr<SerializedScriptValue> protectedThis(this);
- blobRegistry().writeBlobsToTemporaryFiles(m_blobURLs, [completionHandler = WTFMove(completionHandler), this, protectedThis = WTFMove(protectedThis)](const Vector<String>& blobFilePaths) {
+ blobRegistry().writeBlobsToTemporaryFiles(m_blobURLs, [completionHandler = WTFMove(completionHandler), this, protectedThis = WTFMove(protectedThis)](auto& blobFilePaths) {
ASSERT(isMainThread());
if (blobFilePaths.isEmpty()) {
Modified: trunk/Source/WebCore/css/CSSValueList.cpp (201332 => 201333)
--- trunk/Source/WebCore/css/CSSValueList.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/css/CSSValueList.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -60,7 +60,7 @@
if (!value)
return false;
- return m_values.removeAllMatching([value] (const Ref<CSSValue>& current) {
+ return m_values.removeAllMatching([value](auto& current) {
return current->equals(*value);
}) > 0;
}
Modified: trunk/Source/WebCore/css/MediaList.cpp (201332 => 201333)
--- trunk/Source/WebCore/css/MediaList.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/css/MediaList.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -186,7 +186,7 @@
if (!parsedQuery)
return false;
- return m_queries.removeFirstMatching([&parsedQuery] (const std::unique_ptr<MediaQuery>& query) {
+ return m_queries.removeFirstMatching([&parsedQuery](auto& query) {
return *query == *parsedQuery;
});
}
Modified: trunk/Source/WebCore/css/MediaQuery.cpp (201332 => 201333)
--- trunk/Source/WebCore/css/MediaQuery.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/css/MediaQuery.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -83,7 +83,7 @@
return;
}
- std::sort(m_expressions->begin(), m_expressions->end(), [](const std::unique_ptr<MediaQueryExp>& a, const std::unique_ptr<MediaQueryExp>& b) {
+ std::sort(m_expressions->begin(), m_expressions->end(), [](auto& a, auto& b) {
return codePointCompare(a->serialize(), b->serialize()) < 0;
});
Modified: trunk/Source/WebCore/css/MediaQueryMatcher.cpp (201332 => 201333)
--- trunk/Source/WebCore/css/MediaQueryMatcher.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/css/MediaQueryMatcher.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -131,7 +131,7 @@
if (!m_document)
return;
- m_listeners.removeFirstMatching([listener, query] (const std::unique_ptr<Listener>& current) {
+ m_listeners.removeFirstMatching([listener, query](auto& current) {
return *current->listener() == *listener && current->query() == query;
});
}
Modified: trunk/Source/WebCore/dom/Document.cpp (201332 => 201333)
--- trunk/Source/WebCore/dom/Document.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -5299,7 +5299,7 @@
// candidate size.
value->adjustNodeSizes();
}
- m_textAutoSizedNodes.removeIf([] (TextAutoSizingMap::KeyValuePairType& keyAndValue) {
+ m_textAutoSizedNodes.removeIf([](auto& keyAndValue) {
return !keyAndValue.value->numNodes();
});
}
Modified: trunk/Source/WebCore/dom/Element.cpp (201332 => 201333)
--- trunk/Source/WebCore/dom/Element.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/dom/Element.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -3194,7 +3194,7 @@
attrNode->detachFromElementWithValue(value);
auto& attrNodeList = *attrNodeListForElement(*this);
- bool found = attrNodeList.removeFirstMatching([attrNode] (const RefPtr<Attr>& attribute) {
+ bool found = attrNodeList.removeFirstMatching([attrNode](auto& attribute) {
return attribute->qualifiedName() == attrNode->qualifiedName();
});
ASSERT_UNUSED(found, found);
Modified: trunk/Source/WebCore/dom/MutationObserver.cpp (201332 => 201333)
--- trunk/Source/WebCore/dom/MutationObserver.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/dom/MutationObserver.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -244,7 +244,7 @@
Vector<RefPtr<MutationObserver>> observers;
copyToVector(activeMutationObservers(), observers);
activeMutationObservers().clear();
- std::sort(observers.begin(), observers.end(), [](const RefPtr<MutationObserver>& lhs, const RefPtr<MutationObserver>& rhs) {
+ std::sort(observers.begin(), observers.end(), [](auto& lhs, auto& rhs) {
return lhs->m_priority < rhs->m_priority;
});
Modified: trunk/Source/WebCore/dom/Node.cpp (201332 => 201333)
--- trunk/Source/WebCore/dom/Node.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/dom/Node.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -2086,7 +2086,7 @@
if (!registry)
return;
- registry->removeFirstMatching([registration] (const std::unique_ptr<MutationObserverRegistration>& current) {
+ registry->removeFirstMatching([registration](auto& current) {
return current.get() == registration;
});
}
Modified: trunk/Source/WebCore/html/LinkIconCollector.cpp (201332 => 201333)
--- trunk/Source/WebCore/html/LinkIconCollector.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/html/LinkIconCollector.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -107,7 +107,7 @@
icons.append({ url, iconType, iconSize });
}
- std::sort(icons.begin(), icons.end(), [](const LinkIconCollector::Icon& a, const LinkIconCollector::Icon& b) {
+ std::sort(icons.begin(), icons.end(), [](auto& a, auto& b) {
return compareIcons(a, b) < 0;
});
Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (201332 => 201333)
--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -600,7 +600,7 @@
return;
RefPtr<RequestDatabaseNamesCallback> callback = WTFMove(requestCallback);
- idbFactory->getAllDatabaseNames(*topOrigin, *openingOrigin, [callback](const Vector<String>& databaseNames) {
+ idbFactory->getAllDatabaseNames(*topOrigin, *openingOrigin, [callback](auto& databaseNames) {
if (!callback->isActive())
return;
Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (201332 => 201333)
--- trunk/Source/WebCore/loader/ResourceLoader.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -253,7 +253,7 @@
if (auto* scheduledPairs = m_frame->page()->scheduledRunLoopPairs())
scheduleContext.scheduledPairs = *scheduledPairs;
#endif
- DataURLDecoder::decode(url, scheduleContext, [protectedThis, url] (Optional<DataURLDecoder::Result> decodeResult) {
+ DataURLDecoder::decode(url, scheduleContext, [protectedThis, url](auto decodeResult) {
if (protectedThis->reachedTerminalState())
return;
if (!decodeResult) {
Modified: trunk/Source/WebCore/page/CaptionUserPreferences.cpp (201332 => 201333)
--- trunk/Source/WebCore/page/CaptionUserPreferences.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/page/CaptionUserPreferences.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -221,7 +221,7 @@
tracksForMenu.append(track);
}
- std::sort(tracksForMenu.begin(), tracksForMenu.end(), [](const RefPtr<TextTrack>& a, const RefPtr<TextTrack>& b) {
+ std::sort(tracksForMenu.begin(), tracksForMenu.end(), [](auto& a, auto& b) {
return codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())) < 0;
});
@@ -256,7 +256,7 @@
tracksForMenu.append(track);
}
- std::sort(tracksForMenu.begin(), tracksForMenu.end(), [](const RefPtr<AudioTrack>& a, const RefPtr<AudioTrack>& b) {
+ std::sort(tracksForMenu.begin(), tracksForMenu.end(), [](auto& a, auto& b) {
return codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())) < 0;
});
Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (201332 => 201333)
--- trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -838,7 +838,7 @@
tracksForMenu.append(track);
}
- std::sort(tracksForMenu.begin(), tracksForMenu.end(), [](const RefPtr<AudioTrack>& a, const RefPtr<AudioTrack>& b) {
+ std::sort(tracksForMenu.begin(), tracksForMenu.end(), [](auto& a, auto& b) {
return codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())) < 0;
});
Modified: trunk/Source/WebCore/page/animation/AnimationController.cpp (201332 => 201333)
--- trunk/Source/WebCore/page/animation/AnimationController.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/page/animation/AnimationController.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -107,8 +107,8 @@
return info.element == element;
});
- m_elementChangesToDispatch.removeAllMatching([element] (const Ref<Element>& currElement) {
- return &currElement.get() == element;
+ m_elementChangesToDispatch.removeAllMatching([element](auto& currentElement) {
+ return currentElement.ptr() == element;
});
// Return false if we didn't do anything OR we are suspended (so we don't try to
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (201332 => 201333)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -250,7 +250,7 @@
void pruneUnreferencedEntriesFromFontCascadeCache()
{
- fontCascadeCache().removeIf([](FontCascadeCache::KeyValuePairType& entry) {
+ fontCascadeCache().removeIf([](auto& entry) {
return entry.value->fonts.get().hasOneRef();
});
}
Modified: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (201332 => 201333)
--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -454,7 +454,7 @@
// Mutable glyph pages may reference fallback fonts.
if (m_cachedPageZero.isMixedFont())
m_cachedPageZero = { };
- m_cachedPages.removeIf([](decltype(m_cachedPages)::KeyValuePairType& keyAndValue) {
+ m_cachedPages.removeIf([](auto& keyAndValue) {
return keyAndValue.value.isMixedFont();
});
m_systemFallbackFontSet.clear();
Modified: trunk/Source/WebCore/platform/graphics/PathUtilities.cpp (201332 => 201333)
--- trunk/Source/WebCore/platform/graphics/PathUtilities.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/platform/graphics/PathUtilities.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -134,7 +134,7 @@
intersectionPoints.append(graph.findOrCreateNode(intersectionPoint));
}
- std::sort(intersectionPoints.begin(), intersectionPoints.end(), [edgeA] (FloatPointGraph::Node* a, FloatPointGraph::Node* b) {
+ std::sort(intersectionPoints.begin(), intersectionPoints.end(), [edgeA](auto* a, auto* b) {
return FloatPoint(*edgeA.first - *b).lengthSquared() > FloatPoint(*edgeA.first - *a).lengthSquared();
});
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (201332 => 201333)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm 2016-05-24 16:50:26 UTC (rev 201333)
@@ -531,14 +531,14 @@
MediaStreamTrackPrivateVector currentTracks = m_mediaStreamPrivate->tracks();
bool selectedVideoTrackChanged = false;
- std::function<void(RefPtr<AudioTrackPrivateMediaStream>, int)> enableAudioTrack = [this](RefPtr<AudioTrackPrivateMediaStream> track, int index)
+ std::function<void(RefPtr<AudioTrackPrivateMediaStream>, int)> enableAudioTrack = [this](auto track, int index)
{
track->setTrackIndex(index);
track->setEnabled(track->streamTrack()->enabled() && !track->streamTrack()->muted());
};
updateTracksOfType(m_audioTrackMap, RealtimeMediaSource::Audio, currentTracks, &AudioTrackPrivateMediaStream::create, m_player, &MediaPlayer::removeAudioTrack, &MediaPlayer::addAudioTrack, enableAudioTrack);
- std::function<void(RefPtr<VideoTrackPrivateMediaStream>, int)> enableVideoTrack = [this, &selectedVideoTrackChanged](RefPtr<VideoTrackPrivateMediaStream> track, int index)
+ std::function<void(RefPtr<VideoTrackPrivateMediaStream>, int)> enableVideoTrack = [this, &selectedVideoTrackChanged](auto track, int index)
{
bool wasSelected = track->selected();
track->setTrackIndex(index);
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (201332 => 201333)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -88,8 +88,8 @@
~SharedGLData()
{
ASSERT(std::any_of(contextDataMap().begin(), contextDataMap().end(),
- [this](GLContextDataMap::KeyValuePairType& entry) { return entry.value == this; }));
- contextDataMap().removeIf([this] (GLContextDataMap::KeyValuePairType& entry) { return entry.value == this; });
+ [this](auto& entry) { return entry.value == this; }));
+ contextDataMap().removeIf([this](auto& entry) { return entry.value == this; });
}
private:
Modified: trunk/Source/WebCore/platform/mac/HIDGamepad.cpp (201332 => 201333)
--- trunk/Source/WebCore/platform/mac/HIDGamepad.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/platform/mac/HIDGamepad.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -74,7 +74,7 @@
initElementsFromArray(elements.get());
// Buttons are specified to appear highest priority first in the array.
- std::sort(m_buttons.begin(), m_buttons.end(), [](const std::unique_ptr<HIDGamepadButton>& a, const std::unique_ptr<HIDGamepadButton>& b) {
+ std::sort(m_buttons.begin(), m_buttons.end(), [](auto& a, auto& b) {
return a->priority < b->priority;
});
Modified: trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp (201332 => 201333)
--- trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -754,7 +754,7 @@
}
if (ligaturePairs.size() > std::numeric_limits<uint16_t>::max())
ligaturePairs.clear();
- std::sort(ligaturePairs.begin(), ligaturePairs.end(), [](const LigaturePair& lhs, const LigaturePair& rhs) {
+ std::sort(ligaturePairs.begin(), ligaturePairs.end(), [](auto& lhs, auto& rhs) {
return lhs.first[0] < rhs.first[0];
});
Vector<size_t> overlappingFirstGlyphSegmentLengths;
@@ -1078,7 +1078,7 @@
size_t SVGToOTFFontConverter::finishAppendingKERNSubtable(Vector<KerningData> kerningData, uint16_t coverage)
{
- std::sort(kerningData.begin(), kerningData.end(), [](const KerningData& a, const KerningData& b) {
+ std::sort(kerningData.begin(), kerningData.end(), [](auto& a, auto& b) {
return a.glyph1 < b.glyph1 || (a.glyph1 == b.glyph1 && a.glyph2 < b.glyph2);
});
Modified: trunk/Source/WebKit2/ChangeLog (201332 => 201333)
--- trunk/Source/WebKit2/ChangeLog 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/ChangeLog 2016-05-24 16:50:26 UTC (rev 201333)
@@ -1,3 +1,54 @@
+2016-05-24 Chris Dumez <[email protected]>
+
+ Use auto for some of our lambda function parameters
+ https://bugs.webkit.org/show_bug.cgi?id=158001
+
+ Reviewed by Darin Adler.
+
+ Use auto for some of our lambda function parameters now that we build with c++14.
+
+ * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+ (WebKit::WebIDBConnectionToClient::didGetRecord):
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::fetchDiskCacheEntries):
+ (WebKit::NetworkProcess::fetchWebsiteData):
+ (WebKit::clearDiskCacheEntries):
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::retrieveCacheEntry):
+ (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
+ (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+ (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
+ (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
+ (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
+ * NetworkProcess/cache/NetworkCacheStorage.cpp:
+ (WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
+ (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
+ * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
+ (-[_WKRemoteObjectInterface debugDescription]):
+ * UIProcess/API/C/WKApplicationCacheManager.cpp:
+ (WKApplicationCacheManagerGetApplicationCacheOrigins):
+ * UIProcess/API/C/WKKeyValueStorageManager.cpp:
+ (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
+ (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
+ * UIProcess/API/C/WKResourceCacheManager.cpp:
+ (WKResourceCacheManagerGetCacheOrigins):
+ * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+ (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
+ * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
+ (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
+ (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
+ (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+ (WebKit::PlatformCALayerRemote::removeAnimationForKey):
+
2016-05-23 Yusuke Suzuki <[email protected]>
Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (201332 => 201333)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -317,7 +317,7 @@
for (auto& file : fileReferences)
file->prepareForFileAccess();
- NetworkBlobRegistry::singleton().writeBlobsToTemporaryFiles(blobURLs, [this, protector, requestIdentifier, fileReferences](const Vector<String>& fileNames) {
+ NetworkBlobRegistry::singleton().writeBlobsToTemporaryFiles(blobURLs, [this, protector, requestIdentifier, fileReferences](auto& fileNames) {
for (auto& file : fileReferences)
file->revokeFileAccess();
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (201332 => 201333)
--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -314,7 +314,7 @@
if (NetworkCache::singleton().isEnabled()) {
auto* originsAndSizes = new HashMap<RefPtr<SecurityOrigin>, uint64_t>();
- NetworkCache::singleton().traverse([fetchOptions, completionHandler, originsAndSizes](const NetworkCache::Cache::TraversalEntry *traversalEntry) {
+ NetworkCache::singleton().traverse([fetchOptions, completionHandler, originsAndSizes](auto* traversalEntry) {
if (!traversalEntry) {
Vector<WebsiteData::Entry> entries;
@@ -379,7 +379,7 @@
WebsiteData m_websiteData;
};
- RefPtr<CallbackAggregator> callbackAggregator = adoptRef(new CallbackAggregator([this, callbackID](WebsiteData websiteData) {
+ RefPtr<CallbackAggregator> callbackAggregator = adoptRef(new CallbackAggregator([this, callbackID] (WebsiteData websiteData) {
parentProcessConnection()->send(Messages::NetworkProcessProxy::DidFetchWebsiteData(callbackID, websiteData), 0);
}));
@@ -389,7 +389,7 @@
}
if (websiteDataTypes.contains(WebsiteDataType::DiskCache)) {
- fetchDiskCacheEntries(sessionID, fetchOptions, [callbackAggregator](Vector<WebsiteData::Entry> entries) {
+ fetchDiskCacheEntries(sessionID, fetchOptions, [callbackAggregator](auto entries) {
callbackAggregator->m_websiteData.entries.appendVector(entries);
});
}
@@ -432,8 +432,7 @@
auto* cacheKeysToDelete = new Vector<NetworkCache::Key>;
- NetworkCache::singleton().traverse([completionHandler, originsToDelete, cacheKeysToDelete](const NetworkCache::Cache::TraversalEntry *traversalEntry) {
-
+ NetworkCache::singleton().traverse([completionHandler, originsToDelete, cacheKeysToDelete](auto* traversalEntry) {
if (traversalEntry) {
if (originsToDelete->contains(SecurityOrigin::create(traversalEntry->entry.response().url())))
cacheKeysToDelete->append(traversalEntry->entry.key());
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (201332 => 201333)
--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -165,7 +165,7 @@
ASSERT(canUseCache(request));
RefPtr<NetworkResourceLoader> loader(this);
- NetworkCache::singleton().retrieve(request, { m_parameters.webPageID, m_parameters.webFrameID }, [loader, request](std::unique_ptr<NetworkCache::Entry> entry) {
+ NetworkCache::singleton().retrieve(request, { m_parameters.webPageID, m_parameters.webFrameID }, [loader, request](auto entry) {
if (loader->hasOneRef()) {
// The loader has been aborted and is only held alive by this lambda.
return;
@@ -516,7 +516,7 @@
// Keep the connection alive.
RefPtr<NetworkConnectionToWebProcess> connection(&connectionToWebProcess());
RefPtr<NetworkResourceLoader> loader(this);
- NetworkCache::singleton().store(m_networkLoad->currentRequest(), m_response, WTFMove(m_bufferedDataForCache), [loader, connection](NetworkCache::MappedBody& mappedBody) {
+ NetworkCache::singleton().store(m_networkLoad->currentRequest(), m_response, WTFMove(m_bufferedDataForCache), [loader, connection](auto& mappedBody) {
#if ENABLE(SHAREABLE_RESOURCE)
if (mappedBody.shareableResourceHandle.isNull())
return;
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp (201332 => 201333)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -105,7 +105,7 @@
void SpeculativeLoad::didFinishLoading(double finishTime)
{
if (!m_cacheEntryForValidation && m_bufferedDataForCache)
- m_cacheEntryForValidation = NetworkCache::singleton().store(m_originalRequest, m_response, WTFMove(m_bufferedDataForCache), [](NetworkCache::MappedBody& mappedBody) { });
+ m_cacheEntryForValidation = NetworkCache::singleton().store(m_originalRequest, m_response, WTFMove(m_bufferedDataForCache), [](auto& mappedBody) { });
didComplete();
}
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (201332 => 201333)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -409,7 +409,7 @@
void SpeculativeLoadManager::retrieveEntryFromStorage(const Key& key, const RetrieveCompletionHandler& completionHandler)
{
- m_storage.retrieve(key, static_cast<unsigned>(ResourceLoadPriority::Medium), [completionHandler](std::unique_ptr<Storage::Record> record) {
+ m_storage.retrieve(key, static_cast<unsigned>(ResourceLoadPriority::Medium), [completionHandler](auto record) {
if (!record) {
completionHandler(nullptr);
return false;
@@ -537,7 +537,7 @@
{
ASSERT(storageKey.type() == "resource");
auto subresourcesStorageKey = makeSubresourcesKey(storageKey);
- m_storage.retrieve(subresourcesStorageKey, static_cast<unsigned>(ResourceLoadPriority::Medium), [completionHandler](std::unique_ptr<Storage::Record> record) {
+ m_storage.retrieve(subresourcesStorageKey, static_cast<unsigned>(ResourceLoadPriority::Medium), [completionHandler](auto record) {
if (!record) {
completionHandler(nullptr);
return false;
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp (201332 => 201333)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -526,7 +526,7 @@
void Storage::removeFromPendingWriteOperations(const Key& key)
{
while (true) {
- auto found = m_pendingWriteOperations.findIf([&key](const std::unique_ptr<WriteOperation>& operation) {
+ auto found = m_pendingWriteOperations.findIf([&key](auto& operation) {
return operation->record.key == key;
});
Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm (201332 => 201333)
--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2016-05-24 16:50:26 UTC (rev 201333)
@@ -123,7 +123,7 @@
auto storedCredentials = _withCredentials ? WebCore::StoredCredentials::AllowStoredCredentials : WebCore::StoredCredentials::DoNotAllowStoredCredentials;
if (auto* networkDataTask = _session->dataTaskForIdentifier(task.taskIdentifier, storedCredentials)) {
auto completionHandlerCopy = Block_copy(completionHandler);
- networkDataTask->willPerformHTTPRedirection(response, request, [completionHandlerCopy, taskIdentifier](const WebCore::ResourceRequest& request) {
+ networkDataTask->willPerformHTTPRedirection(response, request, [completionHandlerCopy, taskIdentifier](auto& request) {
LOG(NetworkSession, "%llu willPerformHTTPRedirection completionHandler (%s)", taskIdentifier, request.url().string().utf8().data());
completionHandlerCopy(request.nsURLRequest(WebCore::UpdateHTTPBody));
Block_release(completionHandlerCopy);
@@ -142,7 +142,7 @@
auto storedCredentials = _withCredentials ? WebCore::StoredCredentials::AllowStoredCredentials : WebCore::StoredCredentials::DoNotAllowStoredCredentials;
if (auto* networkDataTask = _session->dataTaskForIdentifier(taskIdentifier, storedCredentials)) {
auto completionHandlerCopy = Block_copy(completionHandler);
- networkDataTask->willPerformHTTPRedirection(WebCore::synthesizeRedirectResponseIfNecessary([task currentRequest], request, nil), request, [completionHandlerCopy, taskIdentifier](const WebCore::ResourceRequest& request) {
+ networkDataTask->willPerformHTTPRedirection(WebCore::synthesizeRedirectResponseIfNecessary([task currentRequest], request, nil), request, [completionHandlerCopy, taskIdentifier](auto& request) {
LOG(NetworkSession, "%llu _schemeUpgraded completionHandler (%s)", taskIdentifier, request.url().string().utf8().data());
completionHandlerCopy(request.nsURLRequest(WebCore::UpdateHTTPBody));
Block_release(completionHandlerCopy);
Modified: trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm (201332 => 201333)
--- trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm 2016-05-24 16:50:26 UTC (rev 201333)
@@ -210,11 +210,11 @@
{
auto result = adoptNS([[NSMutableString alloc] initWithFormat:@"<%@: %p; protocol = \"%@\"; identifier = \"%@\"\n", NSStringFromClass(self.class), self, _identifier.get(), NSStringFromProtocol(_protocol)]);
- auto descriptionForClasses = [](const Vector<HashSet<Class>>& allowedClasses) {
+ auto descriptionForClasses = [](auto& allowedClasses) {
auto result = adoptNS([[NSMutableString alloc] initWithString:@"["]);
bool needsComma = false;
- auto descriptionForArgument = [](const HashSet<Class>& allowedArgumentClasses) {
+ auto descriptionForArgument = [](auto& allowedArgumentClasses) {
auto result = adoptNS([[NSMutableString alloc] initWithString:@"{"]);
Vector<Class> orderedArgumentClasses;
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp (201332 => 201333)
--- trunk/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -40,7 +40,7 @@
void WKApplicationCacheManagerGetApplicationCacheOrigins(WKApplicationCacheManagerRef applicationCacheManager, void* context, WKApplicationCacheManagerGetApplicationCacheOriginsFunction callback)
{
auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(applicationCacheManager))->websiteDataStore();
- websiteDataStore.fetchData(WebsiteDataType::OfflineWebApplicationCache, { }, [context, callback](Vector<WebsiteDataRecord> dataRecords) {
+ websiteDataStore.fetchData(WebsiteDataType::OfflineWebApplicationCache, { }, [context, callback](auto dataRecords) {
Vector<RefPtr<API::Object>> securityOrigins;
for (const auto& dataRecord : dataRecords) {
for (const auto& origin : dataRecord.origins)
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp (201332 => 201333)
--- trunk/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -69,7 +69,7 @@
return;
}
- storageManager->getLocalStorageOrigins([context, callback](HashSet<RefPtr<WebCore::SecurityOrigin>>&& securityOrigins) {
+ storageManager->getLocalStorageOrigins([context, callback](auto&& securityOrigins) {
Vector<RefPtr<API::Object>> webSecurityOrigins;
webSecurityOrigins.reserveInitialCapacity(securityOrigins.size());
for (auto& origin : securityOrigins)
@@ -89,7 +89,7 @@
return;
}
- storageManager->getLocalStorageOriginDetails([context, callback](Vector<LocalStorageDatabaseTracker::OriginDetails> storageDetails) {
+ storageManager->getLocalStorageOriginDetails([context, callback](auto storageDetails) {
HashMap<String, RefPtr<API::Object>> detailsMap;
Vector<RefPtr<API::Object>> result;
result.reserveInitialCapacity(storageDetails.size());
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp (201332 => 201333)
--- trunk/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -52,7 +52,7 @@
void WKResourceCacheManagerGetCacheOrigins(WKResourceCacheManagerRef cacheManager, void* context, WKResourceCacheManagerGetCacheOriginsFunction callback)
{
auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(cacheManager))->websiteDataStore();
- websiteDataStore.fetchData(toWebsiteDataTypes(WKResourceCachesToClearAll), { }, [context, callback](Vector<WebsiteDataRecord> dataRecords) {
+ websiteDataStore.fetchData(toWebsiteDataTypes(WKResourceCachesToClearAll), { }, [context, callback](auto dataRecords) {
Vector<RefPtr<API::Object>> securityOrigins;
for (const auto& dataRecord : dataRecords) {
for (const auto& origin : dataRecord.origins)
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (201332 => 201333)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm 2016-05-24 16:50:26 UTC (rev 201333)
@@ -153,7 +153,7 @@
if (options & _WKWebsiteDataStoreFetchOptionComputeSizes)
fetchOptions |= WebKit::WebsiteDataFetchOption::ComputeSizes;
- _websiteDataStore->websiteDataStore().fetchData(WebKit::toWebsiteDataTypes(dataTypes), fetchOptions, [completionHandlerCopy](Vector<WebKit::WebsiteDataRecord> websiteDataRecords) {
+ _websiteDataStore->websiteDataStore().fetchData(WebKit::toWebsiteDataTypes(dataTypes), fetchOptions, [completionHandlerCopy](auto websiteDataRecords) {
Vector<RefPtr<API::Object>> elements;
elements.reserveInitialCapacity(websiteDataRecords.size());
Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp (201332 => 201333)
--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -189,7 +189,7 @@
for (WebProcessProxy* process : m_processes)
process->connection()->send(Messages::WebUserContentController::RemoveAllUserScripts({ world.identifier() }), m_identifier);
- unsigned userScriptsRemoved = m_userScripts->removeAllOfTypeMatching<API::UserScript>([&] (const RefPtr<API::UserScript>& userScript) -> bool {
+ unsigned userScriptsRemoved = m_userScripts->removeAllOfTypeMatching<API::UserScript>([&](const auto& userScript) {
return &userScript->userContentWorld() == &world;
});
@@ -244,7 +244,7 @@
for (WebProcessProxy* process : m_processes)
process->connection()->send(Messages::WebUserContentController::RemoveAllUserStyleSheets({ world.identifier() }), m_identifier);
- unsigned userStyleSheetsRemoved = m_userStyleSheets->removeAllOfTypeMatching<API::UserStyleSheet>([&] (const RefPtr<API::UserStyleSheet>& userStyleSheet) -> bool {
+ unsigned userStyleSheetsRemoved = m_userStyleSheets->removeAllOfTypeMatching<API::UserStyleSheet>([&](const auto& userStyleSheet) {
return &userStyleSheet->userContentWorld() == &world;
});
@@ -310,7 +310,7 @@
process->connection()->send(Messages::WebUserContentController::RemoveAllUserScriptMessageHandlers({ world.identifier() }), m_identifier);
unsigned numberRemoved = 0;
- m_scriptMessageHandlers.removeIf([&](HashMap<uint64_t, RefPtr<WebScriptMessageHandler>>::KeyValuePairType& entry) {
+ m_scriptMessageHandlers.removeIf([&](auto& entry) {
if (&entry.value->userContentWorld() == &world) {
++numberRemoved;
return true;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (201332 => 201333)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -350,7 +350,7 @@
void PlatformCALayerRemote::removeAnimationForKey(const String& key)
{
if (m_animations.remove(key)) {
- m_properties.addedAnimations.removeFirstMatching([&key] (const std::pair<String, PlatformCAAnimationRemote::Properties>& pair) {
+ m_properties.addedAnimations.removeFirstMatching([&key](auto& pair) {
return pair.first == key;
});
}
Modified: trunk/Tools/ChangeLog (201332 => 201333)
--- trunk/Tools/ChangeLog 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Tools/ChangeLog 2016-05-24 16:50:26 UTC (rev 201333)
@@ -1,3 +1,15 @@
+2016-05-24 Chris Dumez <[email protected]>
+
+ Use auto for some of our lambda function parameters
+ https://bugs.webkit.org/show_bug.cgi?id=158001
+
+ Reviewed by Darin Adler.
+
+ Use auto for some of our lambda function parameters now that we build with c++14.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::willDestroyPage):
+
2016-05-23 Brady Eidson <[email protected]>
check-webkit-style gets flags std::literals::chrono_literals as bad naming.
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (201332 => 201333)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2016-05-24 16:50:26 UTC (rev 201333)
@@ -2433,6 +2433,7 @@
elif (search(r'\)\s*(((const|override)\s*)*\s*)?{\s*$', line)
and line.count('(') == line.count(')')
and not search(r'(\s*(if|for|while|switch|NS_ENUM|@synchronized)|} @catch)\b', line)
+ and line.find("](") < 0
and not match(r'\s+[A-Z_][A-Z_0-9]+\b', line)):
error(line_number, 'whitespace/braces', 4,
'Place brace on its own line for function definitions.')
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (201332 => 201333)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2016-05-24 16:50:26 UTC (rev 201333)
@@ -1769,6 +1769,10 @@
'}\n',
'')
self.assert_multi_line_lint(
+ '[]() {\n'
+ '}\n',
+ '')
+ self.assert_multi_line_lint(
'if (condition\n'
' && condition2\n'
' && condition3) {\n'
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (201332 => 201333)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp 2016-05-24 16:46:44 UTC (rev 201332)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp 2016-05-24 16:50:26 UTC (rev 201333)
@@ -109,7 +109,7 @@
void InjectedBundle::willDestroyPage(WKBundlePageRef page)
{
- m_pages.removeFirstMatching([page] (const std::unique_ptr<InjectedBundlePage>& current) {
+ m_pages.removeFirstMatching([page](auto& current) {
return current->page() == page;
});
}