WebKit Bugzilla
Attachment 372992 Details for
Bug 199247
: Adopt simple structured bindings in more places
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199247-20190626190228.patch (text/plain), 61.43 KB, created by
Sam Weinig
on 2019-06-26 19:02:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sam Weinig
Created:
2019-06-26 19:02:28 PDT
Size:
61.43 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 246856) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,23 @@ >+2019-06-26 Sam Weinig <weinig@apple.com> >+ >+ Adopt simple structured bindings in more places >+ https://bugs.webkit.org/show_bug.cgi?id=199247 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replaces simple uses of std::tie() with structured bindings. Does not touch >+ uses of std::tie() that are not initial declarations or use std::ignore, as >+ structured bindings don't work for those cases yet. >+ >+ * runtime/PromiseDeferredTimer.cpp: >+ (JSC::PromiseDeferredTimer::doWork): >+ * wasm/WasmFaultSignalHandler.cpp: >+ (JSC::Wasm::trapHandler): >+ * wasm/js/JSWebAssemblyHelpers.h: >+ (JSC::createSourceBufferFromValue): >+ * wasm/js/WebAssemblyPrototype.cpp: >+ (JSC::webAssemblyValidateFunc): >+ > 2019-06-26 Keith Miller <keith_miller@apple.com> > > speciesConstruct needs to throw if the result is a DataView >Index: Source/JavaScriptCore/runtime/PromiseDeferredTimer.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/PromiseDeferredTimer.cpp (revision 246856) >+++ Source/JavaScriptCore/runtime/PromiseDeferredTimer.cpp (working copy) >@@ -54,9 +54,7 @@ void PromiseDeferredTimer::doWork(VM& vm > } > > while (!m_tasks.isEmpty()) { >- JSPromiseDeferred* ticket; >- Task task; >- std::tie(ticket, task) = m_tasks.takeLast(); >+ auto [ticket, task] = m_tasks.takeLast(); > dataLogLnIf(PromiseDeferredTimerInternal::verbose, "Doing work on promise: ", RawPointer(ticket)); > > // We may have already canceled these promises. >Index: Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp >=================================================================== >--- Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp (revision 246856) >+++ Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp (working copy) >@@ -77,10 +77,7 @@ static SignalAction trapHandler(Signal, > if (faultedInActiveFastMemory) { > dataLogLnIf(WasmFaultSignalHandlerInternal::verbose, "found active fast memory for faulting address"); > LockHolder locker(codeLocationsLock); >- for (auto range : codeLocations.get()) { >- void* start; >- void* end; >- std::tie(start, end) = range; >+ for (auto [start, end] : codeLocations.get()) { > dataLogLnIf(WasmFaultSignalHandlerInternal::verbose, "function start: ", RawPointer(start), " end: ", RawPointer(end)); > if (start <= faultingInstruction && faultingInstruction < end) { > dataLogLnIf(WasmFaultSignalHandlerInternal::verbose, "found match"); >Index: Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h >=================================================================== >--- Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h (revision 246856) >+++ Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h (working copy) >@@ -83,9 +83,7 @@ ALWAYS_INLINE std::pair<const uint8_t*, > ALWAYS_INLINE Vector<uint8_t> createSourceBufferFromValue(VM& vm, ExecState* exec, JSValue value) > { > auto throwScope = DECLARE_THROW_SCOPE(vm); >- const uint8_t* data; >- size_t byteSize; >- std::tie(data, byteSize) = getWasmBufferFromValue(exec, value); >+ auto [data, byteSize] = getWasmBufferFromValue(exec, value); > RETURN_IF_EXCEPTION(throwScope, Vector<uint8_t>()); > > Vector<uint8_t> result; >Index: Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp >=================================================================== >--- Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp (revision 246856) >+++ Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp (working copy) >@@ -290,9 +290,7 @@ static EncodedJSValue JSC_HOST_CALL webA > VM& vm = exec->vm(); > auto scope = DECLARE_THROW_SCOPE(vm); > >- const uint8_t* base; >- size_t byteSize; >- std::tie(base, byteSize) = getWasmBufferFromValue(exec, exec->argument(0)); >+ auto [base, byteSize] = getWasmBufferFromValue(exec, exec->argument(0)); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); > BBQPlan plan(&vm.wasmContext, BBQPlan::Validation, Plan::dontFinalize()); > // FIXME: We might want to throw an OOM exception here if we detect that something will OOM. >Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 246856) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,43 @@ >+2019-06-26 Sam Weinig <weinig@apple.com> >+ >+ Adopt simple structured bindings in more places >+ https://bugs.webkit.org/show_bug.cgi?id=199247 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replaces simple uses of std::tie() with structured bindings. Does not touch >+ uses of std::tie() that are not initial declarations or use std::ignore, as >+ structured bindings don't work for those cases yet. >+ >+ * css/StyleResolver.cpp: >+ (WebCore::checkForOrientationChange): >+ * page/csp/ContentSecurityPolicy.cpp: >+ (WebCore::ContentSecurityPolicy::allowInlineScript const): >+ (WebCore::ContentSecurityPolicy::allowInlineStyle const): >+ * platform/graphics/ComplexTextController.cpp: >+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances): >+ * platform/graphics/PathUtilities.cpp: >+ (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline): >+ * platform/graphics/WidthIterator.cpp: >+ (WebCore::WidthIterator::advanceInternal): >+ * platform/graphics/cocoa/FontCacheCoreText.cpp: >+ (WebCore::FontCache::createFontPlatformData): >+ (WebCore::FontCache::systemFallbackForCharacters): >+ (WebCore::FontCache::lastResortFallbackFont): >+ * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: >+ (WebCore::FontFamilySpecificationCoreText::fontRanges const): >+ * platform/network/SocketStreamHandleImpl.cpp: >+ (WebCore::cookieDataForHandshake): >+ * rendering/InlineTextBox.cpp: >+ (WebCore::InlineTextBox::selectionState): >+ (WebCore::createMarkedTextFromSelectionInBox): >+ * rendering/svg/SVGInlineTextBox.cpp: >+ (WebCore::SVGInlineTextBox::paintSelectionBackground): >+ * style/StyleResolveForDocument.cpp: >+ (WebCore::Style::resolveForDocument): >+ * svg/animation/SVGSMILElement.cpp: >+ (WebCore::SVGSMILElement::constructAttributeName const): >+ > 2019-06-26 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Implement console.countReset >Index: Source/WebCore/css/StyleResolver.cpp >=================================================================== >--- Source/WebCore/css/StyleResolver.cpp (revision 246856) >+++ Source/WebCore/css/StyleResolver.cpp (working copy) >@@ -1176,9 +1176,7 @@ void StyleResolver::adjustRenderStyleFor > > static void checkForOrientationChange(RenderStyle& style) > { >- FontOrientation fontOrientation; >- NonCJKGlyphOrientation glyphOrientation; >- std::tie(fontOrientation, glyphOrientation) = style.fontAndGlyphOrientation(); >+ auto [fontOrientation, glyphOrientation] = style.fontAndGlyphOrientation(); > > const auto& fontDescription = style.fontDescription(); > if (fontDescription.orientation() == fontOrientation && fontDescription.nonCJKGlyphOrientation() == glyphOrientation) >Index: Source/WebCore/page/csp/ContentSecurityPolicy.cpp >=================================================================== >--- Source/WebCore/page/csp/ContentSecurityPolicy.cpp (revision 246856) >+++ Source/WebCore/page/csp/ContentSecurityPolicy.cpp (working copy) >@@ -427,9 +427,7 @@ bool ContentSecurityPolicy::allowInlineS > if (overrideContentSecurityPolicy) > return true; > bool didNotifyInspector = false; >- bool foundHashInEnforcedPolicies; >- bool foundHashInReportOnlyPolicies; >- std::tie(foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies) = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, scriptContent, m_hashAlgorithmsForInlineScripts); >+ auto [foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies] = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, scriptContent, m_hashAlgorithmsForInlineScripts); > if (foundHashInEnforcedPolicies && foundHashInReportOnlyPolicies) > return true; > auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) { >@@ -453,9 +451,7 @@ bool ContentSecurityPolicy::allowInlineS > return true; > if (m_overrideInlineStyleAllowed) > return true; >- bool foundHashInEnforcedPolicies; >- bool foundHashInReportOnlyPolicies; >- std::tie(foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies) = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash, styleContent, m_hashAlgorithmsForInlineStylesheets); >+ auto [foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies] = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash, styleContent, m_hashAlgorithmsForInlineStylesheets); > if (foundHashInEnforcedPolicies && foundHashInReportOnlyPolicies) > return true; > auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) { >Index: Source/WebCore/platform/graphics/ComplexTextController.cpp >=================================================================== >--- Source/WebCore/platform/graphics/ComplexTextController.cpp (revision 246856) >+++ Source/WebCore/platform/graphics/ComplexTextController.cpp (working copy) >@@ -788,8 +788,7 @@ void ComplexTextController::adjustGlyphs > if (treatAsSpace || ideograph || forceLeadingExpansion || forceTrailingExpansion) { > // Distribute the run's total expansion evenly over all expansion opportunities in the run. > if (m_expansion) { >- bool expandLeft, expandRight; >- std::tie(expandLeft, expandRight) = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), afterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion); >+ auto [expandLeft, expandRight] = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), afterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion); > if (expandLeft) { > m_expansion -= m_expansionPerOpportunity; > // Increase previous width >Index: Source/WebCore/platform/graphics/PathUtilities.cpp >=================================================================== >--- Source/WebCore/platform/graphics/PathUtilities.cpp (revision 246856) >+++ Source/WebCore/platform/graphics/PathUtilities.cpp (working copy) >@@ -580,14 +580,10 @@ Path PathUtilities::pathWithShrinkWrappe > continue; > } > } >- FloatPoint startPoint; >- FloatPoint endPoint; >- std::tie(startPoint, endPoint) = startAndEndPointsForCorner(fromEdge, toEdge, radius); >+ auto [startPoint, endPoint] = startAndEndPointsForCorner(fromEdge, toEdge, radius); > moveOrAddLineTo(startPoint); > >- FloatPoint cp1; >- FloatPoint cp2; >- std::tie(cp1, cp2) = controlPointsForBezierCurve(corner, fromEdge, toEdge, radius); >+ auto [cp1, cp2] = controlPointsForBezierCurve(corner, fromEdge, toEdge, radius); > path.addBezierCurveTo(cp1, cp2, endPoint); > } > path.closeSubpath(); >Index: Source/WebCore/platform/graphics/WidthIterator.cpp >=================================================================== >--- Source/WebCore/platform/graphics/WidthIterator.cpp (revision 246856) >+++ Source/WebCore/platform/graphics/WidthIterator.cpp (working copy) >@@ -276,8 +276,7 @@ inline unsigned WidthIterator::advanceIn > if (treatAsSpace || ideograph || forceLeadingExpansion || forceTrailingExpansion) { > // Distribute the run's total expansion evenly over all expansion opportunities in the run. > if (m_expansion) { >- bool expandLeft, expandRight; >- std::tie(expandLeft, expandRight) = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), m_isAfterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion); >+ auto [expandLeft, expandRight] = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), m_isAfterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion); > if (expandLeft) { > if (m_run.ltr()) { > // Increase previous width >Index: Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >=================================================================== >--- Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (revision 246856) >+++ Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (working copy) >@@ -1308,8 +1308,7 @@ std::unique_ptr<FontPlatformData> FontCa > if (fontDescription.shouldAllowUserInstalledFonts() == AllowUserInstalledFonts::No) > m_seenFamiliesForPrewarming.add(FontCascadeDescription::foldedFamilyName(family)); > >- bool syntheticBold, syntheticOblique; >- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair(); >+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair(); > > return std::make_unique<FontPlatformData>(font.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode()); > } >@@ -1409,8 +1408,7 @@ RefPtr<Font> FontCache::systemFallbackFo > // font pointer. > CTFontRef substituteFont = fallbackDedupSet().add(result).iterator->get(); > >- bool syntheticBold, syntheticOblique; >- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(substituteFont, description, isForPlatformFont == IsForPlatformFont::Yes).boldObliquePair(); >+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(substituteFont, description, isForPlatformFont == IsForPlatformFont::Yes).boldObliquePair(); > > FontPlatformData alternateFont(substituteFont, platformData.size(), syntheticBold, syntheticOblique, platformData.orientation(), platformData.widthVariant(), platformData.textRenderingMode()); > >@@ -1546,8 +1544,7 @@ Ref<Font> FontCache::lastResortFallbackF > // a thin wrapper around a GraphicsFont which represents LastResort. > auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontDescription.computedPixelSize(), nullptr)); > #endif >- bool syntheticBold, syntheticOblique; >- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair(); >+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair(); > FontPlatformData platformData(font.get(), fontDescription.computedPixelSize(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode()); > return fontForPlatformData(platformData); > } >Index: Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp >=================================================================== >--- Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp (revision 246856) >+++ Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp (working copy) >@@ -110,8 +110,7 @@ FontRanges FontFamilySpecificationCoreTe > > font = preparePlatformFont(font.get(), fontDescription, nullptr, nullptr, { }); > >- bool syntheticBold, syntheticOblique; >- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(fontForSynthesisComputation.get(), fontDescription).boldObliquePair(); >+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(fontForSynthesisComputation.get(), fontDescription).boldObliquePair(); > > return std::make_unique<FontPlatformData>(font.get(), size, false, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode()); > }).iterator->value; >Index: Source/WebCore/platform/network/SocketStreamHandleImpl.cpp >=================================================================== >--- Source/WebCore/platform/network/SocketStreamHandleImpl.cpp (revision 246856) >+++ Source/WebCore/platform/network/SocketStreamHandleImpl.cpp (working copy) >@@ -82,9 +82,7 @@ static Optional<std::pair<Vector<uint8_t > if (!networkStorageSession) > return WTF::nullopt; > >- String cookieDataString; >- bool secureCookiesAccessed = false; >- std::tie(cookieDataString, secureCookiesAccessed) = networkStorageSession->cookieRequestHeaderFieldValue(headerFieldProxy); >+ auto [cookieDataString, secureCookiesAccessed] = networkStorageSession->cookieRequestHeaderFieldValue(headerFieldProxy); > if (cookieDataString.isEmpty()) > return std::pair<Vector<uint8_t>, bool> { { }, secureCookiesAccessed }; > >Index: Source/WebCore/rendering/InlineTextBox.cpp >=================================================================== >--- Source/WebCore/rendering/InlineTextBox.cpp (revision 246856) >+++ Source/WebCore/rendering/InlineTextBox.cpp (working copy) >@@ -180,9 +180,7 @@ RenderObject::SelectionState InlineTextB > if (m_truncation != cNoTruncation && root().ellipsisBox()) { > EllipsisBox* ellipsis = root().ellipsisBox(); > if (state != RenderObject::SelectionNone) { >- unsigned selectionStart; >- unsigned selectionEnd; >- std::tie(selectionStart, selectionEnd) = selectionStartEnd(); >+ auto [selectionStart, selectionEnd] = selectionStartEnd(); > // The ellipsis should be considered to be selected if the end of > // the selection is past the beginning of the truncation and the > // beginning of the selection is before or at the beginning of the >@@ -438,9 +436,7 @@ struct InlineTextBox::StyledMarkedText : > > static MarkedText createMarkedTextFromSelectionInBox(const InlineTextBox& box) > { >- unsigned selectionStart; >- unsigned selectionEnd; >- std::tie(selectionStart, selectionEnd) = box.selectionStartEnd(); >+ auto [selectionStart, selectionEnd] = box.selectionStartEnd(); > if (selectionStart < selectionEnd) > return { selectionStart, selectionEnd, MarkedText::Selection }; > return { }; >Index: Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >=================================================================== >--- Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (revision 246856) >+++ Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (working copy) >@@ -202,9 +202,7 @@ void SVGInlineTextBox::paintSelectionBac > > auto& style = parentRenderer.style(); > >- unsigned startPosition; >- unsigned endPosition; >- std::tie(startPosition, endPosition) = selectionStartEnd(); >+ auto [startPosition, endPosition] = selectionStartEnd(); > > unsigned fragmentStartPosition = 0; > unsigned fragmentEndPosition = 0; >Index: Source/WebCore/style/StyleResolveForDocument.cpp >=================================================================== >--- Source/WebCore/style/StyleResolveForDocument.cpp (revision 246856) >+++ Source/WebCore/style/StyleResolveForDocument.cpp (working copy) >@@ -117,9 +117,7 @@ RenderStyle resolveForDocument(const Doc > bool useSVGZoomRules = document.isSVGDocument(); > fontDescription.setComputedSize(computedFontSizeFromSpecifiedSize(size, fontDescription.isAbsoluteSize(), useSVGZoomRules, &documentStyle, document)); > >- FontOrientation fontOrientation; >- NonCJKGlyphOrientation glyphOrientation; >- std::tie(fontOrientation, glyphOrientation) = documentStyle.fontAndGlyphOrientation(); >+ auto [fontOrientation, glyphOrientation] = documentStyle.fontAndGlyphOrientation(); > fontDescription.setOrientation(fontOrientation); > fontDescription.setNonCJKGlyphOrientation(glyphOrientation); > >Index: Source/WebCore/svg/animation/SVGSMILElement.cpp >=================================================================== >--- Source/WebCore/svg/animation/SVGSMILElement.cpp (revision 246856) >+++ Source/WebCore/svg/animation/SVGSMILElement.cpp (working copy) >@@ -219,8 +219,7 @@ inline QualifiedName SVGSMILElement::con > if (parseResult.hasException()) > return anyQName(); > >- AtomString prefix, localName; >- std::tie(prefix, localName) = parseResult.releaseReturnValue(); >+ auto [prefix, localName] = parseResult.releaseReturnValue(); > > if (prefix.isNull()) > return { nullAtom(), localName, nullAtom() }; >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 246856) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,61 @@ >+2019-06-26 Sam Weinig <weinig@apple.com> >+ >+ Adopt simple structured bindings in more places >+ https://bugs.webkit.org/show_bug.cgi?id=199247 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replaces simple uses of std::tie() with structured bindings. Does not touch >+ uses of std::tie() that are not initial declarations or use std::ignore, as >+ structured bindings don't work for those cases yet. >+ >+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: >+ (WebKit::NetworkCache::printSpeculativeLoadingDiagnosticMessageCounts): >+ * NetworkProcess/cache/PrefetchCache.cpp: >+ (WebKit::PrefetchCache::clearExpiredEntries): >+ * Platform/IPC/MessageReceiverMap.cpp: >+ (IPC::MessageReceiverMap::removeMessageReceiver): >+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: >+ (WebKit::PlaybackSessionManagerProxy::invalidate): >+ * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: >+ (WebKit::VideoFullscreenManagerProxy::invalidate): >+ (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen): >+ (WebKit::VideoFullscreenManagerProxy::hasMode const): >+ (WebKit::VideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture const): >+ (VideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen const): >+ * UIProcess/ios/SmartMagnificationController.mm: >+ (WebKit::SmartMagnificationController::zoomFactorForTargetRect): >+ (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture): >+ (WebKit::SmartMagnificationController::magnify): >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: >+ (WebKit:: const): >+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: >+ (WebKit::WebPage::performDictionaryLookupAtLocation): >+ (WebKit::WebPage::performDictionaryLookupForSelection): >+ (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted. >+ (WebKit::WebPage::performDictionaryLookupForRange): Deleted. >+ (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted. >+ (WebKit::WebPage::accessibilityTransferRemoteToken): Deleted. >+ (WebKit::WebPage::paymentCoordinator): Deleted. >+ (WebKit::WebPage::getContentsAsAttributedString): Deleted. >+ (WebKit::WebPage::setRemoteObjectRegistry): Deleted. >+ (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad): Deleted. >+ * WebProcess/cocoa/PlaybackSessionManager.mm: >+ (WebKit::PlaybackSessionManager::~PlaybackSessionManager): >+ (WebKit::PlaybackSessionManager::removeContext): >+ * WebProcess/cocoa/VideoFullscreenManager.mm: >+ (WebKit::VideoFullscreenManager::~VideoFullscreenManager): >+ (WebKit::VideoFullscreenManager::removeContext): >+ (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): >+ (WebKit::VideoFullscreenManager::requestVideoContentLayer): >+ (WebKit::VideoFullscreenManager::returnVideoContentLayer): >+ (WebKit::VideoFullscreenManager::didSetupFullscreen): >+ (WebKit::VideoFullscreenManager::willExitFullscreen): >+ (WebKit::VideoFullscreenManager::didEnterFullscreen): >+ (WebKit::VideoFullscreenManager::didExitFullscreen): >+ (WebKit::VideoFullscreenManager::didCleanupFullscreen): >+ (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced): >+ > 2019-06-26 Alex Christensen <achristensen@webkit.org> > > testRunner.setAlwaysAcceptCookies should wait for cookie accept policy to be set >Index: Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (revision 246856) >+++ Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (working copy) >@@ -59,8 +59,8 @@ static HashCountedSet<String>& allSpecul > static void printSpeculativeLoadingDiagnosticMessageCounts() > { > LOG(NetworkCacheSpeculativePreloading, "-- Speculative loading statistics --"); >- for (auto& pair : allSpeculativeLoadingDiagnosticMessages()) >- LOG(NetworkCacheSpeculativePreloading, "%s: %u", pair.key.utf8().data(), pair.value); >+ for (auto& [message, count] : allSpeculativeLoadingDiagnosticMessages()) >+ LOG(NetworkCacheSpeculativePreloading, "%s: %u", message.utf8().data(), count); > } > #endif > >Index: Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp (revision 246856) >+++ Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp (working copy) >@@ -96,11 +96,9 @@ void PrefetchCache::storeRedirect(const > > void PrefetchCache::clearExpiredEntries() > { >- URL requestUrl; >- WallTime timestamp; > auto timeout = WallTime::now(); > while (!m_sessionExpirationList.isEmpty()) { >- std::tie(requestUrl, timestamp) = m_sessionExpirationList.first(); >+ auto [requestUrl, timestamp] = m_sessionExpirationList.first(); > auto* resources = m_sessionPrefetches.get(); > ASSERT(resources); > ASSERT(resources->contains(requestUrl)); >Index: Source/WebKit/Platform/IPC/MessageReceiverMap.cpp >=================================================================== >--- Source/WebKit/Platform/IPC/MessageReceiverMap.cpp (revision 246856) >+++ Source/WebKit/Platform/IPC/MessageReceiverMap.cpp (working copy) >@@ -80,22 +80,22 @@ void MessageReceiverMap::removeMessageRe > void MessageReceiverMap::removeMessageReceiver(MessageReceiver& messageReceiver) > { > Vector<StringReference> globalReceiversToRemove; >- for (auto& nameAndReceiver : m_globalMessageReceivers) { >- if (nameAndReceiver.value == &messageReceiver) >- globalReceiversToRemove.append(nameAndReceiver.key); >+ for (auto& [name, receiver] : m_globalMessageReceivers) { >+ if (receiver == &messageReceiver) >+ globalReceiversToRemove.append(name); > } > > for (auto& globalReceiverToRemove : globalReceiversToRemove) > removeMessageReceiver(globalReceiverToRemove); > > Vector<std::pair<StringReference, uint64_t>> receiversToRemove; >- for (auto& nameAndIdAndReceiver : m_messageReceivers) { >- if (nameAndIdAndReceiver.value == &messageReceiver) >- receiversToRemove.append(std::make_pair(nameAndIdAndReceiver.key.first, nameAndIdAndReceiver.key.second)); >+ for (auto& [nameAndDestinationID, receiver] : m_messageReceivers) { >+ if (receiver == &messageReceiver) >+ receiversToRemove.append(std::make_pair(nameAndDestinationID.first, nameAndDestinationID.second)); > } > >- for (auto& receiverToRemove : receiversToRemove) >- removeMessageReceiver(receiverToRemove.first, receiverToRemove.second); >+ for (auto& [name, destinationID] : receiversToRemove) >+ removeMessageReceiver(name, destinationID); > } > > void MessageReceiverMap::invalidate() >Index: Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm (revision 246856) >+++ Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm (working copy) >@@ -320,13 +320,8 @@ void PlaybackSessionManagerProxy::invali > auto contextMap = WTFMove(m_contextMap); > m_clientCounts.clear(); > >- for (auto& tuple : contextMap.values()) { >- RefPtr<PlaybackSessionModelContext> model; >- RefPtr<PlatformPlaybackSessionInterface> interface; >- std::tie(model, interface) = tuple; >- >+ for (auto& [model, interface] : contextMap.values()) > interface->invalidate(); >- } > } > > PlaybackSessionManagerProxy::ModelInterfaceTuple PlaybackSessionManagerProxy::createModelAndInterface(uint64_t contextId) >Index: Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm (revision 246856) >+++ Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm (working copy) >@@ -343,11 +343,7 @@ void VideoFullscreenManagerProxy::invali > auto contextMap = WTFMove(m_contextMap); > m_clientCounts.clear(); > >- for (auto& tuple : contextMap.values()) { >- RefPtr<VideoFullscreenModelContext> model; >- RefPtr<PlatformVideoFullscreenInterface> interface; >- std::tie(model, interface) = tuple; >- >+ for (auto& [model, interface] : contextMap.values()) { > interface->invalidate(); > [model->layerHostView() removeFromSuperview]; > model->setLayerHostView(nullptr); >@@ -356,14 +352,14 @@ interface->invalidate(); > > void VideoFullscreenManagerProxy::requestHideAndExitFullscreen() > { >- for (auto& tuple : m_contextMap.values()) >- std::get<1>(tuple)->requestHideAndExitFullscreen(); >+ for (auto& [model, interface] : m_contextMap.values()) >+ interface->requestHideAndExitFullscreen(); > } > > bool VideoFullscreenManagerProxy::hasMode(HTMLMediaElementEnums::VideoFullscreenMode mode) const > { >- for (auto& tuple : m_contextMap.values()) { >- if (std::get<1>(tuple)->hasMode(mode)) >+ for (auto& [model, interface] : m_contextMap.values()) { >+ if (interface->hasMode(mode)) > return true; > } > return false; >@@ -371,8 +367,8 @@ bool VideoFullscreenManagerProxy::hasMod > > bool VideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture() const > { >- for (auto& tuple : m_contextMap.values()) { >- if (std::get<1>(tuple)->mayAutomaticallyShowVideoPictureInPicture()) >+ for (auto& [model, interface] : m_contextMap.values()) >+ if (interface->mayAutomaticallyShowVideoPictureInPicture()) > return true; > } > return false; >@@ -381,8 +377,8 @@ bool VideoFullscreenManagerProxy::mayAut > #if ENABLE(VIDEO_PRESENTATION_MODE) > bool VideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen() const > { >- for (auto& tuple : m_contextMap.values()) { >- if (std::get<1>(tuple)->isPlayingVideoInEnhancedFullscreen()) >+ for (auto& [model, interface] : m_contextMap.values()) >+ if (interface->isPlayingVideoInEnhancedFullscreen()) > return true; > } > >@@ -399,8 +395,8 @@ PlatformVideoFullscreenInterface* VideoF > > void VideoFullscreenManagerProxy::applicationDidBecomeActive() > { >- for (auto& tuple : m_contextMap.values()) >- std::get<1>(tuple)->applicationDidBecomeActive(); >+ for (auto& [model, interface] : m_contextMap.values()) >+ interface->applicationDidBecomeActive(); > } > > void VideoFullscreenManagerProxy::requestRouteSharingPolicyAndContextUID(uint64_t contextId, CompletionHandler<void(WebCore::RouteSharingPolicy, String)>&& callback) >@@ -473,10 +469,8 @@ void VideoFullscreenManagerProxy::setupF > MESSAGE_CHECK_CONTEXTID(contextId); > > ASSERT(videoLayerID); >- RefPtr<VideoFullscreenModelContext> model; >- RefPtr<PlatformVideoFullscreenInterface> interface; > >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > addClientForContext(contextId); > > RetainPtr<WKLayerHostView> view = static_cast<WKLayerHostView*>(model->layerHostView()); >@@ -665,7 +659,7 @@ void VideoFullscreenManagerProxy::didCle > RefPtr<VideoFullscreenModelContext> model; > RefPtr<PlatformVideoFullscreenInterface> interface; > >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > [CATransaction flush]; > [model->layerHostView() removeFromSuperview]; >Index: Source/WebKit/UIProcess/ios/SmartMagnificationController.mm >=================================================================== >--- Source/WebKit/UIProcess/ios/SmartMagnificationController.mm (revision 246856) >+++ Source/WebKit/UIProcess/ios/SmartMagnificationController.mm (working copy) >@@ -97,10 +97,7 @@ double SmartMagnificationController::zoo > { > // FIXME: Share some of this code with didCollectGeometryForSmartMagnificationGesture? > >- FloatRect adjustedTargetRect; >- double minimumScale = viewportMinimumScale; >- double maximumScale = viewportMaximumScale; >- std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect); >+ auto [adjustedTargetRect, minimumScale, maximumScale] = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect); > > double currentScale = [m_contentView _contentZoomScale]; > double targetScale = [m_contentView _targetContentZoomScaleForRect:adjustedTargetRect currentScale:currentScale fitEntireRect:fitEntireRect minimumScale:minimumScale maximumScale:maximumScale]; >@@ -118,10 +115,7 @@ void SmartMagnificationController::didCo > [m_contentView _zoomToInitialScaleWithOrigin:origin]; > return; > } >- FloatRect adjustedTargetRect; >- double minimumScale = viewportMinimumScale; >- double maximumScale = viewportMaximumScale; >- std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect); >+ auto [adjustedTargetRect, minimumScale, maximumScale] = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect); > > // FIXME: Check if text selection wants to consume the double tap before we attempt magnification. > >@@ -147,10 +141,7 @@ void SmartMagnificationController::didCo > > void SmartMagnificationController::magnify(FloatPoint origin, FloatRect targetRect, FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale) > { >- FloatRect adjustedTargetRect; >- double maximumScale = viewportMaximumScale; >- double minimumScale = viewportMinimumScale; >- std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, true); >+ auto [adjustedTargetRect, minimumScale, maximumScale] = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, true); > > [m_contentView _zoomToRect:adjustedTargetRect withOrigin:origin fitEntireRect:NO minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:0]; > } >Index: Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >=================================================================== >--- Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (revision 246856) >+++ Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (working copy) >@@ -2094,9 +2094,7 @@ std::tuple<String, PDFSelection *, NSDic > return { selection.string, selection, nil }; > } > >- NSString *lookupText; >- NSDictionary *options; >- std::tie(lookupText, options) = DictionaryLookup::stringForPDFSelection(selection); >+ auto [lookupText, options] = DictionaryLookup::stringForPDFSelection(selection); > if (!lookupText.length) > return { emptyString(), selection, nil }; > >Index: Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (revision 246856) >+++ Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (working copy) >@@ -85,9 +85,7 @@ void WebPage::performDictionaryLookupAtL > > // Find the frame the point is over. > HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->windowToContents(roundedIntPoint(floatPoint))); >- RefPtr<Range> range; >- NSDictionary *options; >- std::tie(range, options) = DictionaryLookup::rangeAtHitTestResult(result); >+ auto [range, options] = DictionaryLookup::rangeAtHitTestResult(result); > if (!range) > return; > >@@ -100,9 +98,7 @@ void WebPage::performDictionaryLookupAtL > > void WebPage::performDictionaryLookupForSelection(Frame& frame, const VisibleSelection& selection, TextIndicatorPresentationTransition presentationTransition) > { >- RefPtr<Range> selectedRange; >- NSDictionary *options; >- std::tie(selectedRange, options) = DictionaryLookup::rangeForSelection(selection); >+ auto [selectedRange, options) = DictionaryLookup::rangeForSelection(selection); > if (selectedRange) > performDictionaryLookupForRange(frame, *selectedRange, options, presentationTransition); > } >Index: Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm >=================================================================== >--- Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm (revision 246856) >+++ Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm (working copy) >@@ -175,10 +175,7 @@ PlaybackSessionManager::PlaybackSessionM > > PlaybackSessionManager::~PlaybackSessionManager() > { >- for (auto& tuple : m_contextMap.values()) { >- RefPtr<PlaybackSessionModelMediaElement> model; >- RefPtr<PlaybackSessionInterfaceContext> interface; >- std::tie(model, interface) = tuple; >+ for (auto& [model, interface] : m_contextMap.values()) { > model->removeClient(*interface); > model->setMediaElement(nullptr); > >@@ -229,9 +226,7 @@ PlaybackSessionInterfaceContext& Playbac > > void PlaybackSessionManager::removeContext(uint64_t contextId) > { >- RefPtr<PlaybackSessionModelMediaElement> model; >- RefPtr<PlaybackSessionInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > RefPtr<HTMLMediaElement> mediaElement = model->mediaElement(); > model->setMediaElement(nullptr); >Index: Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm >=================================================================== >--- Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm (revision 246856) >+++ Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm (working copy) >@@ -122,11 +122,7 @@ VideoFullscreenManager::VideoFullscreenM > > VideoFullscreenManager::~VideoFullscreenManager() > { >- for (auto& tuple : m_contextMap.values()) { >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = tuple; >- >+ for (auto& [model, interface] : m_contextMap.values()) { > model->setVideoElement(nullptr); > model->removeClient(*interface); > >@@ -180,9 +176,7 @@ VideoFullscreenInterfaceContext& VideoFu > > void VideoFullscreenManager::removeContext(uint64_t contextId) > { >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > m_playbackSessionManager->removeClientForContext(contextId); > >@@ -250,9 +244,7 @@ void VideoFullscreenManager::enterVideoF > UNUSED_PARAM(addResult); > ASSERT(addResult.iterator->value == contextId); > >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > addClientForContext(contextId); > if (!interface->layerHostingContext()) > interface->setLayerHostingContext(LayerHostingContext::createForExternalHostingProcess()); >@@ -369,9 +361,7 @@ void VideoFullscreenManager::requestUpda > > void VideoFullscreenManager::requestVideoContentLayer(uint64_t contextId) > { >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > CALayer* videoLayer = interface->layerHostingContext()->rootLayer(); > >@@ -385,9 +375,7 @@ CALayer* videoLayer = interface->lay > > void VideoFullscreenManager::returnVideoContentLayer(uint64_t contextId) > { >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > model->waitForPreparedForInlineThen([protectedThis = makeRefPtr(this), this, contextId, model] () mutable { // need this for return video layer > dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this, contextId, model] () mutable { >@@ -406,9 +394,7 @@ void VideoFullscreenManager::didSetupFul > LOG(Fullscreen, "VideoFullscreenManager::didSetupFullscreen(%p, %x)", this, contextId); > > ASSERT(m_page); >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > #if PLATFORM(IOS_FAMILY) > dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, contextId] { >@@ -431,9 +417,7 @@ void VideoFullscreenManager::willExitFul > { > LOG(Fullscreen, "VideoFullscreenManager::willExitFullscreen(%p, %x)", this, contextId); > >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > RefPtr<HTMLVideoElement> videoElement = model->videoElement(); > if (!videoElement) >@@ -450,9 +434,7 @@ void VideoFullscreenManager::didEnterFul > { > LOG(Fullscreen, "VideoFullscreenManager::didEnterFullscreen(%p, %x)", this, contextId); > >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > interface->setIsAnimating(false); > interface->setIsFullscreen(false); >@@ -479,9 +461,7 @@ void VideoFullscreenManager::didExitFull > { > LOG(Fullscreen, "VideoFullscreenManager::didExitFullscreen(%p, %x)", this, contextId); > >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > #if PLATFORM(IOS_FAMILY) > dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), contextId, interface] { >@@ -510,9 +490,7 @@ void VideoFullscreenManager::didCleanupF > { > LOG(Fullscreen, "VideoFullscreenManager::didCleanupFullscreen(%p, %x)", this, contextId); > >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > if (interface->layerHostingContext()) { > interface->layerHostingContext()->setRootLayer(nullptr); >@@ -572,9 +550,7 @@ void VideoFullscreenManager::setVideoLay > return; > } > >- RefPtr<VideoFullscreenModelVideoElement> model; >- RefPtr<VideoFullscreenInterfaceContext> interface; >- std::tie(model, interface) = ensureModelAndInterface(contextId); >+ auto& [model, interface] = ensureModelAndInterface(contextId); > > if (std::isnan(bounds.x()) || std::isnan(bounds.y()) || std::isnan(bounds.width()) || std::isnan(bounds.height())) { > auto videoRect = inlineVideoFrame(*model->videoElement()); >Index: Source/WebKitLegacy/mac/ChangeLog >=================================================================== >--- Source/WebKitLegacy/mac/ChangeLog (revision 246856) >+++ Source/WebKitLegacy/mac/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2019-06-26 Sam Weinig <weinig@apple.com> >+ >+ Adopt simple structured bindings in more places >+ https://bugs.webkit.org/show_bug.cgi?id=199247 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replaces simple uses of std::tie() with structured bindings. Does not touch >+ uses of std::tie() that are not initial declarations or use std::ignore, as >+ structured bindings don't work for those cases yet. >+ >+ * WebView/WebImmediateActionController.mm: >+ (-[WebImmediateActionController _animationControllerForText]): >+ > 2019-06-16 Darin Adler <darin@apple.com> > > Rename AtomicString to AtomString >Index: Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >=================================================================== >--- Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm (revision 246856) >+++ Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm (working copy) >@@ -558,9 +558,7 @@ - (id<NSImmediateActionAnimationControll > if (!frame) > return nil; > >- RefPtr<Range> dictionaryRange; >- NSDictionary *options; >- std::tie(dictionaryRange, options) = DictionaryLookup::rangeAtHitTestResult(_hitTestResult); >+ auto [dictionaryRange, options] = DictionaryLookup::rangeAtHitTestResult(_hitTestResult); > if (!dictionaryRange) > return nil; > >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 246866) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2019-06-26 Sam Weinig <weinig@apple.com> >+ >+ Adopt simple structured bindings in more places >+ https://bugs.webkit.org/show_bug.cgi?id=199247 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replaces simple uses of std::tie() with structured bindings. Does not touch >+ uses of std::tie() that are not initial declarations or use std::ignore, as >+ structured bindings don't work for those cases yet. >+ >+ * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm: >+ (-[DumpRenderTreeFilePromiseReceiver receivePromisedFilesAtDestination:options:operationQueue:reader:]): >+ * TestWebKitAPI/ios/PreferredContentMode.mm: >+ (TestWebKitAPI::TEST): >+ > 2019-06-26 Aakash Jain <aakash_jain@apple.com> > > [ews-build] Add configuration and architecture for WPE and GTK builders >Index: Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm >=================================================================== >--- Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm (revision 246856) >+++ Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm (working copy) >@@ -122,9 +122,7 @@ - (void)receivePromisedFilesAtDestinatio > NSArray<NSURL *> *sourceURLs = _draggingSource.promisedFileURLs; > for (NSURL *sourceURL in sourceURLs) { > [operationQueue addOperationWithBlock:^{ >- NSError *error; >- NSURL *destinationURL; >- std::tie(destinationURL, error) = copyFile(sourceURL, destinationDirectory); >+ auto [destinationURL, error] = copyFile(sourceURL, destinationDirectory); > if (destinationURL) { > dispatch_async(dispatch_get_main_queue(), ^{ > [_destinationURLs addObject:destinationURL]; >Index: Tools/TestWebKitAPI/ios/PreferredContentMode.mm >=================================================================== >--- Tools/TestWebKitAPI/ios/PreferredContentMode.mm (revision 246856) >+++ Tools/TestWebKitAPI/ios/PreferredContentMode.mm (working copy) >@@ -217,30 +217,32 @@ TEST(PreferredContentMode, SetDefaultWeb > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<WKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >- [webView loadHTMLString:@"<pre>Foo</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >- EXPECT_EQ(WKContentModeRecommended, defaultPreferences.preferredContentMode); >- decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences); >- }]; >- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil]; >- EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]); >- >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop); >- [webView loadHTMLString:@"<pre>Bar</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >- EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode); >- decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences); >- }]; >- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil]; >- EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]); >+ { >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >+ [webView loadHTMLString:@"<pre>Foo</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >+ EXPECT_EQ(WKContentModeRecommended, defaultPreferences.preferredContentMode); >+ decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences); >+ }]; >+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil]; >+ EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]); >+ } > >- [webView loadHTMLString:@"<pre>Baz</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >- EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode); >- decisionHandler(WKNavigationActionPolicyAllow, [WKWebpagePreferences preferencesWithContentMode:WKContentModeMobile]); >- }]; >- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (iP", @"TestWebKitAPI", nil]; >- EXPECT_TRUE([[webView navigatorPlatform] containsString:@"iP"]); >+ { >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop); >+ [webView loadHTMLString:@"<pre>Bar</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >+ EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode); >+ decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences); >+ }]; >+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil]; >+ EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]); >+ >+ [webView loadHTMLString:@"<pre>Baz</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >+ EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode); >+ decisionHandler(WKNavigationActionPolicyAllow, [WKWebpagePreferences preferencesWithContentMode:WKContentModeMobile]); >+ }]; >+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (iP", @"TestWebKitAPI", nil]; >+ EXPECT_TRUE([[webView navigatorPlatform] containsString:@"iP"]); >+ } > } > > TEST(PreferredContentMode, DesktopModeWithoutNavigationDelegate) >@@ -264,9 +266,7 @@ TEST(PreferredContentMode, DesktopModeOn > { > IPhoneUserInterfaceSwizzler iPhoneUserInterface; > >- RetainPtr<WKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(); > [webView loadHTMLString:@"<pre>Foo</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { > EXPECT_EQ(WKContentModeRecommended, defaultPreferences.preferredContentMode); > decisionHandler(WKNavigationActionPolicyAllow, [WKWebpagePreferences preferencesWithContentMode:WKContentModeDesktop]); >@@ -286,9 +286,7 @@ TEST(PreferredContentMode, DesktopModeTo > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<WKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(); > > __block BOOL decidedPolicyForMainFrame = NO; > __block BOOL decidedPolicyForSubFrame = NO; >@@ -314,9 +312,7 @@ TEST(PreferredContentMode, DesktopModeUs > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<WKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(); > > [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:makeContentModeDecisionHandler(WKContentModeDesktop)]; > EXPECT_EQ(1024, [[webView objectByEvaluatingJavaScript:@"innerWidth"] intValue]); >@@ -334,9 +330,7 @@ TEST(PreferredContentMode, CustomUserAge > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<TestWKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop); > > NSString *customUserAgent = @"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"; > [webView setCustomUserAgent:customUserAgent]; >@@ -352,9 +346,7 @@ TEST(PreferredContentMode, DoNotAllowCha > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<TestWKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop); > > [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { > EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode); >@@ -374,9 +366,7 @@ TEST(PreferredContentMode, EffectiveCont > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<TestWKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(); > > [webView loadTestPageNamed:@"simple" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:nil]; > [webView loadTestPageNamed:@"simple2" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:makeContentModeDecisionHandler(WKContentModeDesktop)]; >@@ -387,9 +377,7 @@ TEST(PreferredContentMode, EffectiveCont > { > IPhoneUserInterfaceSwizzler iPhoneUserInterface; > >- RetainPtr<TestWKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(); > > [webView loadTestPageNamed:@"simple" andExpectEffectiveContentMode:WKContentModeMobile withPolicyDecisionHandler:nil]; > [webView loadTestPageNamed:@"simple2" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:makeContentModeDecisionHandler(WKContentModeDesktop)]; >@@ -400,9 +388,7 @@ TEST(PreferredContentMode, RecommendedCo > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<TestWKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>({ }, { "TestWebKitAPI" }, CGSizeZero); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>({ }, { "TestWebKitAPI" }, CGSizeZero); > [webView loadTestPageNamed:@"simple" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:nil]; > [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Macintosh", @"TestWebKitAPI", nil]; > >@@ -419,20 +405,20 @@ TEST(PreferredContentMode, ApplicationNa > { > IPadUserInterfaceSwizzler iPadUserInterface; > >- RetainPtr<TestWKWebView> webView; >- RetainPtr<ContentModeNavigationDelegate> delegate; >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >- [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >- defaultPreferences._applicationNameForUserAgentWithModernCompatibility = @"DesktopBrowser"; >- decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences); >- }]; >- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Macintosh", @"DesktopBrowser", nil]; >- EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]); >+ { >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(); >+ [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) { >+ defaultPreferences._applicationNameForUserAgentWithModernCompatibility = @"DesktopBrowser"; >+ decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences); >+ }]; >+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Macintosh", @"DesktopBrowser", nil]; >+ EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]); >+ } > > { > // Don't attempt to change the application name, but still opt into desktop-class browsing; > // the application name should not default to "Mobile/15E148". >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { }); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { }); > [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil]; > NSString *userAgent = [webView navigatorUserAgent]; > EXPECT_FALSE([userAgent containsString:@"Mobile"]); >@@ -441,7 +427,7 @@ TEST(PreferredContentMode, ApplicationNa > { > // Don't attempt to change the application name, but this time, opt into mobile content. The application > // name should default to "Mobile/15E148". >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeMobile, { }); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeMobile, { }); > [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil]; > NSString *userAgent = [webView navigatorUserAgent]; > EXPECT_TRUE([userAgent containsString:@"Mobile"]); >@@ -449,7 +435,7 @@ TEST(PreferredContentMode, ApplicationNa > } > { > // Manually set the application name for user agent to the default value, Mobile/15E148. >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { "Mobile/15E148" }); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { "Mobile/15E148" }); > [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil]; > NSString *userAgent = [webView navigatorUserAgent]; > EXPECT_TRUE([userAgent containsString:@"Mobile"]); >@@ -457,7 +443,7 @@ TEST(PreferredContentMode, ApplicationNa > } > { > // Manually set the application name for user agent to nil. >- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, {{ }}); >+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, {{ }}); > [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil]; > NSString *userAgent = [webView navigatorUserAgent]; > EXPECT_FALSE([userAgent containsString:@"Mobile"]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199247
:
372988
|
372992
|
372996
|
373027
|
373033
|
373200
|
373206
|
373327
|
373338