Title: [219626] trunk/Source/WebKitLegacy/mac
Revision
219626
Author
[email protected]
Date
2017-07-18 14:11:05 -0700 (Tue, 18 Jul 2017)

Log Message

[iOS DnD] [WK1] Add missing calls to WebThreadLock() in some WebView drag-and-drop SPIs
https://bugs.webkit.org/show_bug.cgi?id=174640
<rdar://problem/33297400>

Reviewed by Tim Horton.

Adds a missing call to WebThreadLock() in -_requestStartDataInteraction:globalPosition:. Previously, this was
invoked at the call site in UIKit, but was removed after some refactoring in UIKit. Instead, we should lock the
web thread here, to match the other WebView drag and drop SPI methods.

This patch also adds a WebThreadLock() call in -_dataInteractionCaretRect. While this is fine today, since all
existing callers of _dataInteractionCaretRect already invoke other methods that WebThreadLock() beforehand, we
should make this robust against future UIKit changes that could make this no longer the case.

* WebView/WebView.mm:
(-[WebView _requestStartDataInteraction:globalPosition:]):
(-[WebView _dataInteractionCaretRect]):

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (219625 => 219626)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2017-07-18 20:30:45 UTC (rev 219625)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2017-07-18 21:11:05 UTC (rev 219626)
@@ -1,3 +1,23 @@
+2017-07-18  Wenson Hsieh  <[email protected]>
+
+        [iOS DnD] [WK1] Add missing calls to WebThreadLock() in some WebView drag-and-drop SPIs
+        https://bugs.webkit.org/show_bug.cgi?id=174640
+        <rdar://problem/33297400>
+
+        Reviewed by Tim Horton.
+
+        Adds a missing call to WebThreadLock() in -_requestStartDataInteraction:globalPosition:. Previously, this was
+        invoked at the call site in UIKit, but was removed after some refactoring in UIKit. Instead, we should lock the
+        web thread here, to match the other WebView drag and drop SPI methods.
+
+        This patch also adds a WebThreadLock() call in -_dataInteractionCaretRect. While this is fine today, since all
+        existing callers of _dataInteractionCaretRect already invoke other methods that WebThreadLock() beforehand, we
+        should make this robust against future UIKit changes that could make this no longer the case.
+
+        * WebView/WebView.mm:
+        (-[WebView _requestStartDataInteraction:globalPosition:]):
+        (-[WebView _dataInteractionCaretRect]):
+
 2017-07-18  Andy Estes  <[email protected]>
 
         [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (219625 => 219626)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2017-07-18 20:30:45 UTC (rev 219625)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2017-07-18 21:11:05 UTC (rev 219626)
@@ -1793,6 +1793,7 @@
 
 - (BOOL)_requestStartDataInteraction:(CGPoint)clientPosition globalPosition:(CGPoint)globalPosition
 {
+    WebThreadLock();
     return _private->page->mainFrame().eventHandler().tryToBeginDataInteractionAtPoint(IntPoint(clientPosition), IntPoint(globalPosition));
 }
 
@@ -1814,6 +1815,7 @@
 
 - (CGRect)_dataInteractionCaretRect
 {
+    WebThreadLock();
     if (auto* page = _private->page)
         return page->dragCaretController().caretRectInRootViewCoordinates();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to