IndexedDB: One transaction coordinator per database
https://bugs.webkit.org/show_bug.cgi?id=97501

Reviewed by Tony Chang.

Source/WebCore:

Per the IDB spec, transactions only need to be sequenced within databases.
The implementation was using one coordinator per factory backend (effectively
a singleton), which would prevent parallel execution of transactions in different
databases. Moved ownership of the transaction coordinator to the database backend.

Tests: storage/indexeddb/transaction-coordination-across-databases.html
       storage/indexeddb/transaction-readwrite-exclusive.html

* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::create):
(WebCore):
(WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::deleteDatabase):
(WebCore::IDBFactoryBackendImpl::open):
* Modules/indexeddb/IDBFactoryBackendImpl.h:
(WebCore):
(IDBFactoryBackendImpl):
* Modules/indexeddb/IDBTransactionCoordinator.cpp:
(WebCore::IDBTransactionCoordinator::create):
(WebCore::IDBTransactionCoordinator::IDBTransactionCoordinator):
* Modules/indexeddb/IDBTransactionCoordinator.h:
(IDBTransactionCoordinator):

Source/WebKit/chromium:

Remove obsolete argument.

* tests/IDBDatabaseBackendTest.h:

LayoutTests:

Test that transactions can be parallelized across databases, and ensure that
read/write transactions with overlapping scopes are not parallelized within a
database.

* storage/indexeddb/resources/transaction-coordination-across-databases.js: Added.
* storage/indexeddb/resources/transaction-readwrite-exclusive.js: Added.
* storage/indexeddb/transaction-coordination-across-databases-expected.txt: Added.
* storage/indexeddb/transaction-coordination-across-databases.html: Added.
* storage/indexeddb/transaction-readwrite-exclusive-expected.txt: Added.
* storage/indexeddb/transaction-readwrite-exclusive.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash after clicking in plugin at kauaiexplorer.com
<rdar://problem/11525987/> and https://bugs.webkit.org/show_bug.cgi?id=90925

Patch by Akash Vaswani <avaswani@apple.com> on 2012-09-25
Reviewed by Sam Weinig.

Source/WebKit2:

Bug: Clicking the plugin to navigate away from the page caused the browser to crash.
     This is because it is possible for a beforeunload handler to destroy the plugin
     while it is still needed. In this case the handler set visibility to "none" and
     then accessed a property on the plugin script object. This forced a layout
     that destroyed the plugin.
Fix: Protecting PluginView objects until they are no longer required.
     This was done by adding a RefPtr at the beginning of performURLRequest()

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performURLRequest):

LayoutTests:

* http/tests/plugins/get-url-beforeunload-destroys-plugin-expected.txt: Added.
* http/tests/plugins/get-url-beforeunload-destroys-plugin.html: Added.
* http/tests/plugins/resources/notify-done.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add missing support for Geolocation tests on WebKit2
https://bugs.webkit.org/show_bug.cgi?id=97518

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-25
Reviewed by Sam Weinig.

Source/WebKit2: 

The existing API for reporting error does not support passing and error message.

The interface UIProcess<->WebProcess is changed to take an error message, the
existing API now pass a null String, and the new function
WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage() provide
the extended support with error message.

* UIProcess/API/C/WKGeolocationManager.cpp:
(WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage):
* UIProcess/API/C/WKGeolocationManager.h:
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition):
* UIProcess/WebGeolocationManagerProxy.h:
(WebGeolocationManagerProxy):
* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::didFailToDeterminePosition):
* WebProcess/Geolocation/WebGeolocationManager.h:
(WebGeolocationManager):
* WebProcess/Geolocation/WebGeolocationManager.messages.in:

Tools: 

There are two main features added to the tooling to make the test run:
-Add support for error reporting for position errors through setMockGeolocationPositionUnavailableError.
-Support the 3 states permission: undefined-allowed-denied.

* WebKitTestRunner/GeolocationProviderMock.cpp:
(WTR::GeolocationProviderMock::GeolocationProviderMock):
(WTR::GeolocationProviderMock::setPosition):
(WTR::GeolocationProviderMock::setPositionUnavailableError):
(WTR::GeolocationProviderMock::startUpdating):
(WTR::GeolocationProviderMock::sendPositionIfNeeded):
(WTR::GeolocationProviderMock::sendErrorIfNeeded):
* WebKitTestRunner/GeolocationProviderMock.h:
(GeolocationProviderMock):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::setMockGeolocationPositionUnavailableError):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(InjectedBundle):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMockGeolocationPositionUnavailableError):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(TestRunner):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::TestController):
(WTR::decidePolicyForGeolocationPermissionRequest):
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::setGeolocationPermission):
(WTR::TestController::setMockGeolocationPosition):
(WTR::TestController::setMockGeolocationPositionUnavailableError):
(WTR::TestController::handleGeolocationPermissionRequest):
(WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible):
* WebKitTestRunner/TestController.h:
(TestController):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

LayoutTests: 

Unskip almost all the layout tests.

* platform/wk2/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Webkit 1.8.2 fails to build with MinGW with spellchecking enabled
https://bugs.webkit.org/show_bug.cgi?id=93255

Patch by Paweł Forysiuk <tuxator@o2.pl> on 2012-09-25
Reviewed by Martin Robinson.

Build dies because of invalid cast. Additionaly word "interface" is in use with MinGW compiler.

* WebCoreSupport/TextCheckerClientGtk.cpp:
(WebKit::TextCheckerClientGtk::checkSpellingOfString): Use String to avoid unneded casting
* webkit/webkitspellcheckerenchant.cpp:
(webkit_spell_checker_enchant_spell_checker_interface_init): rename interface -> checkerInterface

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Rebaseline css1/ tests for Android.
https://bugs.webkit.org/show_bug.cgi?id=96398

Unreviewed rebaselining.

* platform/chromium-android/css1/: 136 new .txt and .png results.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129538 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25  David Grogan  <dgrogan@chromium.org>

        Unreviewed. Change some svn:eol-style properties from native to LF.

        * fast/events/message-channel-gc-2-expected.txt
        * fast/events/message-channel-gc-3-expected.txt
        * fast/events/message-channel-gc-4-expected.txt
        * fast/events/message-channel-gc-expected.txt
        * fast/events/message-channel-listener-circular-ownership-expected.txt



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129539 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Updating expectations after r129529.

* platform/chromium-mac-snowleopard/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png:
* platform/chromium-mac-snowleopard/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-mac-snowleopard/tables/mozilla/bugs/bug1318-expected.png:
* platform/chromium-mac-snowleopard/tables/mozilla/bugs/bug55527-expected.png:
* platform/chromium-mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png:
* platform/chromium-mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/chromium-mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
* platform/chromium-mac/tables/mozilla/bugs/bug1318-expected.png:
* platform/chromium-mac/tables/mozilla/bugs/bug1318-expected.txt:
* platform/chromium-mac/tables/mozilla/bugs/bug55527-expected.png:
* platform/chromium-mac/tables/mozilla/bugs/bug55527-expected.txt: Removed.
* platform/efl/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Removed.
* platform/efl/tables/mozilla/bugs/bug55527-expected.txt: Removed.
* platform/gtk/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Removed.
* svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][EFL] Disk cache is never dumped to disk in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=97583

Reviewed by Martin Robinson.

The problem is that WebProcess::platformTerminate(), where the
cache is currently dumped, is not called when the web process
finishes because the UI process closes the connection. The cache
is created and loaded in the main() so it can also be flushed and
dumped there, so that we also make sure it's always called when
the process finishes normally when the main loop quits.

* WebProcess/efl/WebProcessMainEfl.cpp:
(WebKit::WebProcessMainEfl): Flush and dump the disk cache when
the main loop returns.
* WebProcess/gtk/WebProcessMainGtk.cpp:
(WebKit::WebProcessMainGtk): Ditto.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformTerminate): Do not flush and dump
the disk cache.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25  David Grogan  <dgrogan@chromium.org>

Unreviewed. Change some more svn:eol-style properties from native to LF.

* LayoutTests/fast/events/message-port-constructor-for-deleted-document-expected.txt
* LayoutTests/fast/events/message-port-deleted-document-expected.txt
* LayoutTests/fast/events/message-port-deleted-frame-expected.txt
* LayoutTests/fast/events/message-port-expected.txt
* LayoutTests/fast/events/message-port-inactive-document-expected.txt


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