Changeset 150609 in webkit
- Timestamp:
- May 23, 2013 1:08:21 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150606 r150609 1 2013-05-23 Anders Carlsson <andersca@apple.com> 2 3 Crash in convertMainResourceLoadToDownload when downloading file by option-return 4 https://bugs.webkit.org/show_bug.cgi?id=116451 5 6 Reviewed by Andreas Kling. 7 8 Handle MainResourceLoader being null here which will happen when loading a cached main resource. 9 10 * loader/DocumentLoader.cpp: 11 (WebCore::DocumentLoader::continueAfterContentPolicy): 12 1 13 2013-05-23 Benjamin Poulain <bpoulain@apple.com> 2 14 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r150150 r150609 669 669 return; 670 670 } 671 InspectorInstrumentation::continueWithPolicyDownload(m_frame, this, mainResourceLoader()->identifier(), m_response); 671 672 if (ResourceLoader* mainResourceLoader = this->mainResourceLoader()) 673 InspectorInstrumentation::continueWithPolicyDownload(m_frame, this, mainResourceLoader->identifier(), m_response); 672 674 673 675 // When starting the request, we didn't know that it would result in download and not navigation. Now we know that main document URL didn't change. … … 682 684 } 683 685 case PolicyIgnore: 684 InspectorInstrumentation::continueWithPolicyIgnore(m_frame, this, mainResourceLoader()->identifier(), m_response); 686 if (ResourceLoader* mainResourceLoader = this->mainResourceLoader()) 687 InspectorInstrumentation::continueWithPolicyIgnore(m_frame, this, mainResourceLoader->identifier(), m_response); 685 688 stopLoadingForPolicyChange(); 686 689 return; -
trunk/Source/WebKit/mac/ChangeLog
r150530 r150609 1 2013-05-23 Anders Carlsson <andersca@apple.com> 2 3 Crash in convertMainResourceLoadToDownload when downloading file by option-return 4 https://bugs.webkit.org/show_bug.cgi?id=116451 5 6 Reviewed by Andreas Kling. 7 8 If the main resource loader is null, create a new download instead since there's no existing loader to convert. 9 10 * WebCoreSupport/WebFrameLoaderClient.mm: 11 (WebFrameLoaderClient::convertMainResourceLoadToDownload): 12 1 13 2013-05-22 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r150273 r150609 279 279 void WebFrameLoaderClient::convertMainResourceLoadToDownload(DocumentLoader* documentLoader, const ResourceRequest& request, const ResourceResponse& response) 280 280 { 281 WebView *webView = getWebView(m_webFrame.get()); 282 283 if (!documentLoader->mainResourceLoader()) { 284 // The resource has already been cached, start a new download. 285 WebDownload *webDownload = [[WebDownload alloc] initWithRequest:request.nsURLRequest(UpdateHTTPBody) delegate:[webView downloadDelegate]]; 286 [webDownload autorelease]; 287 return; 288 } 289 281 290 ResourceHandle* handle = documentLoader->mainResourceLoader()->handle(); 282 291 283 292 #if USE(CFNETWORK) 284 293 ASSERT([WebDownload respondsToSelector:@selector(_downloadWithLoadingCFURLConnection:request:response:delegate:proxy:)]); 285 WebView *webView = getWebView(m_webFrame.get());286 294 CFURLConnectionRef connection = handle->connection(); 287 295 [WebDownload _downloadWithLoadingCFURLConnection:connection … … 295 303 CFRelease(connection); 296 304 #else 297 WebView *webView = getWebView(m_webFrame.get());298 305 [WebDownload _downloadWithLoadingConnection:handle->connection() 299 306 request:request.nsURLRequest(UpdateHTTPBody) -
trunk/Source/WebKit2/ChangeLog
r150599 r150609 1 2013-05-23 Anders Carlsson <andersca@apple.com> 2 3 Crash in convertMainResourceLoadToDownload when downloading file by option-return 4 https://bugs.webkit.org/show_bug.cgi?id=116451 5 6 Reviewed by Andreas Kling. 7 8 If the main resource loader is null, create a new download instead since there's no existing loader to convert. 9 10 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 11 (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): 12 * WebProcess/WebPage/WebFrame.cpp: 13 (WebKit::WebFrame::convertMainResourceLoadToDownload): 14 1 15 2013-05-22 Alexey Proskuryakov <ap@apple.com> 2 16 -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
r150537 r150609 176 176 void NetworkConnectionToWebProcess::convertMainResourceLoadToDownload(uint64_t mainResourceLoadIdentifier, uint64_t downloadID, const ResourceRequest& request, const ResourceResponse& response) 177 177 { 178 if (!mainResourceLoadIdentifier) { 179 NetworkProcess::shared().downloadManager().startDownload(downloadID, request); 180 return; 181 } 182 178 183 NetworkResourceLoader* loader = m_networkResourceLoaders.get(mainResourceLoadIdentifier); 179 184 NetworkProcess::shared().downloadManager().convertHandleToDownload(downloadID, loader->handle(), request, response); -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r150282 r150609 257 257 m_policyDownloadID = 0; 258 258 259 ResourceLoader* mainResourceLoader = documentLoader->mainResourceLoader(); 260 259 261 #if ENABLE(NETWORK_PROCESS) 260 262 if (WebProcess::shared().usesNetworkProcess()) { 261 WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(documentLoader->mainResourceLoader()->identifier(), policyDownloadID, request, response), 0); 263 // Use 0 to indicate that there is no main resource loader. 264 // This can happen if the main resource is in the WebCore memory cache. 265 uint64_t mainResourceLoadIdentifier; 266 if (mainResourceLoader) 267 mainResourceLoadIdentifier = mainResourceLoader->identifier(); 268 else 269 mainResourceLoadIdentifier = 0; 270 271 WebProcess::shared().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(mainResourceLoadIdentifier, policyDownloadID, request, response), 0); 262 272 return; 263 273 } 264 274 #endif 275 276 if (!mainResourceLoader) { 277 // The main resource has already been loaded. Start a new download instead. 278 WebProcess::shared().downloadManager().startDownload(policyDownloadID, request); 279 return; 280 } 265 281 266 282 WebProcess::shared().downloadManager().convertHandleToDownload(policyDownloadID, documentLoader->mainResourceLoader()->handle(), request, response);
Note: See TracChangeset
for help on using the changeset viewer.