IndexedDB: Core upgradeneeded logic
https://bugs.webkit.org/show_bug.cgi?id=92558

Reviewed by Ojan Vafai.

Source/WebCore:

This is the backend webkit logic needed for integer versions. The rest
is in https://bugs.webkit.org/show_bug.cgi?id=89505.

I tried to make use of the existing processPendingCalls and added two
more queues, pendingOpenWithVersionCalls and
pendingSecondHalfOpenWithVersionCalls. The "second half" refers to
how there are two events that need to be fired in response to an
open-with-version call. The "second half" queue holds the open
requests that should immediately follow the caller's upgradeneeded
handler.

No new tests, there are so many they are in their own patch:
https://bugs.webkit.org/show_bug.cgi?id=92560

Though this patch doesn't change any expected behavior anyway, lack of
regressions is what we're hoping for here.

* Modules/indexeddb/IDBBackingStore.h:
(IDBBackingStore):
* Modules/indexeddb/IDBCallbacks.h:
(WebCore::IDBCallbacks::onBlocked):
(WebCore::IDBCallbacks::onUpgradeNeeded):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(IDBDatabaseBackendImpl::PendingOpenCall):
(IDBDatabaseBackendImpl::PendingOpenWithVersionCall):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::callbacks):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::version):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
(WebCore):
(WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
(WebCore::IDBDatabaseBackendImpl::openInternal):
(WebCore::IDBDatabaseBackendImpl::metadata):
(WebCore::IDBDatabaseBackendImpl::setVersion):
(WebCore::IDBDatabaseBackendImpl::setIntVersionInternal):
(WebCore::IDBDatabaseBackendImpl::transactionFinished):
(WebCore::IDBDatabaseBackendImpl::transactionFinishedAndEventsFired):
When an upgradeneeded event is fired in response to an
open-with-version call, the version change transaction must receive its
complete event before processPendingCalls fires a success event at
IDBOpenDBRequest. In the future this should probably be changed
instead to transactionFinishedAndAbortFired and
transactionFinishedAndCompleteFired so that we'll know to fire a
success or error event at IDBOpenDBRequest. Currently, instead of
firing error when there's an abort, we don't fire anything.

(WebCore::IDBDatabaseBackendImpl::processPendingCalls):
Now that this is called after a connection is opened, we unfortunately
lose the invariant that there is only one existing connection when this
is called, but nothing inside this function actually relied on that.
Additionally, the secondHalfOpen calls only ever need to be serviced
in one place: right after a version change transaction completes, so
it could be moved out of here.

(WebCore::IDBDatabaseBackendImpl::registerFrontendCallbacks):
Now that setVersion and deleteDatabase calls are queued up behind
secondHalfOpen calls, we have to service those queues when
secondHalfOpen calls complete, which is here.  So call
processPendingCalls().

(WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
(WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):
(WebCore::IDBDatabaseBackendImpl::close):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseCallbacks.h:
(WebCore::IDBDatabaseCallbacks::onVersionChange):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::open):
This is refactored some so that the call to openConection{WithVersion}
happens once, at the end.

* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::getIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::createIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion):
(WebCore):
(WebCore::IDBLevelDBBackingStore::deleteDatabase):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(IDBLevelDBBackingStore):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::commit):
See above comments about transactionFinishedAndEventsFired. I tried
moving the call to transactionFinished after the events were fired but
that failed some asserts. But changing those asserts is still an
alternative to splitting up transactionFinished as is done here.

Source/WebKit/chromium:

Update overridden methods to match new signatures.

* tests/IDBAbortOnCorruptTest.cpp:
(WebCore::FailingBackingStore::createIDBDatabaseMetaData):
* tests/IDBFakeBackingStore.h:


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
V8Proxy::currentContext() doesn't do anything and should be removed
https://bugs.webkit.org/show_bug.cgi?id=93041

Reviewed by Eric Seidel.

Source/WebCore:

It's just a wrapper for GetCurrent().

* bindings/v8/DateExtension.cpp:
(WebCore::DateExtension::setAllowSleep):
* bindings/v8/V8NPUtils.cpp:
(WebCore::convertV8ObjectToNPVariant):
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::retrieve):
(WebCore::V8Proxy::mainWorldContext):
* bindings/v8/V8Proxy.h:
(V8Proxy):
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::getJSListenerFunctions):

Source/WebKit/chromium:

* src/WebBindings.cpp:
(WebKit::makeIntArrayImpl):
(WebKit::makeStringArrayImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] deviceViewportSize cleanup
https://bugs.webkit.org/show_bug.cgi?id=92794

Patch by Alexandre Elias <aelias@google.com> on 2012-08-02
Reviewed by Adrienne Walker.

In the future, CSS layout size will become increasingly disassociated
from physical device size, and it will become impossible to infer one
from the other inside the compositor.  Therefore, this patch allows
deviceViewportSize to be explicitly passed in by the outside client.

I also renamed the existing viewportSize field to "layoutViewportSize"
for clarity, and converted its uses to deviceViewportSize since
that is more appropriate.

I had to add some default-value scaffolding to WebLayerTreeView in
order to avoid breaking ui/compositor.  We can delete it once that's
updated.

Source/Platform:

* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):

Source/WebCore:

No new tests (covered by existing tests).

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::finishCommitOnImplThread):
(WebCore::CCLayerTreeHost::setViewportSize):
(WebCore::CCLayerTreeHost::updateLayers):
(WebCore::CCLayerTreeHost::setDeviceScaleFactor):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
(WebCore::CCLayerTreeHost::layoutViewportSize):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::canDraw):
(WebCore::CCLayerTreeHostImpl::startPageScaleAnimation):
(WebCore::CCLayerTreeHostImpl::setViewportSize):
(WebCore::CCLayerTreeHostImpl::setDeviceScaleFactor):
(WebCore::CCLayerTreeHostImpl::updateMaxScrollPosition):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
(WebCore::CCLayerTreeHostImpl::layoutViewportSize):

Source/WebKit/chromium:

* src/WebLayerTreeView.cpp:
(WebKit::WebLayerTreeView::setViewportSize):
(WebKit::WebLayerTreeView::layoutViewportSize):
(WebKit):
(WebKit::WebLayerTreeView::deviceViewportSize):
(WebKit::WebLayerTreeView::setDeviceScaleFactor):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::paint):
(WebKit::WebViewImpl::updateLayerTreeViewport):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Upstream GraphicsLayerClient::contentsVisible()
https://bugs.webkit.org/show_bug.cgi?id=93040

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-08-02
Reviewed by George Staikos.

Our LayerTiler uses both proactive and reactive rendering to populate
tiles. If contentsVisible() is accurate, it will cause the right tiles
to be rendered. Failing that, when a dirty tile is found to be visible
on the compositing thread, a render job is scheduled.

This is not currently testable using BlackBerry testing infrastructure.

* platform/graphics/GraphicsLayerClient.h:
(GraphicsLayerClient): New BlackBerry-specific method "contentsVisible" added.
* rendering/RenderLayerBacking.cpp:
(WebCore):
(WebCore::RenderLayerBacking::contentsVisible): BlackBerry-specific implementation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r124540.
http://trac.webkit.org/changeset/124540
https://bugs.webkit.org/show_bug.cgi?id=93055

Broke compile on Chromium Win bot (Requested by dimich on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-02

Source/WebCore:

* Modules/indexeddb/IDBBackingStore.h:
(IDBBackingStore):
* Modules/indexeddb/IDBCallbacks.h:
(IDBCallbacks):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
(WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
(WebCore::IDBDatabaseBackendImpl::openInternal):
(WebCore::IDBDatabaseBackendImpl::metadata):
(WebCore::IDBDatabaseBackendImpl::setVersion):
(WebCore::IDBDatabaseBackendImpl::transactionFinished):
(WebCore::IDBDatabaseBackendImpl::processPendingCalls):
(WebCore::IDBDatabaseBackendImpl::registerFrontendCallbacks):
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):
(WebCore::IDBDatabaseBackendImpl::close):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseCallbacks.h:
(IDBDatabaseCallbacks):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::open):
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::getIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::createIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::deleteDatabase):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(IDBLevelDBBackingStore):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::commit):

Source/WebKit/chromium:

* tests/IDBAbortOnCorruptTest.cpp:
(WebCore::FailingBackingStore::createIDBDatabaseMetaData):
* tests/IDBFakeBackingStore.h:

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