Changeset 241963 in webkit
- Timestamp:
- Feb 22, 2019 1:17:37 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r241962 r241963 1 2019-02-22 Chris Dumez <cdumez@apple.com> 2 3 Regression(PSON) Unable to preview password-protected documents on iCloud.com 4 https://bugs.webkit.org/show_bug.cgi?id=194954 5 <rdar://problem/48127957> 6 7 Reviewed by Alex Christensen. 8 9 Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related 10 IPC on iOS. 11 12 * UIProcess/ProvisionalPageProxy.cpp: 13 (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): 14 (WebKit::ProvisionalPageProxy::didReceiveMessage): 15 * UIProcess/ProvisionalPageProxy.h: 16 * UIProcess/WebPageProxy.h: 17 * UIProcess/ios/WebPageProxyIOS.mm: 18 (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): 19 (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared): 20 1 21 2019-02-22 Per Arne Vollan <pvollan@apple.com> 2 22 -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
r241823 r241963 328 328 } 329 329 330 #if USE(QUICK_LOOK) 331 void ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName) 332 { 333 m_page.didRequestPasswordForQuickLookDocumentInMainFrameShared(m_process.copyRef(), fileName); 334 } 335 #endif 336 330 337 #if PLATFORM(COCOA) 331 338 void ProvisionalPageProxy::registerWebProcessAccessibilityToken(const IPC::DataReference& data) … … 345 352 || decoder.messageName() == Messages::WebPageProxy::LogDiagnosticMessageWithEnhancedPrivacy::name() 346 353 || decoder.messageName() == Messages::WebPageProxy::SetNetworkRequestsInProgress::name() 354 #if USE(QUICK_LOOK) 355 || decoder.messageName() == Messages::WebPageProxy::DidStartLoadForQuickLookDocumentInMainFrame::name() 356 || decoder.messageName() == Messages::WebPageProxy::DidFinishLoadForQuickLookDocumentInMainFrame::name() 357 #endif 347 358 ) 348 359 { … … 418 429 } 419 430 431 #if USE(QUICK_LOOK) 432 if (decoder.messageName() == Messages::WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame::name()) { 433 IPC::handleMessage<Messages::WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame>(decoder, this, &ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame); 434 return; 435 } 436 #endif 437 420 438 LOG(ProcessSwapping, "Unhandled message %s::%s from provisional process", decoder.messageReceiverName().toString().data(), decoder.messageName().toString().data()); 421 439 } -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.h
r241823 r241963 106 106 FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, 107 107 WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&); 108 #if USE(QUICK_LOOK) 109 void didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName); 110 #endif 108 111 #if PLATFORM(COCOA) 109 112 void registerWebProcessAccessibilityToken(const IPC::DataReference&); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r241934 r241963 1459 1459 FrameInfoData&&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, 1460 1460 WebCore::ResourceResponse&& redirectResponse, const UserData&, Messages::WebPageProxy::DecidePolicyForNavigationActionSync::DelayedReply&&); 1461 #if USE(QUICK_LOOK) 1462 void didRequestPasswordForQuickLookDocumentInMainFrameShared(Ref<WebProcessProxy>&&, const String& fileName); 1463 #endif 1461 1464 1462 1465 void dumpAdClickAttribution(CompletionHandler<void(const String&)>&&); -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r241934 r241963 1160 1160 void WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame(const String& fileName) 1161 1161 { 1162 pageClient().requestPasswordForQuickLookDocument(fileName, [protectedThis = makeRef(*this)](const String& password) { 1163 protectedThis->process().send(Messages::WebPage::DidReceivePasswordForQuickLookDocument(password), protectedThis->m_pageID); 1162 didRequestPasswordForQuickLookDocumentInMainFrameShared(m_process.copyRef(), fileName); 1163 } 1164 1165 void WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared(Ref<WebProcessProxy>&& process, const String& fileName) 1166 { 1167 pageClient().requestPasswordForQuickLookDocument(fileName, [process = WTFMove(process), pageID = m_pageID](const String& password) { 1168 process->send(Messages::WebPage::DidReceivePasswordForQuickLookDocument(password), pageID); 1164 1169 }); 1165 1170 } -
trunk/Tools/ChangeLog
r241950 r241963 1 2019-02-22 Chris Dumez <cdumez@apple.com> 2 3 Regression(PSON) Unable to preview password-protected documents on iCloud.com 4 https://bugs.webkit.org/show_bug.cgi?id=194954 5 <rdar://problem/48127957> 6 7 Reviewed by Alex Christensen. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 12 (-[PSONNavigationDelegate _webViewDidRequestPasswordForQuickLookDocument:]): 13 (-[PSONNavigationDelegate _webView:didStartLoadForQuickLookDocumentInMainFrameWithFileName:uti:]): 14 (-[PSONNavigationDelegate _webView:didFinishLoadForQuickLookDocumentInMainFrame:]): 15 1 16 2019-02-22 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r241950 r241963 71 71 static bool didRepondToPolicyDecisionCall; 72 72 73 #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 74 static bool requestedQuickLookPassword; 75 static bool didStartQuickLookLoad; 76 static bool didFinishQuickLookLoad; 77 #endif 78 73 79 static RetainPtr<NSMutableArray> receivedMessages = adoptNS([@[] mutableCopy]); 74 80 bool didReceiveAlert; … … 99 105 @end 100 106 101 @interface PSONNavigationDelegate : NSObject <WKNavigationDelegate > {107 @interface PSONNavigationDelegate : NSObject <WKNavigationDelegatePrivate> { 102 108 @public void (^decidePolicyForNavigationAction)(WKNavigationAction *, void (^)(WKNavigationActionPolicy)); 103 109 @public void (^didStartProvisionalNavigationHandler)(); … … 174 180 didPerformClientRedirect = true; 175 181 } 182 183 #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 184 185 - (void)_webViewDidRequestPasswordForQuickLookDocument:(WKWebView *)webView 186 { 187 requestedQuickLookPassword = true; 188 } 189 190 - (void)_webView:(WKWebView *)webView didStartLoadForQuickLookDocumentInMainFrameWithFileName:(NSString *)fileName uti:(NSString *)uti 191 { 192 didStartQuickLookLoad = true; 193 } 194 195 - (void)_webView:(WKWebView *)webView didFinishLoadForQuickLookDocumentInMainFrame:(NSData *)documentData 196 { 197 didFinishQuickLookLoad = true; 198 } 199 200 #endif 176 201 177 202 @end … … 5321 5346 } 5322 5347 5348 #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 5349 5350 TEST(ProcessSwap, QuickLookRequestsPasswordAfterSwap) 5351 { 5352 auto processPoolConfiguration = psonProcessPoolConfiguration(); 5353 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 5354 5355 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 5356 [webViewConfiguration setProcessPool:processPool.get()]; 5357 auto handler = adoptNS([[PSONScheme alloc] init]); 5358 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; 5359 5360 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 5361 5362 auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]); 5363 [webView setNavigationDelegate:navigationDelegate.get()]; 5364 5365 auto* request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]; 5366 [webView loadRequest:request]; 5367 5368 TestWebKitAPI::Util::run(&done); 5369 done = false; 5370 5371 request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"password-protected" withExtension:@"pages" subdirectory:@"TestWebKitAPI.resources"]]; 5372 [webView loadRequest:request]; 5373 5374 TestWebKitAPI::Util::run(&didStartQuickLookLoad); 5375 didStartQuickLookLoad = false; 5376 5377 TestWebKitAPI::Util::run(&requestedQuickLookPassword); 5378 requestedQuickLookPassword = false; 5379 5380 TestWebKitAPI::Util::run(&didFinishQuickLookLoad); 5381 didFinishQuickLookLoad = false; 5382 } 5383 5384 #endif 5385 5323 5386 #endif // WK_API_ENABLED
Note: See TracChangeset
for help on using the changeset viewer.