Changeset 259580 in webkit
- Timestamp:
- Apr 6, 2020 11:08:21 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r259579 r259580 1 2020-04-06 Dean Jackson <dino@apple.com> 2 3 CrashTracer: MobileSafari at WebKit: WebKit::SystemPreviewController::updateProgress 4 https://bugs.webkit.org/show_bug.cgi?id=210040 5 rdar://51410841 6 7 Reviewed by Darin Adler. 8 9 It appears that the SystemPreviewController on WebPageProxy can 10 become null causing a call to an in-progress download to crash 11 as it tries to talk to the QuickLook delegate. Guard against this 12 by checking the SystemPreviewController each time. 13 14 * UIProcess/Cocoa/DownloadClient.mm: 15 (WebKit::systemPreviewController): 16 (WebKit::DownloadClient::didReceiveResponse): 17 (WebKit::DownloadClient::didReceiveData): 18 (WebKit::DownloadClient::processDidCrash): 19 (WebKit::DownloadClient::didFinish): 20 (WebKit::DownloadClient::didFail): 21 (WebKit::DownloadClient::didCancel): 22 1 23 2020-04-06 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm
r252011 r259580 66 66 } 67 67 68 #if USE(SYSTEM_PREVIEW) 69 static SystemPreviewController* systemPreviewController(DownloadProxy& downloadProxy) 70 { 71 auto* page = downloadProxy.originatingPage(); 72 if (!page) 73 return nullptr; 74 return page->systemPreviewController(); 75 } 76 #endif 77 68 78 void DownloadClient::didStart(DownloadProxy& downloadProxy) 69 79 { … … 89 99 downloadProxy.setExpectedContentLength(response.expectedContentLength()); 90 100 downloadProxy.setBytesLoaded(0); 91 if (auto* webPage = downloadProxy.originatingPage())92 webPage->systemPreviewController()->updateProgress(0);101 if (auto* controller = systemPreviewController(downloadProxy)) 102 controller->updateProgress(0); 93 103 return; 94 104 } … … 104 114 if (downloadProxy.isSystemPreviewDownload()) { 105 115 downloadProxy.setBytesLoaded(downloadProxy.bytesLoaded() + length); 106 if (auto* webPage = downloadProxy.originatingPage())107 webPage->systemPreviewController()->updateProgress(static_cast<float>(downloadProxy.bytesLoaded()) / downloadProxy.expectedContentLength());116 if (auto* controller = systemPreviewController(downloadProxy)) 117 controller->updateProgress(static_cast<float>(downloadProxy.bytesLoaded()) / downloadProxy.expectedContentLength()); 108 118 return; 109 119 } … … 165 175 #if USE(SYSTEM_PREVIEW) 166 176 if (downloadProxy.isSystemPreviewDownload()) { 167 if (auto* webPage = downloadProxy.originatingPage())168 webPage->systemPreviewController()->cancel();177 if (auto* controller = systemPreviewController(downloadProxy)) 178 controller->cancel(); 169 179 releaseActivityTokenIfNecessary(downloadProxy); 170 180 return; … … 210 220 #if USE(SYSTEM_PREVIEW) 211 221 if (downloadProxy.isSystemPreviewDownload()) { 212 if (auto* webPage = downloadProxy.originatingPage()) {222 if (auto* controller = systemPreviewController(downloadProxy)) { 213 223 WTF::URL destinationURL = WTF::URL::fileURLWithFileSystemPath(downloadProxy.destinationFilename()); 214 224 if (!destinationURL.fragmentIdentifier().length()) 215 225 destinationURL.setFragmentIdentifier(downloadProxy.request().url().fragmentIdentifier()); 216 webPage->systemPreviewController()->finish(destinationURL);226 controller->finish(destinationURL); 217 227 } 218 228 releaseActivityTokenIfNecessary(downloadProxy); … … 229 239 #if USE(SYSTEM_PREVIEW) 230 240 if (downloadProxy.isSystemPreviewDownload()) { 231 if (auto* webPage = downloadProxy.originatingPage())232 webPage->systemPreviewController()->fail(error);241 if (auto* controller = systemPreviewController(downloadProxy)) 242 controller->fail(error); 233 243 releaseActivityTokenIfNecessary(downloadProxy); 234 244 return; … … 244 254 #if USE(SYSTEM_PREVIEW) 245 255 if (downloadProxy.isSystemPreviewDownload()) { 246 if (auto* webPage = downloadProxy.originatingPage())247 webPage->systemPreviewController()->cancel();256 if (auto* controller = systemPreviewController(downloadProxy)) 257 controller->cancel(); 248 258 releaseActivityTokenIfNecessary(downloadProxy); 249 259 return;
Note: See TracChangeset
for help on using the changeset viewer.