Changeset 259534 in webkit
- Timestamp:
- Apr 4, 2020 11:52:15 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r259533 r259534 1 2020-04-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add even more logging to try and diagnose <webkit.org/b/209685> 4 https://bugs.webkit.org/show_bug.cgi?id=210008 5 6 Reviewed by Tim Horton. 7 8 * platform/ios/WebItemProviderPasteboard.mm: 9 (-[WebItemProviderPasteboard stageRegistrationLists:]): 10 1 11 2020-04-04 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm
r259518 r259534 857 857 { 858 858 ASSERT(lists.count); 859 NSLog(@"%s - %@", __PRETTY_FUNCTION__, lists); 859 860 _stagedRegistrationInfoLists = lists; 860 861 } -
trunk/Source/WebKit/ChangeLog
r259528 r259534 1 2020-04-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add even more logging to try and diagnose <webkit.org/b/209685> 4 https://bugs.webkit.org/show_bug.cgi?id=210008 5 6 Reviewed by Tim Horton. 7 8 Revert all (except one) of the logging statements added in r259518, and add several new ones. This last logging 9 pass demonstrated that DragController had failed to start a drag, since -[WKContentView _didHandleDragStartRequest:] 10 receives word that the drag has started, yet there are no staged drag items. 11 12 * UIProcess/ios/DragDropInteractionState.mm: 13 (WebKit::DragDropInteractionState::stageDragItem): 14 (WebKit::DragDropInteractionState::clearStagedDragSource): 15 * UIProcess/ios/WKContentViewInteraction.mm: 16 (-[WKContentView _didHandleAdditionalDragItemsRequest:]): 17 (-[WKContentView cleanUpDragSourceSessionState]): 18 (-[WKContentView _didPerformDragOperation:]): 19 (-[WKContentView _prepareToDragPromisedAttachment:]): 20 (-[WKContentView _dragInteraction:prepareForSession:completion:]): 21 (-[WKContentView dragInteraction:itemsForBeginningSession:]): 22 (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): 23 (-[WKContentView dragInteraction:sessionWillBegin:]): 24 (-[WKContentView dragInteraction:session:didEndWithOperation:]): 25 (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]): 26 (-[WKContentView dropInteraction:canHandleSession:]): 27 (-[WKContentView dropInteraction:sessionDidEnter:]): 28 (-[WKContentView dropInteraction:sessionDidExit:]): 29 (-[WKContentView dropInteraction:performDrop:]): 30 (-[WKContentView dropInteraction:sessionDidEnd:]): 31 1 32 2020-04-03 David Kilzer <ddkilzer@apple.com> 2 33 -
trunk/Source/WebKit/UIProcess/ios/DragDropInteractionState.mm
r250256 r259534 340 340 void DragDropInteractionState::stageDragItem(const DragItem& item, UIImage *dragImage) 341 341 { 342 NSLog(@"%s - source action := %02x", __PRETTY_FUNCTION__, item.sourceAction); 342 343 static NSInteger currentDragSourceItemIdentifier = 0; 343 344 … … 364 365 void DragDropInteractionState::clearStagedDragSource(DidBecomeActive didBecomeActive) 365 366 { 367 if (m_stagedDragSource) 368 NSLog(@"%s - source action := %02x", __PRETTY_FUNCTION__, m_stagedDragSource->action); 369 366 370 if (didBecomeActive == DidBecomeActive::Yes) 367 371 m_activeDragSources.append(stagedDragSource()); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r259518 r259534 7066 7066 NSArray *dragItemsToAdd = [self _itemsForBeginningOrAddingToSessionWithRegistrationLists:registrationLists stagedDragSource:stagedDragSource]; 7067 7067 7068 NSLog(@"Drag session: %p adding %tu items", _dragDropInteractionState.dragSession(), dragItemsToAdd.count);7068 RELEASE_LOG(DragAndDrop, "Drag session: %p adding %tu items", _dragDropInteractionState.dragSession(), dragItemsToAdd.count); 7069 7069 _dragDropInteractionState.clearStagedDragSource(dragItemsToAdd.count ? WebKit::DragDropInteractionState::DidBecomeActive::Yes : WebKit::DragDropInteractionState::DidBecomeActive::No); 7070 7070 … … 7135 7135 7136 7136 if (_dragDropInteractionState.dragSession() || _dragDropInteractionState.isPerformingDrop()) 7137 NSLog(@"Cleaning up dragging state (has pending operation: %d)", [[WebItemProviderPasteboard sharedInstance] hasPendingOperation]);7137 RELEASE_LOG(DragAndDrop, "Cleaning up dragging state (has pending operation: %d)", [[WebItemProviderPasteboard sharedInstance] hasPendingOperation]); 7138 7138 7139 7139 if (![[WebItemProviderPasteboard sharedInstance] hasPendingOperation]) { … … 7219 7219 - (void)_didPerformDragOperation:(BOOL)handled 7220 7220 { 7221 NSLog(@"Finished performing drag controller operation (handled: %d)", handled);7221 RELEASE_LOG(DragAndDrop, "Finished performing drag controller operation (handled: %d)", handled); 7222 7222 [[WebItemProviderPasteboard sharedInstance] decrementPendingOperationCount]; 7223 7223 id <UIDropSession> dropSession = _dragDropInteractionState.dropSession(); … … 7265 7265 ASSERT(numberOfAdditionalTypes == info.additionalData.size()); 7266 7266 7267 NSLog(@"Drag session: %p preparing to drag blob: %s with attachment identifier: %s", session.get(), info.blobURL.string().utf8().data(), info.attachmentIdentifier.utf8().data());7267 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()); 7268 7268 7269 7269 NSString *utiType = info.contentType; … … 7297 7297 auto attachment = strongSelf->_page->attachmentForIdentifier(info.attachmentIdentifier); 7298 7298 if (attachment && attachment->fileWrapper()) { 7299 NSLog(@"Drag session: %p delivering promised attachment: %s at path: %@", session.get(), info.attachmentIdentifier.utf8().data(), destinationURL.path);7299 RELEASE_LOG(DragAndDrop, "Drag session: %p delivering promised attachment: %s at path: %@", session.get(), info.attachmentIdentifier.utf8().data(), destinationURL.path); 7300 7300 NSError *fileWrapperError = nil; 7301 7301 if ([attachment->fileWrapper() writeToURL:destinationURL options:0 originalContentsURL:nil error:&fileWrapperError]) … … 7620 7620 [self _cancelLongPressGestureRecognizer]; 7621 7621 7622 NSLog(@"Preparing for drag session: %p", session);7622 RELEASE_LOG(DragAndDrop, "Preparing for drag session: %p", session); 7623 7623 if (self.currentDragOrDropSession) { 7624 7624 // FIXME: Support multiple simultaneous drag sessions in the future. 7625 NSLog(@"Drag session failed: %p (a current drag session already exists)", session);7625 RELEASE_LOG(DragAndDrop, "Drag session failed: %p (a current drag session already exists)", session); 7626 7626 completion(); 7627 7627 return; … … 7635 7635 _page->requestDragStart(dragOrigin, WebCore::roundedIntPoint([self convertPoint:dragOrigin toView:self.window]), self._allowedDragSourceActions); 7636 7636 7637 NSLog(@"Drag session requested: %p at origin: {%d, %d}", session, dragOrigin.x(), dragOrigin.y());7637 RELEASE_LOG(DragAndDrop, "Drag session requested: %p at origin: {%d, %d}", session, dragOrigin.x(), dragOrigin.y()); 7638 7638 } 7639 7639 … … 7641 7641 { 7642 7642 ASSERT(interaction == _dragInteraction); 7643 NSLog(@"Drag items requested for session: %p", session);7643 RELEASE_LOG(DragAndDrop, "Drag items requested for session: %p", session); 7644 7644 if (_dragDropInteractionState.dragSession() != session) { 7645 NSLog(@"Drag session failed: %p (delegate session does not match %p)", session, _dragDropInteractionState.dragSession());7645 RELEASE_LOG(DragAndDrop, "Drag session failed: %p (delegate session does not match %p)", session, _dragDropInteractionState.dragSession()); 7646 7646 return @[ ]; 7647 7647 } 7648 7648 7649 7649 if (!_dragDropInteractionState.hasStagedDragSource()) { 7650 NSLog(@"Drag session failed: %p (missing staged drag source)", session);7650 RELEASE_LOG(DragAndDrop, "Drag session failed: %p (missing staged drag source)", session); 7651 7651 return @[ ]; 7652 7652 } … … 7658 7658 _page->dragCancelled(); 7659 7659 7660 NSLog(@"Drag session: %p starting with %tu items", session, [dragItems count]);7660 RELEASE_LOG(DragAndDrop, "Drag session: %p starting with %tu items", session, [dragItems count]); 7661 7661 _dragDropInteractionState.clearStagedDragSource([dragItems count] ? WebKit::DragDropInteractionState::DidBecomeActive::Yes : WebKit::DragDropInteractionState::DidBecomeActive::No); 7662 7662 … … 7677 7677 - (void)dragInteraction:(UIDragInteraction *)interaction willAnimateLiftWithAnimator:(id <UIDragAnimating>)animator session:(id <UIDragSession>)session 7678 7678 { 7679 NSLog(@"Drag session willAnimateLiftWithAnimator: %p", session);7679 RELEASE_LOG(DragAndDrop, "Drag session willAnimateLiftWithAnimator: %p", session); 7680 7680 if (_dragDropInteractionState.anyActiveDragSourceIs(WebCore::DragSourceActionSelection)) { 7681 7681 [self cancelActiveTextInteractionGestures]; … … 7694 7694 #endif 7695 7695 if (finalPosition == UIViewAnimatingPositionStart) { 7696 NSLog(@"Drag session ended at start: %p", session);7696 RELEASE_LOG(DragAndDrop, "Drag session ended at start: %p", session); 7697 7697 // The lift was canceled, so -dropInteraction:sessionDidEnd: will never be invoked. This is the last chance to clean up. 7698 7698 [protectedSelf cleanUpDragSourceSessionState]; … … 7701 7701 #if !RELEASE_LOG_DISABLED 7702 7702 else 7703 NSLog(@"Drag session did not end at start: %p", session);7703 RELEASE_LOG(DragAndDrop, "Drag session did not end at start: %p", session); 7704 7704 #endif 7705 7705 }]; … … 7708 7708 - (void)dragInteraction:(UIDragInteraction *)interaction sessionWillBegin:(id <UIDragSession>)session 7709 7709 { 7710 NSLog(@"Drag session beginning: %p", session);7710 RELEASE_LOG(DragAndDrop, "Drag session beginning: %p", session); 7711 7711 id <WKUIDelegatePrivate> uiDelegate = self.webViewUIDelegate; 7712 7712 if ([uiDelegate respondsToSelector:@selector(_webView:dataInteraction:sessionWillBegin:)]) … … 7720 7720 - (void)dragInteraction:(UIDragInteraction *)interaction session:(id <UIDragSession>)session didEndWithOperation:(UIDropOperation)operation 7721 7721 { 7722 NSLog(@"Drag session ended: %p (with operation: %tu, performing operation: %d, began dragging: %d)", session, operation, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());7722 RELEASE_LOG(DragAndDrop, "Drag session ended: %p (with operation: %tu, performing operation: %d, began dragging: %d)", session, operation, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging()); 7723 7723 7724 7724 [self _restoreCalloutBarIfNeeded]; … … 7754 7754 - (void)dragInteraction:(UIDragInteraction *)interaction item:(UIDragItem *)item willAnimateCancelWithAnimator:(id <UIDragAnimating>)animator 7755 7755 { 7756 NSLog(@"Drag interaction willAnimateCancelWithAnimator");7756 RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator"); 7757 7757 [animator addCompletion:[protectedSelf = retainPtr(self), page = _page] (UIViewAnimatingPosition finalPosition) { 7758 NSLog(@"Drag interaction willAnimateCancelWithAnimator (animation completion block fired)");7758 RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator (animation completion block fired)"); 7759 7759 page->dragCancelled(); 7760 7760 if (auto completion = protectedSelf->_dragDropInteractionState.takeDragCancelSetDownBlock()) { … … 7786 7786 // FIXME: Support multiple simultaneous drop sessions in the future. 7787 7787 id <UIDragDropSession> dragOrDropSession = self.currentDragOrDropSession; 7788 NSLog(@"Can handle drag session: %p with local session: %p existing session: %p?", session, session.localDragSession, dragOrDropSession);7788 RELEASE_LOG(DragAndDrop, "Can handle drag session: %p with local session: %p existing session: %p?", session, session.localDragSession, dragOrDropSession); 7789 7789 7790 7790 return !dragOrDropSession || session.localDragSession == dragOrDropSession; … … 7793 7793 - (void)dropInteraction:(UIDropInteraction *)interaction sessionDidEnter:(id <UIDropSession>)session 7794 7794 { 7795 NSLog(@"Drop session entered: %p with %tu items", session, session.items.count);7795 RELEASE_LOG(DragAndDrop, "Drop session entered: %p with %tu items", session, session.items.count); 7796 7796 auto dragData = [self dragDataForDropSession:session dragDestinationAction:[self _dragDestinationActionForDropSession:session]]; 7797 7797 … … 7835 7835 - (void)dropInteraction:(UIDropInteraction *)interaction sessionDidExit:(id <UIDropSession>)session 7836 7836 { 7837 NSLog(@"Drop session exited: %p with %tu items", session, session.items.count);7837 RELEASE_LOG(DragAndDrop, "Drop session exited: %p with %tu items", session, session.items.count); 7838 7838 [[WebItemProviderPasteboard sharedInstance] setItemProviders:extractItemProvidersFromDropSession(session)]; 7839 7839 … … 7867 7867 BOOL shouldSnapshotView = ![self _handleDropByInsertingImagePlaceholders:itemProviders session:session]; 7868 7868 7869 NSLog(@"Loading data from %tu item providers for session: %p", itemProviders.count, session);7869 RELEASE_LOG(DragAndDrop, "Loading data from %tu item providers for session: %p", itemProviders.count, session); 7870 7870 // Always loading content from the item provider ensures that the web process will be allowed to call back in to the UI 7871 7871 // process to access pasteboard contents at a later time. Ideally, we only need to do this work if we're over a file input … … 7874 7874 RetainPtr<WKContentView> retainedSelf(self); 7875 7875 [[WebItemProviderPasteboard sharedInstance] doAfterLoadingProvidedContentIntoFileURLs:[retainedSelf, capturedDragData = WTFMove(dragData), shouldSnapshotView] (NSArray *fileURLs) mutable { 7876 NSLog(@"Loaded data into %tu files", fileURLs.count);7876 RELEASE_LOG(DragAndDrop, "Loaded data into %tu files", fileURLs.count); 7877 7877 Vector<String> filenames; 7878 7878 for (NSURL *fileURL in fileURLs) … … 7936 7936 - (void)dropInteraction:(UIDropInteraction *)interaction sessionDidEnd:(id <UIDropSession>)session 7937 7937 { 7938 NSLog(@"Drop session ended: %p (performing operation: %d, began dragging: %d)", session, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());7938 RELEASE_LOG(DragAndDrop, "Drop session ended: %p (performing operation: %d, began dragging: %d)", session, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging()); 7939 7939 if (_dragDropInteractionState.isPerformingDrop()) { 7940 7940 // 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. -
trunk/Tools/ChangeLog
r259531 r259534 1 2020-04-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add even more logging to try and diagnose <webkit.org/b/209685> 4 https://bugs.webkit.org/show_bug.cgi?id=210008 5 6 Reviewed by Tim Horton. 7 8 Replace old logging with new logging (in different places). 9 10 * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm: 11 (-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]): 12 (-[DragAndDropSimulator _advanceProgress]): 13 (-[DragAndDropSimulator _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:]): 14 15 Rule out the possibility that the WebKit client (in this case, the drag and drop simulator) is overriding the 16 list of drag items by logging the given NSItemProvider that will be used to start the drag. 17 1 18 2020-04-04 Peng Liu <peng.liu6@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm
r259518 r259534 456 456 _dragSession = adoptNS([[MockDragSession alloc] initWithWindow:[_webView window] allowMove:self.shouldAllowMoveOperation]); 457 457 [_dragSession setMockLocationInWindow:_startLocation]; 458 NSLog(@"%s - preparing for drag session", __PRETTY_FUNCTION__);459 458 [(id <UIDragInteractionDelegate_ForWebKitOnly>)[_webView dragInteractionDelegate] _dragInteraction:[_webView dragInteraction] prepareForSession:_dragSession.get() completion:[strongSelf = retainPtr(self)] { 460 NSLog(@"%s - done preparing for drag session with phase: %ld", __PRETTY_FUNCTION__, strongSelf->_phase);461 459 if (strongSelf->_phase == DragAndDropPhaseCancelled) 462 460 return; … … 605 603 } 606 604 607 NSLog(@"%s - phase: %ld", __PRETTY_FUNCTION__, _phase);608 605 switch (_phase) { 609 606 case DragAndDropPhaseBeginning: { … … 611 608 NSArray *items = [[_webView dragInteractionDelegate] dragInteraction:[_webView dragInteraction] itemsForBeginningSession:_dragSession.get()]; 612 609 if (!items.count) { 610 NSLog(@"%s (found no drag items when beginning session)", __PRETTY_FUNCTION__); 613 611 _phase = DragAndDropPhaseCancelled; 614 612 _currentProgress = 1; … … 901 899 - (NSArray *)_webView:(WKWebView *)webView adjustedDataInteractionItemProvidersForItemProvider:(NSItemProvider *)itemProvider representingObjects:(NSArray *)representingObjects additionalData:(NSDictionary *)additionalData 902 900 { 901 NSLog(@"%s - self.convertItemProvidersBlock := %p; itemProvider.registeredTypeIdentifiers := %@", __PRETTY_FUNCTION__, self.convertItemProvidersBlock, itemProvider.registeredTypeIdentifiers); 903 902 return self.convertItemProvidersBlock ? self.convertItemProvidersBlock(itemProvider, representingObjects, additionalData) : @[ itemProvider ]; 904 903 }
Note: See TracChangeset
for help on using the changeset viewer.