DatabaseProcess: Implement openTransaction()
https://bugs.webkit.org/show_bug.cgi?id=125794

Reviewed by Darin Adler.

This patch hooks up all of the necessary infrastructure to open a uniquely
identified transaction in the DatabaseProcess backing store.

The transaction itself is not yet functional.

Add openTransaction messaging to the WebProcess side:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::isClosed):
(WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
(WebKit::WebIDBServerConnection::didGetOrEstablishIDBDatabaseMetadata):
(WebKit::WebIDBServerConnection::openTransaction):
(WebKit::WebIDBServerConnection::didOpenTransaction):
(WebKit::WebIDBServerConnection::deleteObjectStore):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

Add openTransaction messaging to the DatabaseProcess side:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::openTransaction):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

Add a hashable identifier that represents a connection/transactionID pair:
* DatabaseProcess/IndexedDB/IDBTransactionIdentifier.h: Added.
(WebKit::IDBTransactionIdentifier::IDBTransactionIdentifier):
(WebKit::IDBTransactionIdentifier::isolatedCopy):
(WebKit::IDBTransactionIdentifier::isEmpty):
(WebKit::IDBTransactionIdentifier::hash):
(WebKit::IDBTransactionIdentifier::operator==):
(WebKit::IDBTransactionIdentifier::isHashTableDeletedValue):
(WebKit::IDBTransactionIdentifierHash::hash):
(WebKit::IDBTransactionIdentifierHash::equal):
(WebKit::IDBTransactionIdentifierHashTraits::isEmptyValue):

Allow that identifier to be cross-thread copied:
* Shared/WebCrossThreadCopier.cpp:
(WebCore::::copy):
* Shared/WebCrossThreadCopier.h:

Ask the backing store to open this uniquely identified transaction:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::openTransaction):
(WebKit::UniqueIDBDatabase::openBackingStoreTransaction):
(WebKit::UniqueIDBDatabase::didOpenBackingStoreTransaction):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

Add the backing store implementation for opening a transaction:
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::~UniqueIDBDatabaseBackingStoreSQLite):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

Object to represent the backing store transaction itself, to be used in future patches:
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp:
(WebKit::SQLiteIDBTransaction::SQLiteIDBTransaction):
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
(WebKit::SQLiteIDBTransaction::create):
(WebKit::SQLiteIDBTransaction::identifier):

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Upstream WebCore/svg changes
https://bugs.webkit.org/show_bug.cgi?id=125784

Reviewed by Darin Adler.

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::willRespondToMouseClickEvents): Added.
* svg/SVGAElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::parseAttribute): Added attribute listeners for touch{cancel, end, move, start},
and gesture{change, end, start}.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Upstream WebCore/history changes
https://bugs.webkit.org/show_bug.cgi?id=125769

Reviewed by Darin Adler.

* history/BackForwardClient.h:
* history/BackForwardList.cpp:
(WebCore::BackForwardList::current): Added; guard by PLATFORM(IOS). Also added FIXME comment.
(WebCore::BackForwardList::setCurrent): Added; guard by PLATFORM(IOS). Also added FIXME comment.
(WebCore::BackForwardList::clearAllPageCaches): Added; guarded by PLATFORM(IOS).
* history/BackForwardList.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore): Added iOS-specific code.
(WebCore::CachedFrame::CachedFrame): Ditto.
* history/CachedPage.cpp:
(WebCore::CachedPage::restore): Ditto.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem): Ditto.
* history/HistoryItem.h:
(WebCore::HistoryItem::scale): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::scaleIsInitial): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::setScale): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::viewportArguments): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::setViewportArguments): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::bookmarkID): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::setBookmarkID): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::sharedLinkUniqueIdentifier): Added; guarded by PLATFORM(IOS).
(WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Added; guarded by PLATFORM(IOS).
* history/PageCache.cpp:
(WebCore::logCanCacheFrameDecision): Added iOS-specific code.
(WebCore::logCanCachePageDecision): Ditto.
(WebCore::PageCache::canCachePageContainingThisFrame): Ditto.
(WebCore::PageCache::canCache): Ditto.
(WebCore::PageCache::pruneToCapacityNow): Added.
* history/PageCache.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cache getters and custom accessors on the prototype chain
https://bugs.webkit.org/show_bug.cgi?id=125602

Reviewed by Michael Saboff.

Source/JavaScriptCore:

Support caching of custom getters and accessors on the prototype chain.
This is relatively trivial and just requires a little work compared to
the direct access mode as we're under more register pressure.

* bytecode/StructureStubInfo.h:
  Removed the unsued initGetByIdProto as it was confusing to still have it present.
* jit/Repatch.cpp:
(JSC::generateProtoChainAccessStub):
(JSC::tryCacheGetByID):
(JSC::tryBuildGetByIDList):

Tools:

Make sure bencher scripts also make noInline exist

* Scripts/bencher:

LayoutTests:

Added a bunch of new tests

* js/regress/chain-custom-getter-expected.txt: Added.
* js/regress/chain-custom-getter.html: Added.
* js/regress/chain-getter-access-expected.txt: Added.
* js/regress/chain-getter-access.html: Added.
* js/regress/proto-custom-getter-expected.txt: Added.
* js/regress/proto-custom-getter.html: Added.
* js/regress/proto-getter-access-expected.txt: Added.
* js/regress/proto-getter-access.html: Added.
* js/regress/resources/regress-pre.js:
  Made sure that noInline always exists (either using testRunner.neverInlineFunction
  or a no-op function if nothing else is available)
* js/regress/script-tests/chain-custom-getter.js: Added.
(foo):
* js/regress/script-tests/chain-getter-access.js: Added.
(o.get value):
(foo):
* js/regress/script-tests/proto-custom-getter.js: Added.
(foo):
* js/regress/script-tests/proto-getter-access.js: Added.
(o.get value):
(foo):
* js/regress/script-tests/simple-custom-getter.js: Added.
(cycles.30000.numberObject.Number.foo):
* js/regress/script-tests/simple-getter-access.js: Added.
(o.get value):
(foo):
* js/regress/simple-custom-getter-expected.txt: Added.
* js/regress/simple-custom-getter.html: Added.
* js/regress/simple-getter-access-expected.txt: Added.
* js/regress/simple-getter-access.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore: [Win] Remove dead code after conversion to VS2013
https://bugs.webkit.org/show_bug.cgi?id=125795

Reviewed by Darin Adler.

* API/tests/testapi.c: Remove local nan implementation

Source/WebCore: [Win] Remove dead code after converstion to VS2013
https://bugs.webkit.org/show_bug.cgi?id=125795

Reviewed by Darin Adler.

* WebCorePrefix.h: Remove VS2012 include kludge.
* loader/FTPDirectoryParser.cpp: Remove gmtime workaround code.
* page/DOMWindow.cpp: Remove older pointer-based open implementation.
* page/DOMWindow.h: Ditto
* platform/text/TextEncodingRegistry.cpp:
(WebCore::TextEncodingNameHash::equal): Remove optimization bug workaround
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend): Remove compiler workaround

Source/WebKit: [Win] Remove dead code after conversion to VS2013
https://bugs.webkit.org/show_bug.cgi?id=125795

Reviewed by Darin Adler.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Remove unused function exports.

Source/WTF: [Win] Remove dead code after conversion to VS2013
https://bugs.webkit.org/show_bug.cgi?id=125795

Reviewed by Darin Adler.

* wtf/Assertions.h: Include <inttypes.h> now that it exists.
* wtf/Compiler.h: Update compiler checks for VS2013, and
enable support for NEVER_INLINE
* wtf/HashFunctions.h:
(WTF::PtrHash::hash): Remove compiler workaround.
* wtf/MathExtras.h: Remove C99 functions that are now supplied
by the MS runtime library.
* wtf/Platform.h: Remove old MSVC support flags.
* wtf/StdLibExtras.h: Remove old MSVC workaround code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Apply overhang shadow and linen to UI-side layers
https://bugs.webkit.org/show_bug.cgi?id=125807

Source/WebCore:

Reviewed by Tim Horton.

With UI-side compositing, we need to apply the overhang shadow and linen
background to layers in the UI process. Achieve this by setting a "custom
appearance" flag on layers that need a shadow or linen background, and
migrating this flag to the UI process. Static functions on ScrollbarThemeMac
are exposed to do the actual setting.

* WebCore.exp.in: Export ScrollbarThemeMac and GraphicsLayerCA functions.
* WebCore.xcodeproj/project.pbxproj: ScrollbarThemeMac.h and ScrollbarThemeComposite.h
need to be Private.
* platform/graphics/GraphicsLayer.cpp: Initialize m_customAppearance.
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h: Getter/setter for CustomAppearance.
(WebCore::GraphicsLayer::setCustomAppearance):
(WebCore::GraphicsLayer::customAppearance):
* platform/graphics/ca/GraphicsLayerCA.cpp: Update CustomAppearanceChanged as
we do other properties.
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateCustomAppearance):
(WebCore::GraphicsLayerCA::setCustomAppearance):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm: When we have a custom
appearance, use ScrollbarThemeMac functions to update the layer. Ensure
that if the bounds change, we update the shadow (whose path depends on the bounds).
(PlatformCALayerMac::PlatformCALayerMac):
(PlatformCALayerMac::clone):
(PlatformCALayerMac::setBounds):
(PlatformCALayerMac::requiresCustomAppearanceUpdateOnBoundsChange):
(PlatformCALayerMac::updateCustomAppearance):
* platform/mac/ScrollbarThemeMac.h: Export some static functions.
* platform/mac/ScrollbarThemeMac.mm: Change code to use static functions.
(WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground):
(WebCore::ScrollbarThemeMac::removeOverhangAreaBackground):
(WebCore::ScrollbarThemeMac::setUpOverhangAreaShadow):
(WebCore::ScrollbarThemeMac::removeOverhangAreaShadow):
(WebCore::ScrollbarThemeMac::setUpOverhangAreasLayerContents):
(WebCore::ScrollbarThemeMac::setUpContentShadowLayer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateRootLayerPosition): No need to call
setUpContentShadowLayer() now when size changes; PlatformCALayer takes
care of that.
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers): Now set
custom appearance via GraphicsLayer.

Source/WebKit2:

Reviewed by Tim Horton.

With UI-side compositing, we need to apply the overhang shadow and linen
background to layers in the UI process. Achieve this by setting a "custom
appearance" flag on layers that need a shadow or linen background, and
migrating this flag to the UI process. Static functions on ScrollbarThemeMac
are exposed to do the actual setting.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::updateCustomAppearance): Use ScrollbarThemeMac to update the
appearance.
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::setBounds): If the bounds change, also set the
CustomAppearanceChanged bit so that the UI side updates the shadow bounds
(done here because the UI side is not stateful).
(PlatformCALayerRemote::requiresCustomAppearanceUpdateOnBoundsChange):
(PlatformCALayerRemote::customAppearance):
(PlatformCALayerRemote::updateCustomAppearance):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Remove the constraint that highlight rects must be smaller than the scrollview bounds
https://bugs.webkit.org/show_bug.cgi?id=125812

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-16
Reviewed by Dan Bernstein.

Currently, _scrollView is never set on WKInteractionView and all highlight rects are discarded.

Eventually, the constraint rect should be computed from the useful area of ScrollView and the scale
of the document. In the meantime, the constraint code is just causing troubles.

The issue is tracked by <rdar://problem/15673655>.

* UIProcess/API/ios/WKInteractionView.mm:
(-[WKInteractionView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Unreviewed build fix.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Correct typo that added a '\' at the
end of a line of the file.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKView.magnification should include magnification due to the active gesture
https://bugs.webkit.org/show_bug.cgi?id=125813

Reviewed by Simon Fraser.

Make WKView.magnification respect active pinch-zoom gestures.

* UIProcess/API/mac/WKView.mm:
(-[WKView magnification]):
If we have a ViewGestureController, defer to it for the current magnification.

* UIProcess/mac/ViewGestureController.cpp:
(WebKit::ViewGestureController::magnification):
Return either the current pinch-zoom magnification, if we're in the middle of a gesture,
or the pageScaleFactor, if we're not.

* UIProcess/mac/ViewGestureController.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix on EFL port after r160653

Rename WebData to API::Data

* CMakeLists.txt: Added APIData.cpp to include list.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sessionStateData):
(WebKit::WebPageProxy::restoreFromSessionStateData):
* UIProcess/soup/WebSoupRequestManagerProxy.cpp:
(WebKit::WebSoupRequestManagerProxy::didHandleURIRequest):
(WebKit::WebSoupRequestManagerProxy::didReceiveURIRequestData):
(WebKit::WebSoupRequestManagerProxy::didReceiveURIRequest):
* UIProcess/soup/WebSoupRequestManagerProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix the Windows build after r160672.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::PlatformCALayerWin):
* platform/graphics/ca/win/PlatformCALayerWin.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DatabaseProcess: Plumb through messaging for the 4 basic transaction operations
https://bugs.webkit.org/show_bug.cgi?id=125816

Reviewed by Alexey Proskuryakov.

The messaging begins and ends in the WebProcess:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::beginTransaction):
(WebKit::WebIDBServerConnection::didBeginTransaction):
(WebKit::WebIDBServerConnection::commitTransaction):
(WebKit::WebIDBServerConnection::didCommitTransaction):
(WebKit::WebIDBServerConnection::resetTransaction):
(WebKit::WebIDBServerConnection::didResetTransaction):
(WebKit::WebIDBServerConnection::rollbackTransaction):
(WebKit::WebIDBServerConnection::didRollbackTransaction):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

It travels from the WebProcess to the DatabaseProcess connection:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::beginTransaction):
(WebKit::DatabaseProcessIDBConnection::commitTransaction):
(WebKit::DatabaseProcessIDBConnection::resetTransaction):
(WebKit::DatabaseProcessIDBConnection::rollbackTransaction):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

It travels from the connection to the appropriate UniqueIDBDatabase:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::openTransaction):
(WebKit::UniqueIDBDatabase::beginTransaction):
(WebKit::UniqueIDBDatabase::commitTransaction):
(WebKit::UniqueIDBDatabase::resetTransaction):
(WebKit::UniqueIDBDatabase::rollbackTransaction):
(WebKit::UniqueIDBDatabase::postTransactionOperation):
(WebKit::UniqueIDBDatabase::didCompleteTransactionOperation):
(WebKit::UniqueIDBDatabase::openBackingStoreTransaction):
(WebKit::UniqueIDBDatabase::beginBackingStoreTransaction):
(WebKit::UniqueIDBDatabase::commitBackingStoreTransaction):
(WebKit::UniqueIDBDatabase::resetBackingStoreTransaction):
(WebKit::UniqueIDBDatabase::rollbackBackingStoreTransaction):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

The UniqueIDBDatabase object performs the operation with the backing store:
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::beginTransaction):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::commitTransaction):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::resetTransaction):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::rollbackTransaction):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

And the SQLite backing store calls the appropriate method on the SQLite transaction:
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp:
(WebKit::SQLiteIDBTransaction::begin): Stubbed for now.
(WebKit::SQLiteIDBTransaction::commit): Ditto.
(WebKit::SQLiteIDBTransaction::reset): Ditto.
(WebKit::SQLiteIDBTransaction::rollback): Ditto.
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:

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