Title: [114062] trunk/Source/WebCore
Revision
114062
Author
[email protected]
Date
2012-04-12 18:07:27 -0700 (Thu, 12 Apr 2012)

Log Message

Remove FrameLoader:m_isLoadingMainResource, since it is always
false at the only point it is checked.
https://bugs.webkit.org/show_bug.cgi?id=83819

Reviewed by Adam Barth.

No new tests, no functionality change intended.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::end): Merge with endIfNotLoadingMainResource(), always end, assert that we're still attached.
* loader/DocumentWriter.h:
* loader/FrameLoader.cpp:
* loader/FrameLoader.h: Remove isLoadingMainResource(), didEndDocument(), and m_isLoadingMainResource.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114061 => 114062)


--- trunk/Source/WebCore/ChangeLog	2012-04-13 01:03:35 UTC (rev 114061)
+++ trunk/Source/WebCore/ChangeLog	2012-04-13 01:07:27 UTC (rev 114062)
@@ -1,3 +1,19 @@
+2012-04-12  Nate Chapin  <[email protected]>
+
+        Remove FrameLoader:m_isLoadingMainResource, since it is always
+        false at the only point it is checked.
+        https://bugs.webkit.org/show_bug.cgi?id=83819
+
+        Reviewed by Adam Barth.
+
+        No new tests, no functionality change intended.
+
+        * loader/DocumentWriter.cpp:
+        (WebCore::DocumentWriter::end): Merge with endIfNotLoadingMainResource(), always end, assert that we're still attached.
+        * loader/DocumentWriter.h:
+        * loader/FrameLoader.cpp:
+        * loader/FrameLoader.h: Remove isLoadingMainResource(), didEndDocument(), and m_isLoadingMainResource.
+
 2012-04-12  Rob Buis  <[email protected]>
 
         XMLSerializer().serializeToString() doesn't generate the XML declaration markup like Opera and Firefox

Modified: trunk/Source/WebCore/loader/DocumentWriter.cpp (114061 => 114062)


--- trunk/Source/WebCore/loader/DocumentWriter.cpp	2012-04-13 01:03:35 UTC (rev 114061)
+++ trunk/Source/WebCore/loader/DocumentWriter.cpp	2012-04-13 01:07:27 UTC (rev 114062)
@@ -220,17 +220,9 @@
 
 void DocumentWriter::end()
 {
-    m_frame->loader()->didEndDocument();
-    endIfNotLoadingMainResource();
-}
+    ASSERT(m_frame->page());
+    ASSERT(m_frame->document());
 
-void DocumentWriter::endIfNotLoadingMainResource()
-{
-    // FIXME: This isn't really the check we should be doing. We should re-work
-    // how we end parsing to match the model in HTML5.
-    if (m_frame->loader()->isLoadingMainResource() || !m_frame->page() || !m_frame->document())
-        return;
-
     // The parser is guaranteed to be released after this point. begin() would
     // have to be called again before we can start writing more data.
     m_state = FinishedWritingState;

Modified: trunk/Source/WebCore/loader/DocumentWriter.h (114061 => 114062)


--- trunk/Source/WebCore/loader/DocumentWriter.h	2012-04-13 01:03:35 UTC (rev 114061)
+++ trunk/Source/WebCore/loader/DocumentWriter.h	2012-04-13 01:07:27 UTC (rev 114062)
@@ -70,7 +70,6 @@
 private:
     PassRefPtr<Document> createDocument(const KURL&);
     void clear();
-    void endIfNotLoadingMainResource();
 
     Frame* m_frame;
 

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (114061 => 114062)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2012-04-13 01:03:35 UTC (rev 114061)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2012-04-13 01:07:27 UTC (rev 114062)
@@ -184,7 +184,6 @@
     , m_wasUnloadEventEmitted(false)
     , m_pageDismissalEventBeingDispatched(NoDismissal)
     , m_isComplete(false)
-    , m_isLoadingMainResource(false)
     , m_hasReceivedFirstData(false)
     , m_needsClear(false)
     , m_checkTimer(this, &FrameLoader::checkTimerFired)
@@ -402,7 +401,6 @@
     }
 
     m_isComplete = true; // to avoid calling completed() in finishedParsing()
-    m_isLoadingMainResource = false;
     m_didCallImplicitClose = true; // don't want that one either
 
     if (m_frame->document() && m_frame->document()->parsing()) {
@@ -465,7 +463,6 @@
     m_frame->editor()->clearLastEditCommand();
 
     m_isComplete = false;
-    m_isLoadingMainResource = true;
     m_didCallImplicitClose = false;
 
     // If we are still in the process of initializing an empty document then
@@ -613,7 +610,6 @@
     m_needsClear = true;
     m_isComplete = false;
     m_didCallImplicitClose = false;
-    m_isLoadingMainResource = true;
     m_frame->document()->setReadyState(Document::Loading);
 
     if (m_pendingStateObject) {
@@ -646,11 +642,6 @@
     history()->restoreDocumentState();
 }
 
-void FrameLoader::didEndDocument()
-{
-    m_isLoadingMainResource = false;
-}
-
 void FrameLoader::finishedParsing()
 {
     m_frame->injectUserScripts(InjectAtDocumentEnd);

Modified: trunk/Source/WebCore/loader/FrameLoader.h (114061 => 114062)


--- trunk/Source/WebCore/loader/FrameLoader.h	2012-04-13 01:03:35 UTC (rev 114061)
+++ trunk/Source/WebCore/loader/FrameLoader.h	2012-04-13 01:07:27 UTC (rev 114062)
@@ -131,7 +131,6 @@
     void cancelAndClear();
     void clear(bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true);
 
-    bool isLoadingMainResource() const { return m_isLoadingMainResource; }
     bool isLoading() const;
     bool frameHasLoaded() const;
 
@@ -200,7 +199,6 @@
 
     // Callbacks from DocumentWriter
     void didBeginDocument(bool dispatchWindowObjectAvailable);
-    void didEndDocument();
     void willSetEncoding();
 
     void handledOnloadEvents();
@@ -402,7 +400,6 @@
     bool m_wasUnloadEventEmitted;
     PageDismissalType m_pageDismissalEventBeingDispatched;
     bool m_isComplete;
-    bool m_isLoadingMainResource;
 
     RefPtr<SerializedScriptValue> m_pendingStateObject;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to