WebKit Bugzilla
Attachment 342224 Details for
Bug 186418
: [iOS] Inform the client when PDFKit's extension process crashes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186418-20180607170940.patch (text/plain), 4.72 KB, created by
Andy Estes
on 2018-06-07 17:09:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-06-07 17:09:41 PDT
Size:
4.72 KB
patch
obsolete
>Subversion Revision: 232607 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b5664c85454c0c18b34a71e4997818cf97dd4663..27171c77d1caa849d6100e30a1fff87d2a0dbbd8 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,28 @@ >+2018-06-07 Andy Estes <aestes@apple.com> >+ >+ [iOS] Inform the client when PDFKit's extension process crashes >+ https://bugs.webkit.org/show_bug.cgi?id=186418 >+ <rdar://problem/40175864> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::processDidTerminate): >+ (WebKit::WebPageProxy::dispatchProcessDidTerminate): >+ >+ Separated the dispatching of delegate methods from the rest of the web >+ process-specific processDidTerminate logic. >+ >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/ios/WKPDFView.mm: >+ (-[WKPDFView web_setContentProviderData:suggestedFilename:]): >+ >+ Minor style fix. >+ >+ (-[WKPDFView pdfHostViewControllerExtensionProcessDidCrash:]): >+ >+ Called WebPageProxy::dispatchProcessDidTerminate on the main thread. >+ > 2018-06-07 Andy Estes <aestes@apple.com> > > [iOS] Unable to present the share sheet after saving a PDF to Files.app >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 609dc1798e5a76cccab8e93b308eca84cc71c3b9..d2b99521b5a446bf567e7e64a28d190e4431fc2f 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -5842,11 +5842,7 @@ void WebPageProxy::processDidTerminate(ProcessTerminationReason reason) > m_webProcessLifetimeTracker.webPageLeavingWebProcess(); > else { > navigationState().clearAllNavigations(); >- >- if (m_navigationClient) >- m_navigationClient->processDidTerminate(*this, reason); >- else if (reason != ProcessTerminationReason::RequestedByClient) >- m_loaderClient->processDidCrash(*this); >+ dispatchProcessDidTerminate(reason); > } > > if (m_controlledByAutomation) { >@@ -5857,6 +5853,14 @@ void WebPageProxy::processDidTerminate(ProcessTerminationReason reason) > stopAllURLSchemeTasks(); > } > >+void WebPageProxy::dispatchProcessDidTerminate(ProcessTerminationReason reason) >+{ >+ if (m_navigationClient) >+ m_navigationClient->processDidTerminate(*this, reason); >+ else if (reason != ProcessTerminationReason::RequestedByClient) >+ m_loaderClient->processDidCrash(*this); >+} >+ > void WebPageProxy::stopAllURLSchemeTasks() > { > HashSet<WebURLSchemeHandler*> handlers; >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 8a3b72799106591f3818a15e0fa244f4b32b855b..72db22bcf3541213101129f90ebc39171fb5cc2a 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -917,6 +917,7 @@ public: > void processDidBecomeUnresponsive(); > void processDidBecomeResponsive(); > void processDidTerminate(ProcessTerminationReason); >+ void dispatchProcessDidTerminate(ProcessTerminationReason); > void willChangeProcessIsResponsive(); > void didChangeProcessIsResponsive(); > >diff --git a/Source/WebKit/UIProcess/ios/WKPDFView.mm b/Source/WebKit/UIProcess/ios/WKPDFView.mm >index 452d7ac50d4034ba8d1baa38b235d95a6a50b8a1..ac0eb1f81c9f9a175caf6073cdae68c91f9f3f0e 100644 >--- a/Source/WebKit/UIProcess/ios/WKPDFView.mm >+++ b/Source/WebKit/UIProcess/ios/WKPDFView.mm >@@ -105,8 +105,7 @@ - (void)web_setContentProviderData:(NSData *)data suggestedFilename:(NSString *) > _data = adoptNS([data copy]); > _suggestedFilename = adoptNS([filename copy]); > >- WeakObjCPtr<WKPDFView> weakSelf = self; >- [PDFHostViewController createHostView:[self, weakSelf = WTFMove(weakSelf)](PDFHostViewController * _Nullable hostViewController) { >+ [PDFHostViewController createHostView:[self, weakSelf = WeakObjCPtr<WKPDFView>(self)](PDFHostViewController * _Nullable hostViewController) { > ASSERT(isMainThread()); > > WKPDFView *autoreleasedSelf = weakSelf.getAutoreleased(); >@@ -455,6 +454,15 @@ - (void)pdfHostViewController:(PDFHostViewController *)controller didLongPressPa > [self _showActionSheetForURL:[self _URLWithPageIndex:pageIndex] atLocation:location withAnnotationRect:annotationRect]; > } > >+- (void)pdfHostViewControllerExtensionProcessDidCrash:(PDFHostViewController *)controller >+{ >+ // FIXME 40916725: PDFKit should dispatch this message to the main thread like it does for other delegate messages. >+ dispatch_async(dispatch_get_main_queue(), [webView = _webView] { >+ if (auto page = [webView _page]) >+ page->dispatchProcessDidTerminate(WebKit::ProcessTerminationReason::Crash); >+ }); >+} >+ > > #pragma mark WKActionSheetAssistantDelegate >
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 186418
: 342224