Changeset 112599 in webkit
- Timestamp:
- Mar 29, 2012 4:17:09 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112596 r112599 1 2012-03-29 Nate Chapin <japhet@chromium.org> 2 3 Simplify reporting a main resource error to DocumentLoader and 4 FrameLoader. 5 https://bugs.webkit.org/show_bug.cgi?id=82649 6 7 Reviewed by Adam Barth. 8 9 No new tests, no functionality change intended. 10 11 * loader/DocumentLoader.cpp: 12 (WebCore::DocumentLoader::mainReceivedError): Remove isComplete parameter, 13 since it was always true. Call FrameLoader::receivedMainResourceError, 14 instead of the other way around. 15 * loader/DocumentLoader.h: 16 * loader/FrameLoader.cpp: 17 (WebCore::FrameLoader::receivedMainResourceError): Remove isComplete parameter, 18 since it was always true. Merge in most of mainReceivedCompleteError(). 19 * loader/FrameLoader.h: 20 * loader/MainResourceLoader.cpp: 21 (WebCore::MainResourceLoader::receivedError): 22 (WebCore::MainResourceLoader::didCancel): 23 1 24 2012-03-28 Jer Noble <jer.noble@apple.com> 2 25 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r112308 r112599 194 194 } 195 195 196 void DocumentLoader::mainReceivedError(const ResourceError& error , bool isComplete)196 void DocumentLoader::mainReceivedError(const ResourceError& error) 197 197 { 198 198 ASSERT(!error.isNull()); … … 203 203 return; 204 204 setMainDocumentError(error); 205 if (isComplete)206 frameLoader()->mainReceivedCompleteError(this,error);205 setPrimaryLoadComplete(true); 206 frameLoader()->receivedMainResourceError(error); 207 207 } 208 208 … … 263 263 // If there are no resource loaders, we need to manufacture a cancelled message. 264 264 // (A back/forward navigation has no resource loaders because its resources are cached.) 265 mainReceivedError(frameLoader->cancelledError(m_request) , true);265 mainReceivedError(frameLoader->cancelledError(m_request)); 266 266 267 267 stopLoadingSubresources(); -
trunk/Source/WebCore/loader/DocumentLoader.h
r112308 r112599 117 117 const ResourceResponse& response() const { return m_response; } 118 118 const ResourceError& mainDocumentError() const { return m_mainDocumentError; } 119 void mainReceivedError(const ResourceError& , bool isComplete);119 void mainReceivedError(const ResourceError&); 120 120 void setResponse(const ResourceResponse& response) { m_response = response; } 121 121 void prepareForLoadStart(); -
trunk/Source/WebCore/loader/FrameLoader.cpp
r112474 r112599 2595 2595 } 2596 2596 2597 void FrameLoader::receivedMainResourceError(const ResourceError& error , bool isComplete)2597 void FrameLoader::receivedMainResourceError(const ResourceError& error) 2598 2598 { 2599 2599 // Retain because the stop may release the last reference to it. … … 2601 2601 2602 2602 RefPtr<DocumentLoader> loader = activeDocumentLoader(); 2603 2604 if (isComplete) { 2605 // FIXME: Don't want to do this if an entirely new load is going, so should check 2606 // that both data sources on the frame are either this or nil. 2607 stop(); 2608 if (m_client->shouldFallBack(error)) 2609 handleFallbackContent(); 2610 } 2603 // FIXME: Don't want to do this if an entirely new load is going, so should check 2604 // that both data sources on the frame are either this or nil. 2605 stop(); 2606 if (m_client->shouldFallBack(error)) 2607 handleFallbackContent(); 2611 2608 2612 2609 if (m_state == FrameStateProvisional && m_provisionalDocumentLoader) { … … 2628 2625 } 2629 2626 2630 loader->mainReceivedError(error, isComplete); 2627 checkCompleted(); 2628 if (m_frame->page()) 2629 checkLoadComplete(); 2631 2630 } 2632 2631 … … 3082 3081 } 3083 3082 3084 void FrameLoader::mainReceivedCompleteError(DocumentLoader* loader, const ResourceError&)3085 {3086 loader->setPrimaryLoadComplete(true);3087 checkCompleted();3088 if (m_frame->page())3089 checkLoadComplete();3090 }3091 3092 3083 ResourceError FrameLoader::cancelledError(const ResourceRequest& request) const 3093 3084 { -
trunk/Source/WebCore/loader/FrameLoader.h
r112184 r112599 151 151 const ResourceRequest& originalRequest() const; 152 152 const ResourceRequest& initialRequest() const; 153 void receivedMainResourceError(const ResourceError& , bool isComplete);153 void receivedMainResourceError(const ResourceError&); 154 154 155 155 bool willLoadMediaElementURL(KURL&); … … 167 167 bool isReplacing() const; 168 168 void setReplacing(); 169 void mainReceivedCompleteError(DocumentLoader*, const ResourceError&);170 169 bool subframeIsLoading() const; 171 170 void willChangeTitle(DocumentLoader*); -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r111251 r112599 91 91 RefPtr<Frame> protectFrame(m_frame); 92 92 93 // It is important that we call FrameLoader::receivedMainResourceError before calling94 // FrameLoader::didFailToLoad because receivedMainResourceError clears out the relevant95 // document loaders. Also, receivedMainResourceError ends up calling a FrameLoadDelegate method93 // It is important that we call DocumentLoader::mainReceivedError before calling 94 // ResourceLoadNotifier::didFailToLoad because mainReceivedError clears out the relevant 95 // document loaders. Also, mainReceivedError ends up calling a FrameLoadDelegate method 96 96 // and didFailToLoad calls a ResourceLoadDelegate method and they need to be in the correct order. 97 frameLoader()->receivedMainResourceError(error, true);97 documentLoader()->mainReceivedError(error); 98 98 99 99 if (!cancelled()) { … … 123 123 // We should notify the frame loader after fully canceling the load, because it can do complicated work 124 124 // like calling DOMWindow::print(), during which a half-canceled load could try to finish. 125 frameLoader()->receivedMainResourceError(error, true);125 documentLoader()->mainReceivedError(error); 126 126 } 127 127
Note: See TracChangeset
for help on using the changeset viewer.