Changeset 89312 in webkit
- Timestamp:
- Jun 20, 2011 4:32:54 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89311 r89312 1 2011-06-20 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove FrameLoader::m_workingURL 6 https://bugs.webkit.org/show_bug.cgi?id=63021 7 8 FrameLoader shouldn't keep the working URL in separate state. It's 9 just a function of other state. m_workingURL exists only to create 10 bugs and confusion. 11 12 * loader/DocumentLoader.cpp: 13 (WebCore::DocumentLoader::documentURL): 14 * loader/DocumentLoader.h: 15 * loader/FrameLoader.cpp: 16 (WebCore::FrameLoader::stopLoading): 17 (WebCore::FrameLoader::didOpenURL): 18 (WebCore::FrameLoader::receivedFirstData): 19 (WebCore::FrameLoader::willSetEncoding): 20 (WebCore::FrameLoader::commitProvisionalLoad): 21 (WebCore::FrameLoader::open): 22 (WebCore::FrameLoader::finishedLoadingDocument): 23 * loader/FrameLoader.h: 24 1 25 2011-06-20 Kenneth Russell <kbr@google.com> 2 26 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r88984 r89312 734 734 } 735 735 736 KURL DocumentLoader::documentURL() const 737 { 738 KURL url = substituteData().responseURL(); 739 if (url.isEmpty()) 740 url = requestURL(); 741 if (url.isEmpty()) 742 url = responseURL(); 743 if (url.isEmpty()) 744 url = blankURL(); 745 return url; 746 } 747 736 748 const String& DocumentLoader::responseMIMEType() const 737 749 { -
trunk/Source/WebCore/loader/DocumentLoader.h
r88610 r89312 94 94 const SubstituteData& substituteData() const { return m_substituteData; } 95 95 96 // FIXME: This is the same as requestURL(). We should remove one of them. 96 97 const KURL& url() const; 97 98 const KURL& unreachableURL() const; 99 100 // The URL of the document resulting from this DocumentLoader. 101 KURL documentURL() const; 98 102 99 103 const KURL& originalURL() const; … … 101 105 const KURL& responseURL() const; 102 106 const String& responseMIMEType() const; 103 107 104 108 void replaceRequestURLForSameDocumentNavigation(const KURL&); 105 109 bool isStopping() const { return m_isStopping; } -
trunk/Source/WebCore/loader/FrameLoader.cpp
r89079 r89312 197 197 , m_isComplete(false) 198 198 , m_isLoadingMainResource(false) 199 , m_hasReceivedFirstData(false) 199 200 , m_needsClear(false) 200 201 , m_checkTimer(this, &FrameLoader::checkTimerFired) … … 419 420 m_frame->document()->setParsing(false); 420 421 } 421 422 m_ workingURL = KURL();422 423 m_hasReceivedFirstData = true; 423 424 424 425 if (Document* doc = m_frame->document()) { … … 462 463 } 463 464 464 bool FrameLoader::didOpenURL( const KURL& url)465 bool FrameLoader::didOpenURL() 465 466 { 466 467 if (m_frame->navigationScheduler()->redirectScheduledDuringLoad()) { … … 486 487 } 487 488 } 488 m_workingURL = url; 489 if (m_workingURL.protocolInHTTPFamily() && !m_workingURL.host().isEmpty() && m_workingURL.path().isEmpty()) 490 m_workingURL.setPath("/"); 489 m_hasReceivedFirstData = false; 491 490 492 491 started(); … … 574 573 void FrameLoader::receivedFirstData() 575 574 { 576 activeDocumentLoader()->writer()->begin(m_workingURL, false); 575 KURL workingURL = activeDocumentLoader()->documentURL(); 576 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML) 577 if (m_archive) 578 workingURL = m_archive->mainResource()->url(); 579 #endif 580 581 activeDocumentLoader()->writer()->begin(workingURL, false); 577 582 activeDocumentLoader()->writer()->setDocumentWasLoadedAsPartOfNavigation(); 578 583 … … 587 592 } 588 593 589 m_workingURL = KURL(); 594 m_hasReceivedFirstData = true; 595 596 if (!m_documentLoader) 597 return; 598 if (m_frame->document()->isViewSource()) 599 return; 590 600 591 601 double delay; 592 602 String url; 593 if (!m_documentLoader)594 return;595 if (m_frame->document()->isViewSource())596 return;597 603 if (!parseHTTPRefresh(m_documentLoader->response().httpHeaderField("Refresh"), false, delay, url)) 598 604 return; 599 600 605 if (url.isEmpty()) 601 606 url = m_frame->document()->url().string(); … … 973 978 void FrameLoader::willSetEncoding() 974 979 { 975 if (!m_ workingURL.isEmpty())980 if (!m_hasReceivedFirstData) 976 981 receivedFirstData(); 977 982 } … … 1771 1776 1772 1777 checkCompleted(); 1773 } else { 1774 KURL url = pdl->substituteData().responseURL(); 1775 if (url.isEmpty()) 1776 url = pdl->url(); 1777 if (url.isEmpty()) 1778 url = pdl->responseURL(); 1779 if (url.isEmpty()) 1780 url = blankURL(); 1781 1782 didOpenURL(url); 1783 } 1778 } else 1779 didOpenURL(); 1784 1780 1785 1781 LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->uniqueName().string().utf8().data(), … … 2011 2007 KURL url = cachedFrame.url(); 2012 2008 2009 // FIXME: I suspect this block of code doesn't do anything. 2013 2010 if (url.protocolInHTTPFamily() && !url.host().isEmpty() && url.path().isEmpty()) 2014 2011 url.setPath("/"); 2015 2016 m_ workingURL = url;2012 2013 m_hasReceivedFirstData = false; 2017 2014 2018 2015 started(); … … 2111 2108 2112 2109 closeURL(); 2113 didOpenURL( mainResource->url());2110 didOpenURL(); 2114 2111 2115 2112 ASSERT(m_frame->document()); -
trunk/Source/WebCore/loader/FrameLoader.h
r89079 r89312 388 388 void provisionalLoadStarted(); 389 389 390 bool didOpenURL( const KURL&);390 bool didOpenURL(); 391 391 392 392 void scheduleCheckCompleted(); … … 437 437 RefPtr<SerializedScriptValue> m_pendingStateObject; 438 438 439 KURL m_workingURL;439 bool m_hasReceivedFirstData; 440 440 441 441 bool m_needsClear;
Note: See TracChangeset
for help on using the changeset viewer.