<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[259518] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/259518">259518</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2020-04-03 15:45:16 -0700 (Fri, 03 Apr 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add more logging to help diagnose <webkit.org/b/209685>
https://bugs.webkit.org/show_bug.cgi?id=209988

Reviewed by Timothy Hatcher.

Source/WebCore:

Remove logging that was previously added in <a href="http://trac.webkit.org/projects/webkit/changeset/259465">r259465</a>.

* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard updateSupportedTypeIdentifiers:]):

Source/WebKit:

Replace logging that was previously added in <a href="http://trac.webkit.org/projects/webkit/changeset/259465">r259465</a> with different logging. The fact that the prior logging
never showed up in the failing tests suggests that the problem happens earlier than I had expected, so we need
to ensure that codepaths for preparing and beginning a drag session are logged instead.

This turns several existing `RELEASE_LOG`s in WKContentView into `NSLog`s, so that they will show up in test
failure output when run on the bots.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didHandleAdditionalDragItemsRequest:]):
(-[WKContentView _didHandleDragStartRequest:]):
(-[WKContentView cleanUpDragSourceSessionState]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView _prepareToDragPromisedAttachment:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:sessionWillBegin:]):
(-[WKContentView dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:canHandleSession:]):
(-[WKContentView dropInteraction:sessionDidEnter:]):
(-[WKContentView dropInteraction:sessionDidUpdate:]):
(-[WKContentView dropInteraction:sessionDidExit:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):

Tools:

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:

Fix a few stray style mistakes (unnecessary `.get()`s).

* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]):
(-[DragAndDropSimulator _advanceProgress]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebItemProviderPasteboardmm">trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsiosDragAndDropTestsIOSmm">trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPIiosDragAndDropSimulatorIOSmm">trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (259517 => 259518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2020-04-03 22:14:18 UTC (rev 259517)
+++ trunk/Source/WebCore/ChangeLog      2020-04-03 22:45:16 UTC (rev 259518)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Add more logging to help diagnose <webkit.org/b/209685>
+        https://bugs.webkit.org/show_bug.cgi?id=209988
+
+        Reviewed by Timothy Hatcher.
+
+        Remove logging that was previously added in r259465.
+
+        * platform/ios/WebItemProviderPasteboard.mm:
+        (-[WebItemProviderPasteboard updateSupportedTypeIdentifiers:]):
+
</ins><span class="cx"> 2020-04-02  Ryosuke Niwa  <rniwa@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         HTMLFormElement should use WeakPtr to keep track of its FormNamedItem
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebItemProviderPasteboardmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm (259517 => 259518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm   2020-04-03 22:14:18 UTC (rev 259517)
+++ trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm      2020-04-03 22:45:16 UTC (rev 259518)
</span><span class="lines">@@ -492,7 +492,6 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)updateSupportedTypeIdentifiers:(NSArray<NSString *> *)types
</span><span class="cx"> {
</span><del>-    NSLog(@"%s => %@", __PRETTY_FUNCTION__, types);
</del><span class="cx">     _supportedTypeIdentifiers = types;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (259517 => 259518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2020-04-03 22:14:18 UTC (rev 259517)
+++ trunk/Source/WebKit/ChangeLog       2020-04-03 22:45:16 UTC (rev 259518)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Add more logging to help diagnose <webkit.org/b/209685>
+        https://bugs.webkit.org/show_bug.cgi?id=209988
+
+        Reviewed by Timothy Hatcher.
+
+        Replace logging that was previously added in r259465 with different logging. The fact that the prior logging
+        never showed up in the failing tests suggests that the problem happens earlier than I had expected, so we need
+        to ensure that codepaths for preparing and beginning a drag session are logged instead.
+
+        This turns several existing `RELEASE_LOG`s in WKContentView into `NSLog`s, so that they will show up in test
+        failure output when run on the bots.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
+        (-[WKContentView _didHandleDragStartRequest:]):
+        (-[WKContentView cleanUpDragSourceSessionState]):
+        (-[WKContentView _didPerformDragOperation:]):
+        (-[WKContentView _prepareToDragPromisedAttachment:]):
+        (-[WKContentView _dragInteraction:prepareForSession:completion:]):
+        (-[WKContentView dragInteraction:itemsForBeginningSession:]):
+        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
+        (-[WKContentView dragInteraction:sessionWillBegin:]):
+        (-[WKContentView dragInteraction:session:didEndWithOperation:]):
+        (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
+        (-[WKContentView dropInteraction:canHandleSession:]):
+        (-[WKContentView dropInteraction:sessionDidEnter:]):
+        (-[WKContentView dropInteraction:sessionDidUpdate:]):
+        (-[WKContentView dropInteraction:sessionDidExit:]):
+        (-[WKContentView dropInteraction:performDrop:]):
+        (-[WKContentView dropInteraction:sessionDidEnd:]):
+
</ins><span class="cx"> 2020-04-03  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Give RunningBoard entitlement to all our child processes
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (259517 => 259518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm    2020-04-03 22:14:18 UTC (rev 259517)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm       2020-04-03 22:45:16 UTC (rev 259518)
</span><span class="lines">@@ -7065,7 +7065,7 @@
</span><span class="cx">     auto stagedDragSource = _dragDropInteractionState.stagedDragSource();
</span><span class="cx">     NSArray *dragItemsToAdd = [self _itemsForBeginningOrAddingToSessionWithRegistrationLists:registrationLists stagedDragSource:stagedDragSource];
</span><span class="cx"> 
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag session: %p adding %tu items", _dragDropInteractionState.dragSession(), dragItemsToAdd.count);
</del><ins>+    NSLog(@"Drag session: %p adding %tu items", _dragDropInteractionState.dragSession(), dragItemsToAdd.count);
</ins><span class="cx">     _dragDropInteractionState.clearStagedDragSource(dragItemsToAdd.count ? WebKit::DragDropInteractionState::DidBecomeActive::Yes : WebKit::DragDropInteractionState::DidBecomeActive::No);
</span><span class="cx"> 
</span><span class="cx">     completion(dragItemsToAdd);
</span><span class="lines">@@ -7079,7 +7079,7 @@
</span><span class="cx">     BlockPtr<void()> savedCompletionBlock = _dragDropInteractionState.takeDragStartCompletionBlock();
</span><span class="cx">     ASSERT(savedCompletionBlock);
</span><span class="cx"> 
</span><del>-    RELEASE_LOG(DragAndDrop, "Handling drag start request (started: %d, completion block: %p)", started, savedCompletionBlock.get());
</del><ins>+    NSLog(@"Handling drag start request (started: %d, completion block: %p)", started, savedCompletionBlock.get());
</ins><span class="cx">     if (savedCompletionBlock)
</span><span class="cx">         savedCompletionBlock();
</span><span class="cx"> 
</span><span class="lines">@@ -7134,7 +7134,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (_dragDropInteractionState.dragSession() || _dragDropInteractionState.isPerformingDrop())
</span><del>-        RELEASE_LOG(DragAndDrop, "Cleaning up dragging state (has pending operation: %d)", [[WebItemProviderPasteboard sharedInstance] hasPendingOperation]);
</del><ins>+        NSLog(@"Cleaning up dragging state (has pending operation: %d)", [[WebItemProviderPasteboard sharedInstance] hasPendingOperation]);
</ins><span class="cx"> 
</span><span class="cx">     if (![[WebItemProviderPasteboard sharedInstance] hasPendingOperation]) {
</span><span class="cx">         // If we're performing a drag operation, don't clear out the pasteboard yet, since another web view may still require access to it.
</span><span class="lines">@@ -7218,7 +7218,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_didPerformDragOperation:(BOOL)handled
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Finished performing drag controller operation (handled: %d)", handled);
</del><ins>+    NSLog(@"Finished performing drag controller operation (handled: %d)", handled);
</ins><span class="cx">     [[WebItemProviderPasteboard sharedInstance] decrementPendingOperationCount];
</span><span class="cx">     id <UIDropSession> dropSession = _dragDropInteractionState.dropSession();
</span><span class="cx">     if ([self.webViewUIDelegate respondsToSelector:@selector(_webView:dataInteractionOperationWasHandled:forSession:itemProviders:)])
</span><span class="lines">@@ -7264,7 +7264,7 @@
</span><span class="cx">     auto numberOfAdditionalTypes = info.additionalTypes.size();
</span><span class="cx">     ASSERT(numberOfAdditionalTypes == info.additionalData.size());
</span><span class="cx"> 
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag session: %p preparing to drag blob: %s with attachment identifier: %s", session.get(), info.blobURL.string().utf8().data(), info.attachmentIdentifier.utf8().data());
</del><ins>+    NSLog(@"Drag session: %p preparing to drag blob: %s with attachment identifier: %s", session.get(), info.blobURL.string().utf8().data(), info.attachmentIdentifier.utf8().data());
</ins><span class="cx"> 
</span><span class="cx">     NSString *utiType = info.contentType;
</span><span class="cx">     NSString *fileName = info.fileName;
</span><span class="lines">@@ -7296,7 +7296,7 @@
</span><span class="cx"> 
</span><span class="cx">         auto attachment = strongSelf->_page->attachmentForIdentifier(info.attachmentIdentifier);
</span><span class="cx">         if (attachment && attachment->fileWrapper()) {
</span><del>-            RELEASE_LOG(DragAndDrop, "Drag session: %p delivering promised attachment: %s at path: %@", session.get(), info.attachmentIdentifier.utf8().data(), destinationURL.path);
</del><ins>+            NSLog(@"Drag session: %p delivering promised attachment: %s at path: %@", session.get(), info.attachmentIdentifier.utf8().data(), destinationURL.path);
</ins><span class="cx">             NSError *fileWrapperError = nil;
</span><span class="cx">             if ([attachment->fileWrapper() writeToURL:destinationURL options:0 originalContentsURL:nil error:&fileWrapperError])
</span><span class="cx">                 callback(destinationURL, nil);
</span><span class="lines">@@ -7619,10 +7619,10 @@
</span><span class="cx"> {
</span><span class="cx">     [self _cancelLongPressGestureRecognizer];
</span><span class="cx"> 
</span><del>-    RELEASE_LOG(DragAndDrop, "Preparing for drag session: %p", session);
</del><ins>+    NSLog(@"Preparing for drag session: %p", session);
</ins><span class="cx">     if (self.currentDragOrDropSession) {
</span><span class="cx">         // FIXME: Support multiple simultaneous drag sessions in the future.
</span><del>-        RELEASE_LOG(DragAndDrop, "Drag session failed: %p (a current drag session already exists)", session);
</del><ins>+        NSLog(@"Drag session failed: %p (a current drag session already exists)", session);
</ins><span class="cx">         completion();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -7634,20 +7634,20 @@
</span><span class="cx">     auto dragOrigin = WebCore::roundedIntPoint([session locationInView:self]);
</span><span class="cx">     _page->requestDragStart(dragOrigin, WebCore::roundedIntPoint([self convertPoint:dragOrigin toView:self.window]), self._allowedDragSourceActions);
</span><span class="cx"> 
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag session requested: %p at origin: {%d, %d}", session, dragOrigin.x(), dragOrigin.y());
</del><ins>+    NSLog(@"Drag session requested: %p at origin: {%d, %d}", session, dragOrigin.x(), dragOrigin.y());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSArray<UIDragItem *> *)dragInteraction:(UIDragInteraction *)interaction itemsForBeginningSession:(id <UIDragSession>)session
</span><span class="cx"> {
</span><span class="cx">     ASSERT(interaction == _dragInteraction);
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag items requested for session: %p", session);
</del><ins>+    NSLog(@"Drag items requested for session: %p", session);
</ins><span class="cx">     if (_dragDropInteractionState.dragSession() != session) {
</span><del>-        RELEASE_LOG(DragAndDrop, "Drag session failed: %p (delegate session does not match %p)", session, _dragDropInteractionState.dragSession());
</del><ins>+        NSLog(@"Drag session failed: %p (delegate session does not match %p)", session, _dragDropInteractionState.dragSession());
</ins><span class="cx">         return @[ ];
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!_dragDropInteractionState.hasStagedDragSource()) {
</span><del>-        RELEASE_LOG(DragAndDrop, "Drag session failed: %p (missing staged drag source)", session);
</del><ins>+        NSLog(@"Drag session failed: %p (missing staged drag source)", session);
</ins><span class="cx">         return @[ ];
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -7657,7 +7657,7 @@
</span><span class="cx">     if (![dragItems count])
</span><span class="cx">         _page->dragCancelled();
</span><span class="cx"> 
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag session: %p starting with %tu items", session, [dragItems count]);
</del><ins>+    NSLog(@"Drag session: %p starting with %tu items", session, [dragItems count]);
</ins><span class="cx">     _dragDropInteractionState.clearStagedDragSource([dragItems count] ? WebKit::DragDropInteractionState::DidBecomeActive::Yes : WebKit::DragDropInteractionState::DidBecomeActive::No);
</span><span class="cx"> 
</span><span class="cx">     return dragItems;
</span><span class="lines">@@ -7676,7 +7676,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)dragInteraction:(UIDragInteraction *)interaction willAnimateLiftWithAnimator:(id <UIDragAnimating>)animator session:(id <UIDragSession>)session
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag session willAnimateLiftWithAnimator: %p", session);
</del><ins>+    NSLog(@"Drag session willAnimateLiftWithAnimator: %p", session);
</ins><span class="cx">     if (_dragDropInteractionState.anyActiveDragSourceIs(WebCore::DragSourceActionSelection)) {
</span><span class="cx">         [self cancelActiveTextInteractionGestures];
</span><span class="cx">         if (!_shouldRestoreCalloutBarAfterDrop) {
</span><span class="lines">@@ -7693,7 +7693,7 @@
</span><span class="cx">         UNUSED_PARAM(session);
</span><span class="cx"> #endif
</span><span class="cx">         if (finalPosition == UIViewAnimatingPositionStart) {
</span><del>-            RELEASE_LOG(DragAndDrop, "Drag session ended at start: %p", session);
</del><ins>+            NSLog(@"Drag session ended at start: %p", session);
</ins><span class="cx">             // The lift was canceled, so -dropInteraction:sessionDidEnd: will never be invoked. This is the last chance to clean up.
</span><span class="cx">             [protectedSelf cleanUpDragSourceSessionState];
</span><span class="cx">             page->dragEnded(positionForDragEnd, positionForDragEnd, WebCore::DragOperationNone);
</span><span class="lines">@@ -7700,7 +7700,7 @@
</span><span class="cx">         }
</span><span class="cx"> #if !RELEASE_LOG_DISABLED
</span><span class="cx">         else
</span><del>-            RELEASE_LOG(DragAndDrop, "Drag session did not end at start: %p", session);
</del><ins>+            NSLog(@"Drag session did not end at start: %p", session);
</ins><span class="cx"> #endif
</span><span class="cx">     }];
</span><span class="cx"> }
</span><span class="lines">@@ -7707,7 +7707,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)dragInteraction:(UIDragInteraction *)interaction sessionWillBegin:(id <UIDragSession>)session
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag session beginning: %p", session);
</del><ins>+    NSLog(@"Drag session beginning: %p", session);
</ins><span class="cx">     id <WKUIDelegatePrivate> uiDelegate = self.webViewUIDelegate;
</span><span class="cx">     if ([uiDelegate respondsToSelector:@selector(_webView:dataInteraction:sessionWillBegin:)])
</span><span class="cx">         [uiDelegate _webView:self.webView dataInteraction:interaction sessionWillBegin:session];
</span><span class="lines">@@ -7719,7 +7719,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)dragInteraction:(UIDragInteraction *)interaction session:(id <UIDragSession>)session didEndWithOperation:(UIDropOperation)operation
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag session ended: %p (with operation: %tu, performing operation: %d, began dragging: %d)", session, operation, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
</del><ins>+    NSLog(@"Drag session ended: %p (with operation: %tu, performing operation: %d, began dragging: %d)", session, operation, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
</ins><span class="cx"> 
</span><span class="cx">     [self _restoreCalloutBarIfNeeded];
</span><span class="cx"> 
</span><span class="lines">@@ -7753,9 +7753,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)dragInteraction:(UIDragInteraction *)interaction item:(UIDragItem *)item willAnimateCancelWithAnimator:(id <UIDragAnimating>)animator
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator");
</del><ins>+    NSLog(@"Drag interaction willAnimateCancelWithAnimator");
</ins><span class="cx">     [animator addCompletion:[protectedSelf = retainPtr(self), page = _page] (UIViewAnimatingPosition finalPosition) {
</span><del>-        RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator (animation completion block fired)");
</del><ins>+        NSLog(@"Drag interaction willAnimateCancelWithAnimator (animation completion block fired)");
</ins><span class="cx">         page->dragCancelled();
</span><span class="cx">         if (auto completion = protectedSelf->_dragDropInteractionState.takeDragCancelSetDownBlock()) {
</span><span class="cx">             page->callAfterNextPresentationUpdate([completion] (WebKit::CallbackBase::Error) {
</span><span class="lines">@@ -7785,7 +7785,7 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Support multiple simultaneous drop sessions in the future.
</span><span class="cx">     id <UIDragDropSession> dragOrDropSession = self.currentDragOrDropSession;
</span><del>-    RELEASE_LOG(DragAndDrop, "Can handle drag session: %p with local session: %p existing session: %p?", session, session.localDragSession, dragOrDropSession);
</del><ins>+    NSLog(@"Can handle drag session: %p with local session: %p existing session: %p?", session, session.localDragSession, dragOrDropSession);
</ins><span class="cx"> 
</span><span class="cx">     return !dragOrDropSession || session.localDragSession == dragOrDropSession;
</span><span class="cx"> }
</span><span class="lines">@@ -7792,7 +7792,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)dropInteraction:(UIDropInteraction *)interaction sessionDidEnter:(id <UIDropSession>)session
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Drop session entered: %p with %tu items", session, session.items.count);
</del><ins>+    NSLog(@"Drop session entered: %p with %tu items", session, session.items.count);
</ins><span class="cx">     auto dragData = [self dragDataForDropSession:session dragDestinationAction:[self _dragDestinationActionForDropSession:session]];
</span><span class="cx"> 
</span><span class="cx">     _dragDropInteractionState.dropSessionDidEnterOrUpdate(session, dragData);
</span><span class="lines">@@ -7829,13 +7829,12 @@
</span><span class="cx">     if ([delegate respondsToSelector:@selector(_webView:willUpdateDropProposalToProposal:forSession:)])
</span><span class="cx">         proposal = [delegate _webView:self.webView willUpdateDropProposalToProposal:proposal.get() forSession:session];
</span><span class="cx"> 
</span><del>-    NSLog(@"%s => %lu", __PRETTY_FUNCTION__, [proposal operation]);
</del><span class="cx">     return proposal.autorelease();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)dropInteraction:(UIDropInteraction *)interaction sessionDidExit:(id <UIDropSession>)session
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Drop session exited: %p with %tu items", session, session.items.count);
</del><ins>+    NSLog(@"Drop session exited: %p with %tu items", session, session.items.count);
</ins><span class="cx">     [[WebItemProviderPasteboard sharedInstance] setItemProviders:extractItemProvidersFromDropSession(session)];
</span><span class="cx"> 
</span><span class="cx">     auto dragData = [self dragDataForDropSession:session dragDestinationAction:WKDragDestinationActionAny];
</span><span class="lines">@@ -7867,7 +7866,7 @@
</span><span class="cx">     auto dragData = [self dragDataForDropSession:session dragDestinationAction:WKDragDestinationActionAny];
</span><span class="cx">     BOOL shouldSnapshotView = ![self _handleDropByInsertingImagePlaceholders:itemProviders session:session];
</span><span class="cx"> 
</span><del>-    RELEASE_LOG(DragAndDrop, "Loading data from %tu item providers for session: %p", itemProviders.count, session);
</del><ins>+    NSLog(@"Loading data from %tu item providers for session: %p", itemProviders.count, session);
</ins><span class="cx">     // Always loading content from the item provider ensures that the web process will be allowed to call back in to the UI
</span><span class="cx">     // process to access pasteboard contents at a later time. Ideally, we only need to do this work if we're over a file input
</span><span class="cx">     // or the page prevented default on `dragover`, but without this, dropping into a normal editable areas will fail due to
</span><span class="lines">@@ -7874,7 +7873,7 @@
</span><span class="cx">     // item providers not loading any data.
</span><span class="cx">     RetainPtr<WKContentView> retainedSelf(self);
</span><span class="cx">     [[WebItemProviderPasteboard sharedInstance] doAfterLoadingProvidedContentIntoFileURLs:[retainedSelf, capturedDragData = WTFMove(dragData), shouldSnapshotView] (NSArray *fileURLs) mutable {
</span><del>-        RELEASE_LOG(DragAndDrop, "Loaded data into %tu files", fileURLs.count);
</del><ins>+        NSLog(@"Loaded data into %tu files", fileURLs.count);
</ins><span class="cx">         Vector<String> filenames;
</span><span class="cx">         for (NSURL *fileURL in fileURLs)
</span><span class="cx">             filenames.append([fileURL path]);
</span><span class="lines">@@ -7936,7 +7935,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)dropInteraction:(UIDropInteraction *)interaction sessionDidEnd:(id <UIDropSession>)session
</span><span class="cx"> {
</span><del>-    RELEASE_LOG(DragAndDrop, "Drop session ended: %p (performing operation: %d, began dragging: %d)", session, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
</del><ins>+    NSLog(@"Drop session ended: %p (performing operation: %d, began dragging: %d)", session, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
</ins><span class="cx">     if (_dragDropInteractionState.isPerformingDrop()) {
</span><span class="cx">         // In the case where we are performing a drop, wait until after the drop is handled in the web process to reset drag and drop interaction state.
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (259517 => 259518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2020-04-03 22:14:18 UTC (rev 259517)
+++ trunk/Tools/ChangeLog       2020-04-03 22:45:16 UTC (rev 259518)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Add more logging to help diagnose <webkit.org/b/209685>
+        https://bugs.webkit.org/show_bug.cgi?id=209988
+
+        Reviewed by Timothy Hatcher.
+
+        * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
+
+        Fix a few stray style mistakes (unnecessary `.get()`s).
+
+        * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
+        (-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]):
+        (-[DragAndDropSimulator _advanceProgress]):
+
</ins><span class="cx"> 2020-04-03  Truitt Savell  <tsavell@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, reverting r259440.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsiosDragAndDropTestsIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm (259517 => 259518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm       2020-04-03 22:14:18 UTC (rev 259517)
+++ trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm  2020-04-03 22:45:16 UTC (rev 259518)
</span><span class="lines">@@ -1972,7 +1972,7 @@
</span><span class="cx">     [webView stringByEvaluatingJavaScript:@"writeCustomData = true"];
</span><span class="cx"> 
</span><span class="cx">     __block bool done = false;
</span><del>-    [simulator.get() setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
</del><ins>+    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
</ins><span class="cx">     {
</span><span class="cx">         EXPECT_EQ(1UL, session.items.count);
</span><span class="cx">         auto *item = session.items[0].itemProvider;
</span><span class="lines">@@ -2009,7 +2009,7 @@
</span><span class="cx">     [webView stringByEvaluatingJavaScript:@"writeCustomData = true"];
</span><span class="cx"> 
</span><span class="cx">     __block bool done = false;
</span><del>-    [simulator.get() setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
</del><ins>+    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
</ins><span class="cx">     {
</span><span class="cx">         EXPECT_EQ(1UL, session.items.count);
</span><span class="cx">         auto *item = session.items[0].itemProvider;
</span><span class="lines">@@ -2070,7 +2070,7 @@
</span><span class="cx">     [webView stringByEvaluatingJavaScript:@"writeCustomData = true"];
</span><span class="cx"> 
</span><span class="cx">     __block bool done = false;
</span><del>-    [simulator.get() setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
</del><ins>+    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
</ins><span class="cx">     {
</span><span class="cx">         EXPECT_EQ(1UL, session.items.count);
</span><span class="cx">         auto *item = session.items[0].itemProvider;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIiosDragAndDropSimulatorIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm (259517 => 259518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm 2020-04-03 22:14:18 UTC (rev 259517)
+++ trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm    2020-04-03 22:45:16 UTC (rev 259518)
</span><span class="lines">@@ -455,7 +455,9 @@
</span><span class="cx">     } else {
</span><span class="cx">         _dragSession = adoptNS([[MockDragSession alloc] initWithWindow:[_webView window] allowMove:self.shouldAllowMoveOperation]);
</span><span class="cx">         [_dragSession setMockLocationInWindow:_startLocation];
</span><ins>+        NSLog(@"%s - preparing for drag session", __PRETTY_FUNCTION__);
</ins><span class="cx">         [(id <UIDragInteractionDelegate_ForWebKitOnly>)[_webView dragInteractionDelegate] _dragInteraction:[_webView dragInteraction] prepareForSession:_dragSession.get() completion:[strongSelf = retainPtr(self)] {
</span><ins>+            NSLog(@"%s - done preparing for drag session with phase: %ld", __PRETTY_FUNCTION__, strongSelf->_phase);
</ins><span class="cx">             if (strongSelf->_phase == DragAndDropPhaseCancelled)
</span><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="lines">@@ -602,6 +604,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    NSLog(@"%s - phase: %ld", __PRETTY_FUNCTION__, _phase);
</ins><span class="cx">     switch (_phase) {
</span><span class="cx">     case DragAndDropPhaseBeginning: {
</span><span class="cx">         NSMutableArray<NSItemProvider *> *itemProviders = [NSMutableArray array];
</span></span></pre>
</div>
</div>

</body>
</html>