Title: [244407] trunk
Revision
244407
Author
[email protected]
Date
2019-04-17 16:06:17 -0700 (Wed, 17 Apr 2019)

Log Message

Unreviewed, rolling out r244400.

Caused testing to exit early with assertionon Debug WK2

Reverted changeset:

"UI↔Web deadlock when printing with a _javascript_ alert
visible"
https://bugs.webkit.org/show_bug.cgi?id=196839
https://trac.webkit.org/changeset/244400

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (244406 => 244407)


--- trunk/Source/WebKit/ChangeLog	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Source/WebKit/ChangeLog	2019-04-17 23:06:17 UTC (rev 244407)
@@ -1,3 +1,16 @@
+2019-04-17  Truitt Savell  <[email protected]>
+
+        Unreviewed, rolling out r244400.
+
+        Caused testing to exit early with assertionon Debug WK2
+
+        Reverted changeset:
+
+        "UI↔Web deadlock when printing with a _javascript_ alert
+        visible"
+        https://bugs.webkit.org/show_bug.cgi?id=196839
+        https://trac.webkit.org/changeset/244400
+
 2019-04-17  Brady Eidson  <[email protected]>
 
         Link clicks in PDFs shouldn't send referrer headers.

Modified: trunk/Source/WebKit/Platform/IPC/Connection.cpp (244406 => 244407)


--- trunk/Source/WebKit/Platform/IPC/Connection.cpp	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Source/WebKit/Platform/IPC/Connection.cpp	2019-04-17 23:06:17 UTC (rev 244407)
@@ -341,8 +341,6 @@
         return;
     }
 
-    m_outstandingOutgoingSynchronousReplyCount++;
-
     auto replyEncoder = std::make_unique<Encoder>("IPC", "SyncMessageReply", syncRequestID);
 
     // Hand off both the decoder and encoder to the work queue message receiver.
@@ -460,9 +458,6 @@
 
 bool Connection::sendSyncReply(std::unique_ptr<Encoder> encoder)
 {
-    ASSERT(m_outstandingOutgoingSynchronousReplyCount);
-    m_outstandingOutgoingSynchronousReplyCount--;
-
     return sendMessage(WTFMove(encoder), { });
 }
 
@@ -893,8 +888,6 @@
         return;
     }
 
-    m_outstandingOutgoingSynchronousReplyCount++;
-
     auto replyEncoder = std::make_unique<Encoder>("IPC", "SyncMessageReply", syncRequestID);
 
     if (decoder.messageReceiverName() == "IPC" && decoder.messageName() == "WrappedAsyncMessageForTesting") {

Modified: trunk/Source/WebKit/Platform/IPC/Connection.h (244406 => 244407)


--- trunk/Source/WebKit/Platform/IPC/Connection.h	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Source/WebKit/Platform/IPC/Connection.h	2019-04-17 23:06:17 UTC (rev 244407)
@@ -196,8 +196,6 @@
 
     bool inSendSync() const { return m_inSendSyncCount; }
 
-    bool hasOutstandingOutgoingSynchronousReplies() const { return m_outstandingOutgoingSynchronousReplyCount; }
-
     Identifier identifier() const;
 
 #if PLATFORM(COCOA)
@@ -299,7 +297,6 @@
     unsigned m_inDispatchMessageCount;
     unsigned m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount;
     unsigned m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting { 0 };
-    unsigned m_outstandingOutgoingSynchronousReplyCount { 0 };
     bool m_fullySynchronousModeIsAllowedForTesting { false };
     bool m_ignoreTimeoutsForTesting { false };
     bool m_didReceiveInvalidMessage;

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (244406 => 244407)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-04-17 23:06:17 UTC (rev 244407)
@@ -6323,9 +6323,6 @@
 - (_WKWebViewPrintFormatter *)_webViewPrintFormatter
 {
 #if !PLATFORM(IOSMAC)
-    if (_page->process().connection()->hasOutstandingOutgoingSynchronousReplies())
-        return nil;
-
     UIViewPrintFormatter *viewPrintFormatter = self.viewPrintFormatter;
     ASSERT([viewPrintFormatter isKindOfClass:[_WKWebViewPrintFormatter class]]);
     return (_WKWebViewPrintFormatter *)viewPrintFormatter;

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentView.mm (244406 => 244407)


--- trunk/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-04-17 23:06:17 UTC (rev 244407)
@@ -726,9 +726,6 @@
     if (_isPrintingToPDF)
         return 0;
 
-    if (_page->process().connection()->hasOutstandingOutgoingSynchronousReplies())
-        return 0;
-
     uint64_t frameID;
     if (_WKFrameHandle *handle = printFormatter.frameToPrint)
         frameID = handle._frameID;
@@ -772,9 +769,6 @@
 
 - (CGPDFDocumentRef)_wk_printedDocument
 {
-    if (_page->process().connection()->hasOutstandingOutgoingSynchronousReplies())
-        return nullptr;
-
     if (_isPrintingToPDF) {
         if (!_page->process().connection()->waitForAndDispatchImmediately<Messages::WebPageProxy::DrawToPDFCallback>(_page->pageID(), Seconds::infinity())) {
             ASSERT_NOT_REACHED();

Modified: trunk/Tools/ChangeLog (244406 => 244407)


--- trunk/Tools/ChangeLog	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Tools/ChangeLog	2019-04-17 23:06:17 UTC (rev 244407)
@@ -1,3 +1,16 @@
+2019-04-17  Truitt Savell  <[email protected]>
+
+        Unreviewed, rolling out r244400.
+
+        Caused testing to exit early with assertionon Debug WK2
+
+        Reverted changeset:
+
+        "UI↔Web deadlock when printing with a _javascript_ alert
+        visible"
+        https://bugs.webkit.org/show_bug.cgi?id=196839
+        https://trac.webkit.org/changeset/244400
+
 2019-04-17  Brady Eidson  <[email protected]>
 
         Link clicks in PDFs shouldn't send referrer headers.

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (244406 => 244407)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2019-04-17 23:06:17 UTC (rev 244407)
@@ -94,7 +94,6 @@
 		2D21FE591F04642900B58E7D /* WKPDFViewStablePresentationUpdateCallback.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D21FE581F04642800B58E7D /* WKPDFViewStablePresentationUpdateCallback.mm */; };
 		2D2BEB2D22324E5F005544CA /* RequestTextInputContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2BEB2C22324E5F005544CA /* RequestTextInputContext.mm */; };
 		2D3CA3A8221DF4B40088E803 /* PageOverlayPlugin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D3CA3A4221DF2390088E803 /* PageOverlayPlugin.mm */; };
-		2D41CFB92260014F00FFF335 /* WKWebViewPrintFormatter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D41CFB82260014E00FFF335 /* WKWebViewPrintFormatter.mm */; };
 		2D4CF8BD1D8360CC0001CE8D /* WKThumbnailView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D4CF8BC1D8360CC0001CE8D /* WKThumbnailView.mm */; };
 		2D51A0C71C8BF00C00765C45 /* DOMHTMLVideoElementWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D51A0C51C8BF00400765C45 /* DOMHTMLVideoElementWrapper.mm */; };
 		2D70059621EDA0C6003463CB /* TabOutOfWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D70059521EDA0C6003463CB /* TabOutOfWebView.mm */; };
@@ -1452,7 +1451,6 @@
 		2D21FE581F04642800B58E7D /* WKPDFViewStablePresentationUpdateCallback.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKPDFViewStablePresentationUpdateCallback.mm; sourceTree = "<group>"; };
 		2D2BEB2C22324E5F005544CA /* RequestTextInputContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RequestTextInputContext.mm; sourceTree = "<group>"; };
 		2D3CA3A4221DF2390088E803 /* PageOverlayPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageOverlayPlugin.mm; sourceTree = "<group>"; };
-		2D41CFB82260014E00FFF335 /* WKWebViewPrintFormatter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewPrintFormatter.mm; sourceTree = "<group>"; };
 		2D4CF8BC1D8360CC0001CE8D /* WKThumbnailView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKThumbnailView.mm; path = WebKit/WKThumbnailView.mm; sourceTree = "<group>"; };
 		2D51A0C51C8BF00400765C45 /* DOMHTMLVideoElementWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLVideoElementWrapper.mm; sourceTree = "<group>"; };
 		2D61EC3021B0B75C00A7D1CB /* PencilKitTestSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PencilKitTestSPI.h; sourceTree = "<group>"; };
@@ -2719,7 +2717,6 @@
 				CE449E1021AE0F7200E7ADA1 /* WKWebViewFindString.mm */,
 				F4106C6821ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm */,
 				D3BE5E341E4CE85E00FD563A /* WKWebViewGetContents.mm */,
-				2D41CFB82260014E00FFF335 /* WKWebViewPrintFormatter.mm */,
 				37A9DBE7213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm */,
 				93F56DA81E5F9181003EDE84 /* WKWebViewSnapshot.mm */,
 				9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */,
@@ -4453,7 +4450,6 @@
 				F4106C6921ACBF84004B89A1 /* WKWebViewFirstResponderTests.mm in Sources */,
 				D34E08761E4E42E1005FF14A /* WKWebViewGetContents.mm in Sources */,
 				F4FA91811E61849B007B8C1D /* WKWebViewMacEditingTests.mm in Sources */,
-				2D41CFB92260014F00FFF335 /* WKWebViewPrintFormatter.mm in Sources */,
 				37A9DBE9213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm in Sources */,
 				93F56DA91E5F919D003EDE84 /* WKWebViewSnapshot.mm in Sources */,
 				9984FACC1CFFAF60008D198C /* WKWebViewTextInput.mm in Sources */,

Deleted: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewPrintFormatter.mm (244406 => 244407)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewPrintFormatter.mm	2019-04-17 22:51:21 UTC (rev 244406)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewPrintFormatter.mm	2019-04-17 23:06:17 UTC (rev 244407)
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-
-#if PLATFORM(IOS_FAMILY)
-
-#import "PlatformUtilities.h"
-#import "Test.h"
-#import "TestNavigationDelegate.h"
-#import "TestWKWebView.h"
-#import <WebKit/WKPreferencesRefPrivate.h>
-#import <WebKit/WKWebViewPrivate.h>
-#import <WebKit/WebKit.h>
-#import <WebKit/_WKTextInputContext.h>
-#import <wtf/RetainPtr.h>
-
-static bool done;
-
-@interface PrintOnAlertUIDelegate : NSObject <WKUIDelegate>
-@end
-
-@implementation PrintOnAlertUIDelegate
-
-- (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
-{
-    EXPECT_NULL([webView _webViewPrintFormatter]);
-
-    dispatch_async(dispatch_get_main_queue(), ^{
-        EXPECT_NULL([webView _webViewPrintFormatter]);
-        completionHandler();
-        done = true;
-    });
-}
-
-@end
-
-TEST(WebKit, WKWebViewPrintFormatterJavaScriptAlertDeadlock)
-{
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-    auto delegate = adoptNS([[PrintOnAlertUIDelegate alloc] init]);
-    [webView setUIDelegate:delegate.get()];
-
-    [webView synchronouslyLoadHTMLString:@"The quick brown fox jumps over the lazy dog."];
-    EXPECT_NOT_NULL([webView _webViewPrintFormatter]);
-
-    [webView evaluateJavaScript:@"alert('hello')" completionHandler:nil];
-    TestWebKitAPI::Util::run(&done);
-
-    EXPECT_NOT_NULL([webView _webViewPrintFormatter]);
-}
-
-#endif // PLATFORM(IOS_FAMILY)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to