WebKit Bugzilla
Attachment 362754 Details for
Bug 194954
: Regression(PSON) Unable to preview password-protected documents on iCloud.com
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194954-20190222125504.patch (text/plain), 11.58 KB, created by
Chris Dumez
on 2019-02-22 12:55:05 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-02-22 12:55:05 PST
Size:
11.58 KB
patch
obsolete
>Subversion Revision: 241950 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index c047f2bdb7595098fed11de092d0fb12a985cea3..a724f19a0f289906e15b75addb8c4d0efa86258d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,23 @@ >+2019-02-22 Chris Dumez <cdumez@apple.com> >+ >+ Regression(PSON) Unable to preview password-protected documents on iCloud.com >+ https://bugs.webkit.org/show_bug.cgi?id=194954 >+ <rdar://problem/48127957> >+ >+ Reviewed by Alex Christensen. >+ >+ Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related >+ IPC on iOS. >+ >+ * UIProcess/ProvisionalPageProxy.cpp: >+ (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): >+ (WebKit::ProvisionalPageProxy::didReceiveMessage): >+ * UIProcess/ProvisionalPageProxy.h: >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/ios/WebPageProxyIOS.mm: >+ (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): >+ (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared): >+ > 2019-02-22 Chris Dumez <cdumez@apple.com> > > REGRESSION(PSON) Scroll position is sometimes not restored on history navigation >diff --git a/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp b/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp >index eb299a87b7555f03cc8e25dd1992c95a0f4739f2..d4bdcc4eca33ca8ee30a93e9cfe4604f81ac63ec 100644 >--- a/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp >+++ b/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp >@@ -327,6 +327,13 @@ void ProvisionalPageProxy::decidePolicyForNavigationActionSync(uint64_t frameID, > WTFMove(frameInfoData), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(redirectResponse), userData, WTFMove(reply)); > } > >+#if USE(QUICK_LOOK) >+void ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName) >+{ >+ m_page.didRequestPasswordForQuickLookDocumentInMainFrameShared(m_process.copyRef(), fileName); >+} >+#endif >+ > #if PLATFORM(COCOA) > void ProvisionalPageProxy::registerWebProcessAccessibilityToken(const IPC::DataReference& data) > { >@@ -344,6 +351,10 @@ void ProvisionalPageProxy::didReceiveMessage(IPC::Connection& connection, IPC::D > || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessage::name() > || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacy::name() > || decoder.messageName() == Messages::WebPageProxy::SetNetworkRequestsInProgress::name() >+#if USE(QUICK_LOOK) >+ || decoder.messageName() == Messages::WebPageProxy::DidStartLoadForQuickLookDocumentInMainFrame::name() >+ || decoder.messageName() == Messages::WebPageProxy::DidFinishLoadForQuickLookDocumentInMainFrame::name() >+#endif > ) > { > m_page.didReceiveMessage(connection, decoder); >@@ -417,6 +428,13 @@ void ProvisionalPageProxy::didReceiveMessage(IPC::Connection& connection, IPC::D > return; > } > >+#if USE(QUICK_LOOK) >+ if (decoder.messageName() == Messages::WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame::name()) { >+ IPC::handleMessage<Messages::WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame>(decoder, this, &ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame); >+ return; >+ } >+#endif >+ > LOG(ProcessSwapping, "Unhandled message %s::%s from provisional process", decoder.messageReceiverName().toString().data(), decoder.messageName().toString().data()); > } > >diff --git a/Source/WebKit/UIProcess/ProvisionalPageProxy.h b/Source/WebKit/UIProcess/ProvisionalPageProxy.h >index c42fe6df4bad88c09bd484ee63b63f044edc4590..5db98867610d4e2a1cfe08f11e2bd81be878a373 100644 >--- a/Source/WebKit/UIProcess/ProvisionalPageProxy.h >+++ b/Source/WebKit/UIProcess/ProvisionalPageProxy.h >@@ -105,6 +105,9 @@ private: > void decidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, > FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, > WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&); >+#if USE(QUICK_LOOK) >+ void didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName); >+#endif > #if PLATFORM(COCOA) > void registerWebProcessAccessibilityToken(const IPC::DataReference&); > #endif >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 70e81d52e8e0a658886653ccf0b32eccef628f7a..d4f17f0f3061ecfbabd1778de0e4a7e81bb0ae1c 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -1458,6 +1458,9 @@ public: > void decidePolicyForNavigationActionSyncShared(Ref<WebProcessProxy>&&, uint64_t frameID, bool isMainFrame, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, uint64_t navigationID, NavigationActionData&&, > FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, > WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&); >+#if USE(QUICK_LOOK) >+ void didRequestPasswordForQuickLookDocumentInMainFrameShared(Ref<WebProcessProxy>&&, const String& fileName); >+#endif > > void dumpAdClickAttribution(CompletionHandler<void(const String&)>&&); > void clearAdClickAttribution(CompletionHandler<void()>&&); >diff --git a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >index ffe39952a3800e73f50e1e81a1353de9759f8b6b..ff74424a1cee9884a0ae67eed97d5ee7da8af34d 100644 >--- a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >@@ -1159,8 +1159,13 @@ void WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookD > > void WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName) > { >- pageClient().requestPasswordForQuickLookDocument(fileName, [protectedThis = makeRef(*this)](const String& password) { >- protectedThis->process().send(Messages::WebPage::DidReceivePasswordForQuickLookDocument(password), protectedThis->m_pageID); >+ didRequestPasswordForQuickLookDocumentInMainFrameShared(m_process.copyRef(), fileName); >+} >+ >+void WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared(Ref<WebProcessProxy>&& process, const String& fileName) >+{ >+ pageClient().requestPasswordForQuickLookDocument(fileName, [process = WTFMove(process), pageID = m_pageID](const String& password) { >+ process->send(Messages::WebPage::DidReceivePasswordForQuickLookDocument(password), pageID); > }); > } > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 0227c99b81d9f7d3acce10e9125c8bd9cea90af5..043bc494ddce5227dbb58e516ef1de4ee4754f4c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-22 Chris Dumez <cdumez@apple.com> >+ >+ Regression(PSON) Unable to preview password-protected documents on iCloud.com >+ https://bugs.webkit.org/show_bug.cgi?id=194954 >+ <rdar://problem/48127957> >+ >+ Reviewed by Alex Christensen. >+ >+ Add API test coverage. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: >+ (-[PSONNavigationDelegate _webViewDidRequestPasswordForQuickLookDocument:]): >+ (-[PSONNavigationDelegate _webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:]): >+ (-[PSONNavigationDelegate _webView:didFinishLoadForQuickLookDocumentInMainFrame:]): >+ > 2019-02-22 Chris Dumez <cdumez@apple.com> > > REGRESSION(PSON) Scroll position is sometimes not restored on history navigation >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >index aad141b7a1189cc9960131f10a10714de80601e1..819259ed7a9a80b4b8facc1083854430acd95026 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >@@ -70,6 +70,12 @@ static bool didCreateWebView; > static int numberOfDecidePolicyCalls; > static bool didRepondToPolicyDecisionCall; > >+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 >+static bool requestedQuickLookPassword; >+static bool didStartQuickLookLoad; >+static bool didFinishQuickLookLoad; >+#endif >+ > static RetainPtr<NSMutableArray> receivedMessages = adoptNS([@[] mutableCopy]); > bool didReceiveAlert; > static bool receivedMessage; >@@ -98,7 +104,7 @@ - (void)userContentController:(WKUserContentController *)userContentController d > } > @end > >-@interface PSONNavigationDelegate : NSObject <WKNavigationDelegate> { >+@interface PSONNavigationDelegate : NSObject <WKNavigationDelegatePrivate> { > @public void (^decidePolicyForNavigationAction)(WKNavigationAction *, void (^)(WKNavigationActionPolicy)); > @public void (^didStartProvisionalNavigationHandler)(); > @public void (^didCommitNavigationHandler)(); >@@ -174,6 +180,25 @@ - (void)_webView:(WKWebView *)webView didPerformClientRedirectFromURL:(NSURL *)s > didPerformClientRedirect = true; > } > >+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 >+ >+- (void)_webViewDidRequestPasswordForQuickLookDocument:(WKWebView *)webView >+{ >+ requestedQuickLookPassword = true; >+} >+ >+- (void)_webView:(WKWebView *)webView didStartLoadForQuickLookDocumentInMainFrameWithFileName:(NSString *)fileName uti:(NSString *)uti >+{ >+ didStartQuickLookLoad = true; >+} >+ >+- (void)_webView:(WKWebView *)webView didFinishLoadForQuickLookDocumentInMainFrame:(NSData *)documentData >+{ >+ didFinishQuickLookLoad = true; >+} >+ >+#endif >+ > @end > > static RetainPtr<WKWebView> createdWebView; >@@ -5320,4 +5345,42 @@ TEST(ProcessSwap, PageOverlayLayerPersistence) > #endif > } > >+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 >+ >+TEST(ProcessSwap, QuickLookRequestsPasswordAfterSwap) >+{ >+ auto processPoolConfiguration = psonProcessPoolConfiguration(); >+ auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); >+ >+ auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); >+ [webViewConfiguration setProcessPool:processPool.get()]; >+ auto handler = adoptNS([[PSONScheme alloc] init]); >+ [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; >+ >+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); >+ >+ auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]); >+ [webView setNavigationDelegate:navigationDelegate.get()]; >+ >+ auto* request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&done); >+ done = false; >+ >+ request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"password-protected" withExtension:@"pages" subdirectory:@"TestWebKitAPI.resources"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&didStartQuickLookLoad); >+ didStartQuickLookLoad = false; >+ >+ TestWebKitAPI::Util::run(&requestedQuickLookPassword); >+ requestedQuickLookPassword = false; >+ >+ TestWebKitAPI::Util::run(&didFinishQuickLookLoad); >+ didFinishQuickLookLoad = false; >+} >+ >+#endif >+ > #endif // WK_API_ENABLED
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194954
:
362736
|
362745
|
362750
|
362753
| 362754