Move empty loading to DocumentLoader, simplify FrameLoader::init()
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Nov 2012 18:00:55 +0000 (18:00 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Nov 2012 18:00:55 +0000 (18:00 +0000)
commit6da46814d6db60fb284ea368d90262d785f6bc40
treea7d853a4ffab7fa3186bdd87d8d6173f66f1f7c6
parent96e9b069f6d246a34b046401408a696e3ff124b2
Move empty loading to DocumentLoader, simplify FrameLoader::init()
https://bugs.webkit.org/show_bug.cgi?id=101512

Reviewed by Adam Barth.

Source/WebCore:

No new tests, though several outputs changed because we no longer send resource
    load callbacks for empty loads.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::clearMainResourceLoader):
(WebCore::DocumentLoader::isLoadingInAPISense):
(WebCore::DocumentLoader::isLoadingMainResource):
(WebCore::DocumentLoader::maybeLoadEmpty):
(WebCore):
(WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource
     loads directly here.
* loader/DocumentLoader.h:
(DocumentLoader):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader): Initialize some variables whose values
    were previously being reset in init(). Given that the FrameLoader is in
    an inconsistent state before init() is called anyway, there doesn't seem
    to be a disadvantage to just initializing them to their post-init() values.
(WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of
    doing a bunch of direct calls to functions FrameLoader shouldn't know about.
* loader/FrameLoaderStateMachine.cpp:
(WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
* loader/FrameLoaderStateMachine.h:
* loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load.
(WebCore::MainResourceLoader::loadNow): This only returned true when an empty
    load got deferred, which won't happen now. Return void and always treat
    as returning false.
* loader/MainResourceLoader.h:
(MainResourceLoader):

Tools:

Chromium DRT has some code that doesn't play nicely with empty urls and incorrectly
interprets them as a non-empty load. This ensures
http/tests/navigation/new-window-redirect-history.html continues to pass
in chromium.

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::updateForCommittedLoad):

LayoutTests:

Don't expect resource load callbacks for empty loads.

* http/tests/inspector/network/network-iframe-load-and-delete.html:
* http/tests/loading/redirect-methods-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/network-iframe-load-and-delete.html
LayoutTests/http/tests/loading/redirect-methods-expected.txt
LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt
LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt
LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoaderStateMachine.cpp
Source/WebCore/loader/FrameLoaderStateMachine.h
Source/WebCore/loader/MainResourceLoader.cpp
Source/WebCore/loader/MainResourceLoader.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/WebViewHost.cpp