Add ARM EFL Linux builder bots to Apple buildmaster
https://bugs.webkit.org/show_bug.cgi?id=127472

Reviewed by Csaba Osztrogonác.

There is no ARM buildslaves after removing the Qt builders.

* BuildSlaveSupport/build.webkit.org-config/config.json:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MediaControls][iOS] Fix a couple of UI bugs in the iOS Media Controls
https://bugs.webkit.org/show_bug.cgi?id=127929

Reviewed by Eric Carlson.

Two UI bugs in the iOS Media Controls: the text in the controls should use the apple
system font rather than the webkit small control font, and the buttons in the controls
are clipped due to an "off by one" error when calculating the SVG image dimensions.

* Modules/mediacontrols/mediaControlsiOS.css:
(::-webkit-media-controls):
(audio::-webkit-media-controls-play-button):
(audio::-webkit-media-controls-fullscreen-button):
(audio::-webkit-media-controls-time-remaining-display):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in RemoteLayerBackingStore::encode when m_frontBuffer is nullptr.
https://bugs.webkit.org/show_bug.cgi?id=127756

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-01-30
Reviewed by Jer Noble.

Don't encode RemoteLayerBackingStore when it has no front buffer.

* Shared/mac/RemoteLayerBackingStore.h:
(WebKit::RemoteLayerBackingStore::hasFrontBuffer):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] don't update media layers on main thread when using AVFoundation
https://bugs.webkit.org/show_bug.cgi?id=127931

Reviewed by Simon Fraser.

* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::mediaLayerMustBeUpdatedOnMainThread): Add mediaLayerMustBeUpdatedOnMainThread.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::mediaLayerMustBeUpdatedOnMainThread): Ask the client if graphics layers
    should be updated on the main thread.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::mediaLayerMustBeUpdatedOnMainThread): New, check settings to see
    if video plug-in proxy is enabled.
* rendering/RenderLayerBacking.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update FTL StackMaps parser to stackSize change
https://bugs.webkit.org/show_bug.cgi?id=127933

Reviewed by Oliver Hunt.

* ftl/FTLStackMaps.cpp:
(JSC::FTL::StackMaps::parse):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
package-root shouldn't prefix simulator roots with the SDK path
http://bugs.webkit.org/show_bug.cgi?id=127923

Reviewed by Dan Bernstein.

* Scripts/package-root: Don't add an install path prefix.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DumpRenderTree fails to build with ASAN: -fsanitize=address passed to static DRT target
https://bugs.webkit.org/show_bug.cgi?id=127935

Reviewed by Andy Estes.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
Clear OTHER_LDFLAGS at the project level for the static library target.
No other linker flags were inherited from DebugRelease.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin fleshing out the navigation delegate
https://bugs.webkit.org/show_bug.cgi?id=127939

Reviewed by Dan Bernstein.

* UIProcess/API/APIPolicyClient.h:
(API::PolicyClient::decidePolicyForNavigationAction):
Pass the listener as a RefPtr.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
Update for API::PolicyClient changes.

* UIProcess/API/Cocoa/WKNavigationDelegate.h:
Add new delegate.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Set a policy client on the page.

* UIProcess/Cocoa/NavigationState.h:
Add a new PolicyClient class.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationState):
Initialize m_navigationDelegateMethods.

(WebKit::NavigationState::navigationDelegate):
m_delegate was renamed to m_navigationDelegate.

(WebKit::NavigationState::setNavigationDelegate):
Update m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler.

(WebKit::NavigationState::createPolicyClient):
New helper function for creating a new policy client.

(WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
Call the navigation delegate method.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
Use std::move to hand off the listener to the client.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow the OpenGL Profiler to get through the sandbox
https://bugs.webkit.org/show_bug.cgi?id=127877
<rdar://problem/14817250>
<rdar://problem/14271180>

Reviewed by Alexey Proskuryakov.

Open up the sandbox for WebProcess and PluginProcess so
that OpenGL.framework can create a mach port for communication
with the OpenGL Profiler.

* Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move OTHER_LDFLAGS erasure to DumpRenderTreeLibrary.xcconfig.
https://bugs.webkit.org/show_bug.cgi?id=127935

Reviewed by Andy Estes.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/Configurations/DumpRenderTreeLibrary.xcconfig:
Move OTHER_LDFLAGS erasure to the static library's xcconfig.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
De-virtual-ize CachedResource::isImage()
<http://webkit.org/b/127936>

Reviewed by Andreas Kling.

Also replace explicit type() checks with isImage().

Source/WebCore:

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest): Use isImage().
* loader/cache/CachedImage.h:
(WebCore::CachedResource::isImage): Remove virtual override.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isImage): Check type() instead of
defining a virtual method that returns false by default.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::reloadImagesIfNotDeferred): Use isImage().

Source/WebKit/mac:

* Misc/WebCache.mm:
(+[WebCache imageForURL:]): Use !isImage().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement policy response delegate handling
https://bugs.webkit.org/show_bug.cgi?id=127945

Reviewed by Dan Bernstein.

* UIProcess/API/APIPolicyClient.h:
(API::PolicyClient::decidePolicyForResponse):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
(NS_ENUM):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForResponse):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IDB: ObjectStore cursor advance() support
<rdar://problem/15779645> and https://bugs.webkit.org/show_bug.cgi?id=127866

Reviewed by Sam Weinig.

Source/WebCore:

Add IDBKeyData sorting for database collation:
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::compare):
* Modules/indexeddb/IDBKeyData.h:

* WebCore.exp.in:

* platform/sql/SQLiteTransaction.h:
(WebCore::SQLiteTransaction::database):

Source/WebKit2:

Plumb calls through to the backing store:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::openCursorInBackingStore):
(WebKit::UniqueIDBDatabase::advanceCursorInBackingStore):
(WebKit::UniqueIDBDatabase::iterateCursorInBackingStore):

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Update schema
  for Records table.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::resetTransaction):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor): Create a SQLiteIDBCursor object.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor): Call through to that object.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::iterateCursor): Ditto.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::idbKeyCollate): Renamed for clarity.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::unregisterCursor): Cleanup open cursors.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: Added.
(WebKit::SQLiteIDBCursor::maybeCreate):
(WebKit::SQLiteIDBCursor::SQLiteIDBCursor):
(WebKit::SQLiteIDBCursor::establishStatement):
(WebKit::SQLiteIDBCursor::createIndexCursorStatement): Stubbed for now.
(WebKit::SQLiteIDBCursor::createObjectStoreCursorStatement): Create the appropriate query for
  the passed in IDBKeyRange.
(WebKit::SQLiteIDBCursor::advance): Step through that query.
(WebKit::SQLiteIDBCursor::iterate): Stubbed for now.
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h: Added.
(WebKit::SQLiteIDBCursor::identifier):
(WebKit::SQLiteIDBCursor::transaction):
(WebKit::SQLiteIDBCursor::currentKey):
(WebKit::SQLiteIDBCursor::currentPrimaryKey):
(WebKit::SQLiteIDBCursor::currentValue):

Add infrastructure for a SQLiteIDBTransaction to keep track of (and clean up) its open cursors:
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp:
(WebKit::SQLiteIDBTransaction::SQLiteIDBTransaction):
(WebKit::SQLiteIDBTransaction::~SQLiteIDBTransaction):
(WebKit::SQLiteIDBTransaction::reset):
(WebKit::SQLiteIDBTransaction::openCursor):
(WebKit::SQLiteIDBTransaction::clearCursors):
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
(WebKit::SQLiteIDBTransaction::create):
(WebKit::SQLiteIDBTransaction::sqliteTransaction):

Add accessors for the two fields:
* DatabaseProcess/IndexedDB/IDBIdentifier.h:
(WebKit::IDBIdentifier::connection):
(WebKit::IDBIdentifier::id):

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [CMake] Add a "make dist" target
https://bugs.webkit.org/show_bug.cgi?id=116378

Reviewed by Gustavo Noronha Silva.

.:

* Source/PlatformGTK.cmake: A CMake support for executing the make-dist
script and then turning the tarfile into a LZMA compressed file.

Source/WebCore:

* CMakeLists.txt: Don't build WebKitVersion.h for WebKitGTK+. We don't use it
and we don't want to distribute the dependency.

Tools:

Added a script that reads a manifest file an produces a tarball. Also add
the manifest.

* gtk/make-dist.py: Added.
* gtk/manifest.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Part 2: REGRESSION: JavascriptCore crash during OS Installation (due to
Heap::m_operationInProgress ASSERT vs DelayedReleaseScope)
https://bugs.webkit.org/show_bug.cgi?id=127950

Reviewed by Mark Hahnenberg.

Scope the APICallbackShim to make sure that we re-acquire the lock
before putting the heap back into the "unsafe to allocate" state.
Otherwise, the heap will seem to be in the "unsafe to allocate" state
during any GC that happens before we re-acquire the lock.

No regression test because threads.

* heap/DelayedReleaseScope.h:
(JSC::DelayedReleaseScope::~DelayedReleaseScope):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Lots of API test assertion failures after r163093
https://bugs.webkit.org/show_bug.cgi?id=127948

Reviewed by Alexey Proskuryakov.

* UIProcess/API/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::processDidExit):
* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView _processDidExit]):
* UIProcess/API/ios/WKContentViewInternal.h:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::processDidExit):
* UIProcess/API/mac/WKView.mm:
(-[WKView _processDidExit]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/API/mac/WKViewInternal.h:
Rename _processDidCrash to _processDidExit, since it containes cleanup we
should do in both cases. Also, call it whenever a process terminates instead
of just upon a crash. Also clear the ViewGestureController, because its
state doesn't make sense between WebProcesses.

(-[WKView _setCustomSwipeViews:]):
Don't make a ViewGestureController if we don't have one and would be
only creating one to set an empty list of custom swipe views.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKitTestRunner fails to link - missing rowHeaders and columnHeaders
https://bugs.webkit.org/show_bug.cgi?id=127917

Reviewed by Andy Estes.

* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::rowHeaders):
(WTR::AccessibilityUIElement::columnHeaders):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Convert blocks to lambdas in iOS Fullscreen code.
https://bugs.webkit.org/show_bug.cgi?id=127946

Reviewed by Anders Carlsson.

Pushing a block into a std::function will eventually cause a crash, since std::function
does not know about Block_copy and Block_release.

Lamdas can be intrinsicly converted to blocks, but not vice versa. Switch over all the
blocks in the new iOS Fullscreen code to use lamdas, and use the ref-counted this object
directly rather than implicitly.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(-[WebVideoFullscreenController exitFullscreen]):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setVideoLayer):
(WebVideoFullscreenInterfaceAVKit::enterFullscreen):
(WebVideoFullscreenInterfaceAVKit::exitFullscreen):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should support GetById(Untyped:)
https://bugs.webkit.org/show_bug.cgi?id=127750

Reviewed by Oliver Hunt.
        
This was supposed to be easy. Indeed, the actual GetById UntypedUse case was easy. But
then it expanded coverage by a lot and I got to deal with three bugs. So, this has
some additional changes:
        
Also make it safe for LLVM to duplicate calls to patchpoints and stackmaps. Previously
we incorrectly assumed that if we emitted a patchpoint, then there would only be one
copy of that patchpoint (with that ID) in the resulting machine code and in the
stackmaps section. That's obviously a bad assumption - LLVM is allowed to do anything
it wants so long as the outcome of executing the code has a semantically equivalent
meaning to the IR we gave it, and duplicating code is trivially OK under this rule. We
should be OK with it, too. The solution is to add Vectors in a bunch of places that
previously just thought they only had one value. For example, an InlineCacheDescriptor
now has a Vector of generators - one generator for each copy that LLVM stamped out.
Normally there will only be one copy, of course - since duplication is usually
unprofitable. But, if LLVM decides that copying would be groovy then we will no longer
barf.
        
Also fix SSA conversion. It turns out that we mishandled the case where a block had
multiple Phi functions for the same local. If any of those CPS Phis fail to trivialize
in the Aycock-Horspool fixpoint, we need to insert an SSA Phi. Previously, it was
assuming that so long as the head CPS Phi was trivial, we could forego SSA Phi
insertion. That's wrong if the head CPS Phi trivialized but ended up pointing to a
non-trivial CPS Phi in the same block. This madness with trees of Phis occurs because
we try to save on compile times: no Phi ever has more than three children even if the
block has more than three predecessors; we just build out a tree of Phis to satisfy
all predecessors. So weird.
        
And finally, fix DFG->FTL OSR entry's reconstruction of 'this' in a constructor. That
reconstruction code, JITCode::reconstruct(), had a work-around for the case where we
were entering into a constructor at the prologue. In that case, 'this' is definitely
unavailable. But the OSR code does reconstructions at LoopHints, which aren't at the
prologue, and so 'this' should totally be available.

* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::reconstruct):
* dfg/DFGNode.h:
(JSC::DFG::Node::tryGetVariableAccessData):
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLCompile.cpp:
(JSC::FTL::generateICFastPath):
(JSC::FTL::fixFunctionBasedOnStackMaps):
* ftl/FTLInlineCacheDescriptor.h:
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::codeSize):
* ftl/FTLJSCall.cpp:
(JSC::FTL::JSCall::JSCall):
* ftl/FTLJSCall.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileGetById):
(JSC::FTL::LowerDFGToLLVM::getById):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* ftl/FTLStackMaps.cpp:
(JSC::FTL::StackMaps::getRecordMap):
* ftl/FTLStackMaps.h:
* tests/stress/get-by-id-untyped.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a method for schemes to be registered as supporting cache partitioning
https://bugs.webkit.org/show_bug.cgi?id=127739

Reviewed by Darin Adler.

Source/WebCore:

Currently, this assumes that schemes supporting cache partitioning
also support (scheme, host) doubles for the scheme. Furthermore,
the scheme is currently discarded when partitioning and is only
checked to ensure that partitioning is supported for that scheme: it
is assumed that all origins with the same host double should be binned
together, regardless of scheme.

* WebCore.exp.in:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::cachePartition):
* platform/SchemeRegistry.cpp:
(WebCore::CachePartitioningSchemes):
(WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
(WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
* platform/SchemeRegistry.h:

Source/WebKit2:

Pipe information about cache partitioned scheme through WebKit2.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextRegisterURLSchemeAsCachePartitioned):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcess):
(WebKit::WebContext::registerURLSchemeAsCachePartitioned):
* UIProcess/WebContext.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::registerURLSchemeAsCachePartitioned):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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