Changeset 259518 in webkit


Ignore:
Timestamp:
Apr 3, 2020 3:45:16 PM (4 years ago)
Author:
Wenson Hsieh
Message:

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 r259465.

  • platform/ios/WebItemProviderPasteboard.mm:

(-[WebItemProviderPasteboard updateSupportedTypeIdentifiers:]):

Source/WebKit:

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_LOGs in WKContentView into NSLogs, 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]):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r259513 r259518  
     12020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Add more logging to help diagnose <webkit.org/b/209685>
     4        https://bugs.webkit.org/show_bug.cgi?id=209988
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Remove logging that was previously added in r259465.
     9
     10        * platform/ios/WebItemProviderPasteboard.mm:
     11        (-[WebItemProviderPasteboard updateSupportedTypeIdentifiers:]):
     12
    1132020-04-02  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm

    r259465 r259518  
    493493- (void)updateSupportedTypeIdentifiers:(NSArray<NSString *> *)types
    494494{
    495     NSLog(@"%s => %@", __PRETTY_FUNCTION__, types);
    496495    _supportedTypeIdentifiers = types;
    497496}
  • trunk/Source/WebKit/ChangeLog

    r259517 r259518  
     12020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Add more logging to help diagnose <webkit.org/b/209685>
     4        https://bugs.webkit.org/show_bug.cgi?id=209988
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Replace logging that was previously added in r259465 with different logging. The fact that the prior logging
     9        never showed up in the failing tests suggests that the problem happens earlier than I had expected, so we need
     10        to ensure that codepaths for preparing and beginning a drag session are logged instead.
     11
     12        This turns several existing `RELEASE_LOG`s in WKContentView into `NSLog`s, so that they will show up in test
     13        failure output when run on the bots.
     14
     15        * UIProcess/ios/WKContentViewInteraction.mm:
     16        (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
     17        (-[WKContentView _didHandleDragStartRequest:]):
     18        (-[WKContentView cleanUpDragSourceSessionState]):
     19        (-[WKContentView _didPerformDragOperation:]):
     20        (-[WKContentView _prepareToDragPromisedAttachment:]):
     21        (-[WKContentView _dragInteraction:prepareForSession:completion:]):
     22        (-[WKContentView dragInteraction:itemsForBeginningSession:]):
     23        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
     24        (-[WKContentView dragInteraction:sessionWillBegin:]):
     25        (-[WKContentView dragInteraction:session:didEndWithOperation:]):
     26        (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
     27        (-[WKContentView dropInteraction:canHandleSession:]):
     28        (-[WKContentView dropInteraction:sessionDidEnter:]):
     29        (-[WKContentView dropInteraction:sessionDidUpdate:]):
     30        (-[WKContentView dropInteraction:sessionDidExit:]):
     31        (-[WKContentView dropInteraction:performDrop:]):
     32        (-[WKContentView dropInteraction:sessionDidEnd:]):
     33
    1342020-04-03  Chris Dumez  <cdumez@apple.com>
    235
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r259465 r259518  
    70667066    NSArray *dragItemsToAdd = [self _itemsForBeginningOrAddingToSessionWithRegistrationLists:registrationLists stagedDragSource:stagedDragSource];
    70677067
    7068     RELEASE_LOG(DragAndDrop, "Drag session: %p adding %tu items", _dragDropInteractionState.dragSession(), dragItemsToAdd.count);
     7068    NSLog(@"Drag session: %p adding %tu items", _dragDropInteractionState.dragSession(), dragItemsToAdd.count);
    70697069    _dragDropInteractionState.clearStagedDragSource(dragItemsToAdd.count ? WebKit::DragDropInteractionState::DidBecomeActive::Yes : WebKit::DragDropInteractionState::DidBecomeActive::No);
    70707070
     
    70807080    ASSERT(savedCompletionBlock);
    70817081
    7082     RELEASE_LOG(DragAndDrop, "Handling drag start request (started: %d, completion block: %p)", started, savedCompletionBlock.get());
     7082    NSLog(@"Handling drag start request (started: %d, completion block: %p)", started, savedCompletionBlock.get());
    70837083    if (savedCompletionBlock)
    70847084        savedCompletionBlock();
     
    71357135
    71367136    if (_dragDropInteractionState.dragSession() || _dragDropInteractionState.isPerformingDrop())
    7137         RELEASE_LOG(DragAndDrop, "Cleaning up dragging state (has pending operation: %d)", [[WebItemProviderPasteboard sharedInstance] hasPendingOperation]);
     7137        NSLog(@"Cleaning up dragging state (has pending operation: %d)", [[WebItemProviderPasteboard sharedInstance] hasPendingOperation]);
    71387138
    71397139    if (![[WebItemProviderPasteboard sharedInstance] hasPendingOperation]) {
     
    72197219- (void)_didPerformDragOperation:(BOOL)handled
    72207220{
    7221     RELEASE_LOG(DragAndDrop, "Finished performing drag controller operation (handled: %d)", handled);
     7221    NSLog(@"Finished performing drag controller operation (handled: %d)", handled);
    72227222    [[WebItemProviderPasteboard sharedInstance] decrementPendingOperationCount];
    72237223    id <UIDropSession> dropSession = _dragDropInteractionState.dropSession();
     
    72657265    ASSERT(numberOfAdditionalTypes == info.additionalData.size());
    72667266
    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());
     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());
    72687268
    72697269    NSString *utiType = info.contentType;
     
    72977297        auto attachment = strongSelf->_page->attachmentForIdentifier(info.attachmentIdentifier);
    72987298        if (attachment && attachment->fileWrapper()) {
    7299             RELEASE_LOG(DragAndDrop, "Drag session: %p delivering promised attachment: %s at path: %@", session.get(), info.attachmentIdentifier.utf8().data(), destinationURL.path);
     7299            NSLog(@"Drag session: %p delivering promised attachment: %s at path: %@", session.get(), info.attachmentIdentifier.utf8().data(), destinationURL.path);
    73007300            NSError *fileWrapperError = nil;
    73017301            if ([attachment->fileWrapper() writeToURL:destinationURL options:0 originalContentsURL:nil error:&fileWrapperError])
     
    76207620    [self _cancelLongPressGestureRecognizer];
    76217621
    7622     RELEASE_LOG(DragAndDrop, "Preparing for drag session: %p", session);
     7622    NSLog(@"Preparing for drag session: %p", session);
    76237623    if (self.currentDragOrDropSession) {
    76247624        // FIXME: Support multiple simultaneous drag sessions in the future.
    7625         RELEASE_LOG(DragAndDrop, "Drag session failed: %p (a current drag session already exists)", session);
     7625        NSLog(@"Drag session failed: %p (a current drag session already exists)", session);
    76267626        completion();
    76277627        return;
     
    76357635    _page->requestDragStart(dragOrigin, WebCore::roundedIntPoint([self convertPoint:dragOrigin toView:self.window]), self._allowedDragSourceActions);
    76367636
    7637     RELEASE_LOG(DragAndDrop, "Drag session requested: %p at origin: {%d, %d}", session, dragOrigin.x(), dragOrigin.y());
     7637    NSLog(@"Drag session requested: %p at origin: {%d, %d}", session, dragOrigin.x(), dragOrigin.y());
    76387638}
    76397639
     
    76417641{
    76427642    ASSERT(interaction == _dragInteraction);
    7643     RELEASE_LOG(DragAndDrop, "Drag items requested for session: %p", session);
     7643    NSLog(@"Drag items requested for session: %p", session);
    76447644    if (_dragDropInteractionState.dragSession() != session) {
    7645         RELEASE_LOG(DragAndDrop, "Drag session failed: %p (delegate session does not match %p)", session, _dragDropInteractionState.dragSession());
     7645        NSLog(@"Drag session failed: %p (delegate session does not match %p)", session, _dragDropInteractionState.dragSession());
    76467646        return @[ ];
    76477647    }
    76487648
    76497649    if (!_dragDropInteractionState.hasStagedDragSource()) {
    7650         RELEASE_LOG(DragAndDrop, "Drag session failed: %p (missing staged drag source)", session);
     7650        NSLog(@"Drag session failed: %p (missing staged drag source)", session);
    76517651        return @[ ];
    76527652    }
     
    76587658        _page->dragCancelled();
    76597659
    7660     RELEASE_LOG(DragAndDrop, "Drag session: %p starting with %tu items", session, [dragItems count]);
     7660    NSLog(@"Drag session: %p starting with %tu items", session, [dragItems count]);
    76617661    _dragDropInteractionState.clearStagedDragSource([dragItems count] ? WebKit::DragDropInteractionState::DidBecomeActive::Yes : WebKit::DragDropInteractionState::DidBecomeActive::No);
    76627662
     
    76777677- (void)dragInteraction:(UIDragInteraction *)interaction willAnimateLiftWithAnimator:(id <UIDragAnimating>)animator session:(id <UIDragSession>)session
    76787678{
    7679     RELEASE_LOG(DragAndDrop, "Drag session willAnimateLiftWithAnimator: %p", session);
     7679    NSLog(@"Drag session willAnimateLiftWithAnimator: %p", session);
    76807680    if (_dragDropInteractionState.anyActiveDragSourceIs(WebCore::DragSourceActionSelection)) {
    76817681        [self cancelActiveTextInteractionGestures];
     
    76947694#endif
    76957695        if (finalPosition == UIViewAnimatingPositionStart) {
    7696             RELEASE_LOG(DragAndDrop, "Drag session ended at start: %p", session);
     7696            NSLog(@"Drag session ended at start: %p", session);
    76977697            // The lift was canceled, so -dropInteraction:sessionDidEnd: will never be invoked. This is the last chance to clean up.
    76987698            [protectedSelf cleanUpDragSourceSessionState];
     
    77017701#if !RELEASE_LOG_DISABLED
    77027702        else
    7703             RELEASE_LOG(DragAndDrop, "Drag session did not end at start: %p", session);
     7703            NSLog(@"Drag session did not end at start: %p", session);
    77047704#endif
    77057705    }];
     
    77087708- (void)dragInteraction:(UIDragInteraction *)interaction sessionWillBegin:(id <UIDragSession>)session
    77097709{
    7710     RELEASE_LOG(DragAndDrop, "Drag session beginning: %p", session);
     7710    NSLog(@"Drag session beginning: %p", session);
    77117711    id <WKUIDelegatePrivate> uiDelegate = self.webViewUIDelegate;
    77127712    if ([uiDelegate respondsToSelector:@selector(_webView:dataInteraction:sessionWillBegin:)])
     
    77207720- (void)dragInteraction:(UIDragInteraction *)interaction session:(id <UIDragSession>)session didEndWithOperation:(UIDropOperation)operation
    77217721{
    7722     RELEASE_LOG(DragAndDrop, "Drag session ended: %p (with operation: %tu, performing operation: %d, began dragging: %d)", session, operation, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
     7722    NSLog(@"Drag session ended: %p (with operation: %tu, performing operation: %d, began dragging: %d)", session, operation, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
    77237723
    77247724    [self _restoreCalloutBarIfNeeded];
     
    77547754- (void)dragInteraction:(UIDragInteraction *)interaction item:(UIDragItem *)item willAnimateCancelWithAnimator:(id <UIDragAnimating>)animator
    77557755{
    7756     RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator");
     7756    NSLog(@"Drag interaction willAnimateCancelWithAnimator");
    77577757    [animator addCompletion:[protectedSelf = retainPtr(self), page = _page] (UIViewAnimatingPosition finalPosition) {
    7758         RELEASE_LOG(DragAndDrop, "Drag interaction willAnimateCancelWithAnimator (animation completion block fired)");
     7758        NSLog(@"Drag interaction willAnimateCancelWithAnimator (animation completion block fired)");
    77597759        page->dragCancelled();
    77607760        if (auto completion = protectedSelf->_dragDropInteractionState.takeDragCancelSetDownBlock()) {
     
    77867786    // FIXME: Support multiple simultaneous drop sessions in the future.
    77877787    id <UIDragDropSession> dragOrDropSession = self.currentDragOrDropSession;
    7788     RELEASE_LOG(DragAndDrop, "Can handle drag session: %p with local session: %p existing session: %p?", session, session.localDragSession, dragOrDropSession);
     7788    NSLog(@"Can handle drag session: %p with local session: %p existing session: %p?", session, session.localDragSession, dragOrDropSession);
    77897789
    77907790    return !dragOrDropSession || session.localDragSession == dragOrDropSession;
     
    77937793- (void)dropInteraction:(UIDropInteraction *)interaction sessionDidEnter:(id <UIDropSession>)session
    77947794{
    7795     RELEASE_LOG(DragAndDrop, "Drop session entered: %p with %tu items", session, session.items.count);
     7795    NSLog(@"Drop session entered: %p with %tu items", session, session.items.count);
    77967796    auto dragData = [self dragDataForDropSession:session dragDestinationAction:[self _dragDestinationActionForDropSession:session]];
    77977797
     
    78307830        proposal = [delegate _webView:self.webView willUpdateDropProposalToProposal:proposal.get() forSession:session];
    78317831
    7832     NSLog(@"%s => %lu", __PRETTY_FUNCTION__, [proposal operation]);
    78337832    return proposal.autorelease();
    78347833}
     
    78367835- (void)dropInteraction:(UIDropInteraction *)interaction sessionDidExit:(id <UIDropSession>)session
    78377836{
    7838     RELEASE_LOG(DragAndDrop, "Drop session exited: %p with %tu items", session, session.items.count);
     7837    NSLog(@"Drop session exited: %p with %tu items", session, session.items.count);
    78397838    [[WebItemProviderPasteboard sharedInstance] setItemProviders:extractItemProvidersFromDropSession(session)];
    78407839
     
    78687867    BOOL shouldSnapshotView = ![self _handleDropByInsertingImagePlaceholders:itemProviders session:session];
    78697868
    7870     RELEASE_LOG(DragAndDrop, "Loading data from %tu item providers for session: %p", itemProviders.count, session);
     7869    NSLog(@"Loading data from %tu item providers for session: %p", itemProviders.count, session);
    78717870    // Always loading content from the item provider ensures that the web process will be allowed to call back in to the UI
    78727871    // process to access pasteboard contents at a later time. Ideally, we only need to do this work if we're over a file input
     
    78757874    RetainPtr<WKContentView> retainedSelf(self);
    78767875    [[WebItemProviderPasteboard sharedInstance] doAfterLoadingProvidedContentIntoFileURLs:[retainedSelf, capturedDragData = WTFMove(dragData), shouldSnapshotView] (NSArray *fileURLs) mutable {
    7877         RELEASE_LOG(DragAndDrop, "Loaded data into %tu files", fileURLs.count);
     7876        NSLog(@"Loaded data into %tu files", fileURLs.count);
    78787877        Vector<String> filenames;
    78797878        for (NSURL *fileURL in fileURLs)
     
    79377936- (void)dropInteraction:(UIDropInteraction *)interaction sessionDidEnd:(id <UIDropSession>)session
    79387937{
    7939     RELEASE_LOG(DragAndDrop, "Drop session ended: %p (performing operation: %d, began dragging: %d)", session, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
     7938    NSLog(@"Drop session ended: %p (performing operation: %d, began dragging: %d)", session, _dragDropInteractionState.isPerformingDrop(), _dragDropInteractionState.didBeginDragging());
    79407939    if (_dragDropInteractionState.isPerformingDrop()) {
    79417940        // 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

    r259516 r259518  
     12020-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Add more logging to help diagnose <webkit.org/b/209685>
     4        https://bugs.webkit.org/show_bug.cgi?id=209988
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
     9
     10        Fix a few stray style mistakes (unnecessary `.get()`s).
     11
     12        * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
     13        (-[DragAndDropSimulator runFrom:to:additionalItemRequestLocations:]):
     14        (-[DragAndDropSimulator _advanceProgress]):
     15
    1162020-04-03  Truitt Savell  <tsavell@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm

    r251941 r259518  
    19731973
    19741974    __block bool done = false;
    1975     [simulator.get() setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
     1975    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
    19761976    {
    19771977        EXPECT_EQ(1UL, session.items.count);
     
    20102010
    20112011    __block bool done = false;
    2012     [simulator.get() setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
     2012    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
    20132013    {
    20142014        EXPECT_EQ(1UL, session.items.count);
     
    20712071
    20722072    __block bool done = false;
    2073     [simulator.get() setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
     2073    [simulator setOverridePerformDropBlock:^NSArray<UIDragItem *> *(id <UIDropSession> session)
    20742074    {
    20752075        EXPECT_EQ(1UL, session.items.count);
  • trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm

    r258659 r259518  
    456456        _dragSession = adoptNS([[MockDragSession alloc] initWithWindow:[_webView window] allowMove:self.shouldAllowMoveOperation]);
    457457        [_dragSession setMockLocationInWindow:_startLocation];
     458        NSLog(@"%s - preparing for drag session", __PRETTY_FUNCTION__);
    458459        [(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);
    459461            if (strongSelf->_phase == DragAndDropPhaseCancelled)
    460462                return;
     
    603605    }
    604606
     607    NSLog(@"%s - phase: %ld", __PRETTY_FUNCTION__, _phase);
    605608    switch (_phase) {
    606609    case DragAndDropPhaseBeginning: {
Note: See TracChangeset for help on using the changeset viewer.