Preloads should be cleared when JavaScript cancels loading prematurely.
https://bugs.webkit.org/show_bug.cgi?id=110388

Reviewed by Antti Koivisto.

Source/WebCore:

If a page preloads a resource, but JavaScript aborts parsing for any reason (for example, a
redirect or document.write()), the resource is forever marked a preload and won't be reloaded
even if it's explicitly marked no-cache and the page is reloaded.

Test: http/tests/cache/preload-cleared-after-parrsing-canceled-by-js.html

* dom/Document.cpp:
(WebCore::Document::implicitClose):
(WebCore::Document::finishedParsing):

LayoutTests:

* http/tests/cache/preload-cleared-after-parrsing-canceled-by-js-expected.txt: Added.
* http/tests/cache/preload-cleared-after-parrsing-canceled-by-js.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2: Move pluginLoadPolicy to the page loader client
https://bugs.webkit.org/show_bug.cgi?id=110635
<rdar://problem/13265303>

Reviewed by Sam Weinig.

Move the pluginLoadPolicy callback to the page loader client where it belongs.

* UIProcess/API/C/WKPage.h:
* UIProcess/WebLoaderClient.cpp:
(WebKit::toWKPluginLoadPolicy):
(WebKit):
(WebKit::toPluginModuleLoadPolicy):
(WebKit::WebLoaderClient::pluginLoadPolicy):
* UIProcess/WebLoaderClient.h:
(WebLoaderClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getPluginPath):
* UIProcess/WebUIClient.cpp:
(WebKit):
* UIProcess/WebUIClient.h:
(WebUIClient):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):

Tools: Move pluginLoadPolicy to the page loader client
https://bugs.webkit.org/show_bug.cgi?id=110635

Reviewed by Sam Weinig.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add some checks to DatabaseTracker::getMaxSizeForDatabase() to ensure
that it returns a sane value.
https://bugs.webkit.org/show_bug.cgi?id=110557.

Reviewed by Geoffrey Garen.

No layout test, but there is a quota-test.html attached to bugzilla.
The test is a webpage that can be loaded into multiple tabs to
consuming storage space. Once the test webpages are loaded, you will
need to monitor the database directory and its files to confirm that
growth is bounded. Also try reloading the test in the tabs. At no
time should any database file ever exceed the quota.

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::getMaxSizeForDatabase):



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