Clean up CachedResource::load(). Collapse its
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 01:29:20 +0000 (01:29 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2011 01:29:20 +0000 (01:29 +0000)
commitca97b289ad29c50a0be9bf717e851052018a9cc9
treed93c0317b7a76d0851bb9ed0c78bdad83efd9e4c
parentf19b83e1a8dfe17aba9fcd0ac82292339d89b935
Clean up CachedResource::load(). Collapse its
logic into a single callsite, taking just a
CachedResourceLoader and a ResourceLoaderOptions.

1. Its 'incremental' parameter is redundant.
2. With 'incremental' removed, the SecurityCheckPolicy is the only
   parameter difference between the CachedResource::load() variants.
   Making it a part of ResourceLoaderOptions removes yet another random
   enum that is passed around individually.
3. We currently have to call setResourceLoaderOptions() before load() on a
   new CachedResource, so we should just take the ResourceLoaderOptions in load().

https://bugs.webkit.org/show_bug.cgi?id=67443

Reviewed by Antti Koivisto.

No new tests, refactor only.

* loader/DocumentThreadableLoader.cpp:
* loader/FrameLoaderTypes.h: Move SecurityCheckPolicy to ResourceLoaderOptions.h.
* loader/MainResourceLoader.cpp:
* loader/NetscapePlugInStreamLoader.cpp:
* loader/ResourceLoadScheduler.cpp:
* loader/ResourceLoadScheduler.h:
* loader/ResourceLoader.cpp: Enforce SecurityCheckPolicy here instead of SubresourceLoader.
* loader/ResourceLoaderOptions.h: Store SecurityCheckPolicy on ResourceLoaderOptions.
* loader/SubresourceLoader.cpp:
* loader/SubresourceLoader.h:
* loader/cache/CachedFont.cpp:
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::defaultCachedResourceOptions): Define the default ResourceLoaderOptions for
    CachedResource loads here instead of as a default parameter on requestResource().
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::didReceiveData): Remove m_incremental, since its purpose
    is already enforced in the data() implementation of every CachedResource that doesn't want
    incremental loads.
* loader/cache/CachedResourceRequest.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/FrameLoaderTypes.h
Source/WebCore/loader/MainResourceLoader.cpp
Source/WebCore/loader/NetscapePlugInStreamLoader.cpp
Source/WebCore/loader/ResourceLoadScheduler.cpp
Source/WebCore/loader/ResourceLoadScheduler.h
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoaderOptions.h
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/SubresourceLoader.h
Source/WebCore/loader/cache/CachedFont.cpp
Source/WebCore/loader/cache/CachedFont.h
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.h
Source/WebCore/loader/cache/CachedResourceRequest.cpp
Source/WebCore/loader/cache/CachedResourceRequest.h
Source/WebCore/loader/icon/IconLoader.cpp