REGRESSION (r150169): Images from file: URLs display after a delay even though they were preloaded by JavaScript
https://bugs.webkit.org/show_bug.cgi?id=116906
<rdar://problem/13991927>

Reviewed by Andreas Kling.

Writing a test for this is blocked on https://webkit.org/b/116199.

Some WebKit clients use JavaScript to preload images from disk so that
subsequent loads will display immediately from the memory cache. By not
caching non-HTTP sub-resources in memory, we break this common pattern.
This change restricts r150169 to only apply to cached main resources.
Sub-resources will again be cached indefinitely as they were prior to
r150169.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::freshnessLifetime): If this is a non-HTTP
main resource from a scheme that should not be cached indefinitely,
return 0 for the freshness lifetime. For other non-HTTP cached
resources, return an indefinite freshness lifetime.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build fix after r150837
https://bugs.webkit.org/show_bug.cgi?id=116904

Unreviewed build fix.

Patch by Seokju Kwon <seokju.kwon@gmail.com> on 2013-05-28

* GNUmakefile.am:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed: Adding myself to committers list.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in WebCore::SubresourceLoader::releaseResources when connection fails
https://bugs.webkit.org/show_bug.cgi?id=87743

Don't do anything complicated in SubresourceLoader::releaseResources(),
just clear variables. With this patch, releaseResources() will still
assert in debug builds if it is called twice, but it will safely execute
in release.

Reviewed by Darin Adler.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::cleanupForError): Pull shared cleanup code out of didFail()
    and cancel() into a helper.
(WebCore::ResourceLoader::cancel): Merge a couple variables into an enum, check for
    reentrancy from within didCancel().
* loader/ResourceLoader.h: Replace m_calledWillCancel and m_cancelled with an enum.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading): Don't call ResourceLoader::didFinishLoading(),
    put finish() in the middle of the process.
(WebCore::SubresourceLoader::didFail): Don't call ResourceLoader::didFail(), put finish()
    in the middle of the process.
(WebCore::SubresourceLoader::didCancel):
(WebCore::SubresourceLoader::notifyDone): Do the non-trivial work previous done in releaseResources(),
    most importantly calling loadDone().
(WebCore::SubresourceLoader::releaseResources): Only do simple variable clearing here.
* loader/SubresourceLoader.h:
(SubresourceLoader):
* loader/cache/CachedResource.cpp: Split stopLoading() into cancelLoad() (which notifies clients)
    and clearLoader() (which just nulls m_loader).
* loader/cache/CachedResource.h:
* loader/chromium/ResourceLoaderChromium.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150867 268f45cc-cd09-0410-ab3c-d52691b4dbfc