Title: [277510] trunk/Source/WebKit
- Revision
- 277510
- Author
- [email protected]
- Date
- 2021-05-14 15:23:10 -0700 (Fri, 14 May 2021)
Log Message
Replace -[WKContentView _hasPendingImageExtraction] with a monotonically increasing ID
https://bugs.webkit.org/show_bug.cgi?id=225823
rdar://77519437
Reviewed by Tim Horton.
Refactor some image extraction code by turning this boolean flag into a monotonically increasing
`ObjectIdentifier` instead; see the bug for more details.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _doAfterPendingImageExtraction:]):
(-[WKContentView _invokeAllActionsToPerformAfterPendingImageExtraction:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (277509 => 277510)
--- trunk/Source/WebKit/ChangeLog 2021-05-14 22:23:04 UTC (rev 277509)
+++ trunk/Source/WebKit/ChangeLog 2021-05-14 22:23:10 UTC (rev 277510)
@@ -1,3 +1,19 @@
+2021-05-14 Wenson Hsieh <[email protected]>
+
+ Replace -[WKContentView _hasPendingImageExtraction] with a monotonically increasing ID
+ https://bugs.webkit.org/show_bug.cgi?id=225823
+ rdar://77519437
+
+ Reviewed by Tim Horton.
+
+ Refactor some image extraction code by turning this boolean flag into a monotonically increasing
+ `ObjectIdentifier` instead; see the bug for more details.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _doAfterPendingImageExtraction:]):
+ (-[WKContentView _invokeAllActionsToPerformAfterPendingImageExtraction:]):
+
2021-05-14 Devin Rousso <[email protected]>
Promote `-[WKWebView _pageExtendedBackgroundColor]` SPI to `-[WKWebView underPageBackgroundColor]` API
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (277509 => 277510)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2021-05-14 22:23:04 UTC (rev 277509)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2021-05-14 22:23:10 UTC (rev 277510)
@@ -63,6 +63,7 @@
#import <wtf/CompletionHandler.h>
#import <wtf/Forward.h>
#import <wtf/Function.h>
+#import <wtf/ObjectIdentifier.h>
#import <wtf/OptionSet.h>
#import <wtf/Vector.h>
#import <wtf/WeakObjCPtr.h>
@@ -228,6 +229,9 @@
Yes
};
+enum ImageExtractionRequestIdentifierType { };
+using ImageExtractionRequestIdentifier = ObjectIdentifier<ImageExtractionRequestIdentifierType>;
+
}
@class WKFocusedElementInfo;
@@ -476,7 +480,7 @@
#if ENABLE(IMAGE_EXTRACTION)
RetainPtr<WKImageExtractionGestureRecognizer> _imageExtractionGestureRecognizer;
RetainPtr<UILongPressGestureRecognizer> _imageExtractionTimeoutGestureRecognizer;
- BOOL _hasPendingImageExtraction;
+ Optional<WebKit::ImageExtractionRequestIdentifier> _pendingImageExtractionRequestIdentifier;
Optional<WebCore::ElementContext> _elementPendingImageExtraction;
Vector<BlockPtr<void(WebKit::ProceedWithImageExtraction)>> _actionsToPerformAfterPendingImageExtraction;
#if USE(UICONTEXTMENU)
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (277509 => 277510)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-05-14 22:23:04 UTC (rev 277509)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-05-14 22:23:10 UTC (rev 277510)
@@ -9613,7 +9613,7 @@
- (void)_doAfterPendingImageExtraction:(void(^)(WebKit::ProceedWithImageExtraction proceedWithImageExtraction))block
{
- if (_hasPendingImageExtraction)
+ if (self.hasPendingImageExtractionRequest)
_actionsToPerformAfterPendingImageExtraction.append(makeBlockPtr(block));
else
block(WebKit::ProceedWithImageExtraction::No);
@@ -9621,7 +9621,7 @@
- (void)_invokeAllActionsToPerformAfterPendingImageExtraction:(WebKit::ProceedWithImageExtraction)proceedWithImageExtraction
{
- _hasPendingImageExtraction = NO;
+ _pendingImageExtractionRequestIdentifier = WTF::nullopt;
_elementPendingImageExtraction = WTF::nullopt;
for (auto block : std::exchange(_actionsToPerformAfterPendingImageExtraction, { }))
block(proceedWithImageExtraction);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes