Some small loader refinements and refactoring
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Apr 2014 19:10:56 +0000 (19:10 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Apr 2014 19:10:56 +0000 (19:10 +0000)
commit00ee2ae88357566590f954d07a3f4a1de17be02a
tree922553c061a5764f27bd92d1275e4139ac11e8f4
parentc87b2703238308141183576c0ca83c4e8629a934
Some small loader refinements and refactoring
https://bugs.webkit.org/show_bug.cgi?id=131541

Reviewed by Alexey Proskuryakov.

Cut down on use of ResourceLoader::handle, which always returns null when
using a network process. Also streamlined conditionals and did some other
small refactoring.

* loader/DocumentLoader.h: Use references rather than pointers for SchedulePair.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didChangePriority): Use m_handle instead of handle(),
since we'd like to delete handle() entirely soon.
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge): Ditto.
(WebCore::ResourceLoader::schedule): Added.
(WebCore::ResourceLoader::unschedule): Ditto.
* loader/ResourceLoader.h: Rearranged header to eliminate nested conditionals.
Added schedule and unschedule functions for Mac.

* loader/mac/DocumentLoaderMac.cpp:
(WebCore::scheduleAll): Changed to take a reference and call ResourceLoader::schedule.
(WebCore::unscheduleAll): Ditto.
(WebCore::DocumentLoader::schedule): Ditto.
(WebCore::DocumentLoader::unschedule): Ditto.

* page/mac/PageMac.cpp:
(WebCore::Page::addSchedulePair): Pass a reference rather than a pointer to schedule.
(WebCore::Page::removeSchedulePair): Ditto.

* platform/network/ResourceHandle.h: Did a bit of reformatting and reorganizing of
conditionals.

* platform/network/ResourceHandleInternal.h: Removed a tiny bit of unneeded declaration.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::schedule): Updated to take a reference rather than a pointer.
(WebCore::ResourceHandle::unschedule): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/mac/DocumentLoaderMac.cpp
Source/WebCore/page/mac/PageMac.cpp
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/mac/ResourceHandleMac.mm