WebKit Bugzilla
Attachment 343119 Details for
Bug 186825
: Blank viewer comes up and then auto-dismisses when device is not connected to Internet
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186825-20180620091255.patch (text/plain), 6.07 KB, created by
Dean Jackson
on 2018-06-19 16:12:57 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2018-06-19 16:12:57 PDT
Size:
6.07 KB
patch
obsolete
>Subversion Revision: 232857 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3a8797e97a6e345f20d2fdccaefe3746bfff1fd3..abf79a568cfa84aebfce74d9ad9c9e4041ea47c0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-19 Dean Jackson <dino@apple.com> >+ >+ Blank viewer comes up and then auto-dismisses when device is not connected to Internet >+ https://bugs.webkit.org/show_bug.cgi?id=186825 >+ <rdar://problem/40294170> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Export isSuccessful() to WebKit. >+ >+ * platform/network/ResourceResponseBase.h: >+ > 2018-06-14 Nan Wang <n_wang@apple.com> > > AX: Crash in AccessibilityNodeObject::textUnderElement(WebCore::AccessibilityTextUnderElementMode) const + 536 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4df90195ea7526e1729cbf16640d7bf09b6cd532..566af0105a2ccdd010c854bfcb4c5b968f6f742b 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2018-06-19 Dean Jackson <dino@apple.com> >+ >+ Blank viewer comes up and then auto-dismisses when device is not connected to Internet >+ https://bugs.webkit.org/show_bug.cgi?id=186825 >+ <rdar://problem/40294170> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Handle the case where the network load fails, and send that >+ error onto QuickLook. >+ >+ * UIProcess/Cocoa/DownloadClient.mm: >+ (WebKit::DownloadClient::didReceiveResponse): Check for success. >+ (WebKit::DownloadClient::processDidCrash): Cancel in the case of a crash. >+ (WebKit::DownloadClient::didFail): Propagate the error onto QuickLook. >+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: >+ (-[_WKPreviewControllerDataSource failWithError:]): New method that calls >+ the completion handler with the error data. >+ (WebKit::SystemPreviewController::fail): New API method. >+ * UIProcess/SystemPreviewController.h: >+ > 2018-06-14 John Wilander <wilander@apple.com> > > Resource Load Statistics: Shortcut classification for redirect to prevalent resource >diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h >index 0321767361303d75787ef5bbb68d0a05b0c8f690..d54754f06af8698161714d43bd530d6e3d3a2df5 100644 >--- a/Source/WebCore/platform/network/ResourceResponseBase.h >+++ b/Source/WebCore/platform/network/ResourceResponseBase.h >@@ -75,7 +75,7 @@ public: > > bool isNull() const { return m_isNull; } > WEBCORE_EXPORT bool isHTTP() const; >- bool isSuccessful() const; >+ WEBCORE_EXPORT bool isSuccessful() const; > > WEBCORE_EXPORT const URL& url() const; > WEBCORE_EXPORT void setURL(const URL&); >diff --git a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >index 9eeabe10479a574893574d2957021c423ef7f983..31c1321c09a076fa757b72db098959e2a045f54d 100644 >--- a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >+++ b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >@@ -92,7 +92,7 @@ void DownloadClient::didStart(WebProcessPool&, DownloadProxy& downloadProxy) > void DownloadClient::didReceiveResponse(WebProcessPool&, DownloadProxy& downloadProxy, const WebCore::ResourceResponse& response) > { > #if USE(SYSTEM_PREVIEW) >- if (downloadProxy.isSystemPreviewDownload()) { >+ if (downloadProxy.isSystemPreviewDownload() && response.isSuccessful()) { > downloadProxy.setExpectedContentLength(response.expectedContentLength()); > downloadProxy.setBytesLoaded(0); > if (auto* webPage = downloadProxy.originatingPage()) >@@ -177,6 +177,8 @@ void DownloadClient::processDidCrash(WebProcessPool&, DownloadProxy& downloadPro > { > #if USE(SYSTEM_PREVIEW) > if (downloadProxy.isSystemPreviewDownload()) { >+ if (auto* webPage = downloadProxy.originatingPage()) >+ webPage->systemPreviewController()->cancel(); > releaseActivityTokenIfNecessary(downloadProxy); > return; > } >@@ -239,7 +241,7 @@ void DownloadClient::didFail(WebProcessPool&, DownloadProxy& downloadProxy, cons > #if USE(SYSTEM_PREVIEW) > if (downloadProxy.isSystemPreviewDownload()) { > if (auto* webPage = downloadProxy.originatingPage()) >- webPage->systemPreviewController()->cancel(); >+ webPage->systemPreviewController()->fail(error); > releaseActivityTokenIfNecessary(downloadProxy); > return; > } >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index 429fb0c3da43b99979c711e69e8540243c2c8e35..dfc828eaeb9afa87ab77e9c2627ce9d309a07600 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -114,6 +114,12 @@ SOFT_LINK_CLASS(QuickLook, QLItem); > self.completionHandler((NSURL*)url, nil); > } > >+- (void)failWithError:(NSError *)error >+{ >+ if (self.completionHandler) >+ self.completionHandler(nil, error); >+} >+ > @end > > @interface _WKPreviewControllerDelegate : NSObject <QLPreviewControllerDelegate> { >@@ -234,6 +240,12 @@ void SystemPreviewController::cancel() > m_qlPreviewController = nullptr; > } > >+void SystemPreviewController::fail(const WebCore::ResourceError& error) >+{ >+ if (m_qlPreviewControllerDataSource) >+ [m_qlPreviewControllerDataSource failWithError:error.nsError()]; >+} >+ > } > > #endif >diff --git a/Source/WebKit/UIProcess/SystemPreviewController.h b/Source/WebKit/UIProcess/SystemPreviewController.h >index b8a68499f4909035bd696ed43fa299b0c0dce293..949c8df721ed9ed35a7da68ec7cf91279ef90a31 100644 >--- a/Source/WebKit/UIProcess/SystemPreviewController.h >+++ b/Source/WebKit/UIProcess/SystemPreviewController.h >@@ -28,6 +28,7 @@ > #if USE(SYSTEM_PREVIEW) > > #include <WebCore/IntRect.h> >+#include <WebCore/ResourceError.h> > #include <WebCore/URL.h> > #include <wtf/RetainPtr.h> > >@@ -51,6 +52,7 @@ public: > void updateProgress(float); > void finish(WebCore::URL); > void cancel(); >+ void fail(const WebCore::ResourceError&); > > WebPageProxy& page() { return m_webPageProxy; } >
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
Flags:
thorton
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186825
: 343119