Stop using BlobData on client side
https://bugs.webkit.org/show_bug.cgi?id=132582

Reviewed by Sam Weinig.


Source/WebCore: 
Blob registration now uses either a single file path, or a vector of much simpler
BlobPart objects, not an array with arbitrarily sliced blobs or files, which can't happen.

* Modules/websockets/WebSocket.cpp:(WebCore::WebSocket::didReceiveBinaryData):
Use a new simpler Blob constructor.

* WebCore.xcodeproj/project.pbxproj: Added BlobPart, removed BlobRegistrationData.

* bindings/js/JSBlobCustom.cpp: (WebCore::JSBlobConstructor::constructJSBlob):
Use Vector<BlobPart> instead of BlobData (1 line of code instead of 5).

* dom/DataTransfer.cpp: (WebCore::DataTransfer::hasFileOfType): Updated for
File::contentTypeFromFilePathOrName rename.

* fileapi/Blob.cpp: (WebCore::Blob::Blob):
* fileapi/Blob.h:
(WebCore::Blob::create):
(WebCore::Blob::deserialize):
* fileapi/File.cpp:
(WebCore::File::File):
(WebCore::File::contentTypeFromFilePathOrName):
(WebCore::createBlobDataForFileWithType): Deleted.
(WebCore::createBlobDataForFile): Deleted.
(WebCore::createBlobDataForFileWithName): Deleted.
(WebCore::File::contentTypeFromFilePath): Deleted.
* fileapi/File.h: (WebCore::File::deserialize): Deleted.
Added and updated constructors to not use BlobData. Changed special case constructors
to use name tags instead of non-enforced comments.

* fileapi/ThreadableBlobRegistry.h:
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::BlobRegistryContext::BlobRegistryContext): Updated with new data members
that were split out of BlobData.
(WebCore::ThreadableBlobRegistry::registerFileBlobURL): Added.
(WebCore::ThreadableBlobRegistry::registerBlobURL): Updated to pass Content-Type
explicitly, as it's no longer hidden in BlobData.

* fileapi/WebKitBlobBuilder.h:
* fileapi/WebKitBlobBuilder.cpp:
(WebCore::BlobBuilder::append):
(WebCore::BlobBuilder::finalize):
(WebCore::BlobBuilder::appendBytesData): Deleted.
Updated to use BlobPart. There is no longer any need to special case Files,
the registry takes care of that.

* platform/network/BlobData.h:
* platform/network/BlobData.cpp:
(WebCore::BlobDataItem::detachFromCurrentThread): Deleted.
(WebCore::BlobData::detachFromCurrentThread): Deleted.
BlobData will only be used on main thread by the registry.

* platform/network/BlobPart.h: Added. A new class to encapsulate a list of blobs
that are combined into a new blob, as exposed to JS via Blob constructor.

* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerFileBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
Updated for the new registration methods. We no longer have arbitrary BlobDatas
coming in.

* platform/network/FormData.cpp: Don't include BlobData for now (but really,
BlobStorageData is the same thing, and they will be merged soon).
Unfortunately, FormData is used by both client and registry side, and there is
no clear delimitation at the time.
 
* xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseBlob): Use the new simpler
way to create a Blob.

Source/WebKit2: 
Update for WebCore changes.

* CMakeLists.txt:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* Shared/FileAPI/BlobRegistrationData.cpp: Removed.
* Shared/FileAPI/BlobRegistrationData.h: Removed.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<BlobPart>::encode):
(IPC::ArgumentCoder<BlobPart>::decode):
* Shared/WebCoreArgumentCoders.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Put WebKitPluginHost.app in WebKitLegacy.framework
https://bugs.webkit.org/show_bug.cgi?id=132592
<rdar://problem/15920046>

Reviewed by Dan Bernstein.

Source/WebKit:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:
* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::spawnPluginHost):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimize GetByVal when subscript is a rope string.
<https://webkit.org/b/132590>

Use JSString::toIdentifier() in the various GetByVal implementations
to try and avoid allocating extra strings.

Added canUseFastGetOwnProperty() and wrap calls to fastGetOwnProperty()
in that, to avoid calling JSString::value() which always resolves ropes
into new strings and de-optimizes subsequent toIdentifier() calls.

My iMac says ~9% progression on Dromaeo/dom-attr.html

Reviewed by Phil Pizlo.

* dfg/DFGOperations.cpp:
* jit/JITOperations.cpp:
(JSC::getByVal):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::getByVal):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::fastGetOwnProperty):
(JSC::JSCell::canUseFastGetOwnProperty):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mark http/tests/media/hls/video-controls-live-stream.html as WontFix on Mountain Lion.
<https://webkit.org/b/132491>

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WK2] Flickery scrolling inside overflow-scrolling: touch
https://bugs.webkit.org/show_bug.cgi?id=132591
<rdar://problem/16760466>

Reviewed by Tim Horton.

Source/WebCore:

Avoid triggering layer tree commits that touch the layer's boundsOrigin
while the user is scrolling in the UI process.

Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
flag to the ScrollingTree to say that we're in the middle of a user interaction
(and also to send a final non-interactive update). That gets passed along
to the web process, and turned into "SyncScrollingLayerPosition" update.
AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
this, and uses it to set a flag on the ScrollableArea to say that the scroll
is a user scroll.

RenderLayerBacking then makes use of this (in existing code, shared with WK1)
to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
which updates the GraphicsLayer without touching platform layers. This is necessary
so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
computations).

Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
for WebKit1 by checking the type of platform layer.

* WebCore.exp.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::syncBoundsOrigin):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::computeVisibleRect):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

Source/WebKit2:

Avoid triggering layer tree commits that touch the layer's boundsOrigin
while the user is scrolling in the UI process.

Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
flag to the ScrollingTree to say that we're in the middle of a user interaction
(and also to send a final non-interactive update). That gets passed along
to the web process, and turned into "SyncScrollingLayerPosition" update.
AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
this, and uses it to set a flag on the ScrollableArea to say that the scroll
is a user scroll.

RenderLayerBacking then makes use of this (in existing code, shared with WK1)
to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
which updates the GraphicsLayer without touching platform layers. This is necessary
so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
computations).

Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
for WebKit1 by checking the type of platform layer.

* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
(WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(-[WKOverflowScrollViewDelegate scrollViewDidScroll:]):
(-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
(-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
* WebProcess/Scrolling/RemoteScrollingCoordinator.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Prefetch DNS hostnames on tap highlight
https://bugs.webkit.org/show_bug.cgi?id=132509

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-05-05
Reviewed by Alexey Proskuryakov.


Source/WebCore: 
* WebCore.exp.in:
* dom/Element.cpp:
* dom/Element.h:
(WebCore::Element::absoluteLinkURL()):

Source/WebKit2: 
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::tapHighlightAtPosition):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix debug build.

* runtime/JSCellInlines.h:
(JSC::JSCell::fastGetOwnProperty):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement scan backward and forward in video fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=132517

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-05-05
Reviewed by Simon Fraser.

Source/WebCore:
Implement scanning forward and backward. This implements methods in
WebAVPlayerController and forwards them through WebVideoFullscreenModelMediaElement
and on to HTMLMediaElement.

* WebCore.exp.in: necessary exports.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerController seekToTime:]):
Use fastSeek in this case.
(-[WebAVPlayerController canScanForward]): If you can play, you can scan.
(+[WebAVPlayerController keyPathsForValuesAffectingCanScanForward]): ditto
(-[WebAVPlayerController beginScanningForward:]): ditto
(-[WebAVPlayerController endScanningForward:]): ditto
(-[WebAVPlayerController canScanBackward]): If you can play, you can scan.
(+[WebAVPlayerController keyPathsForValuesAffectingCanScanBackward]): ditto
(-[WebAVPlayerController beginScanningBackward:]): ditto
(-[WebAVPlayerController endScanningBackward:]): ditto
(-[WebAVPlayerController canSeekToBeginning]):
This looks at seekableRanges to determine if any seeking is possible.
(+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToBeginning]):
depends on seekableRanges.
(-[WebAVPlayerController seekToBeginning:]): seek to -ininity
(-[WebAVPlayerController canSeekToEnd]):
This looks at seekableRanges to determine if any seeking is possible.
(+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToEnd]):
depends on seekableRanges.
(-[WebAVPlayerController seekToEnd:]): seek to INFINITY.
* platform/ios/WebVideoFullscreenModel.h:
Add 4 new functions.
* platform/ios/WebVideoFullscreenModelMediaElement.h:
ditto
* platform/ios/WebVideoFullscreenModelMediaElement.mm:
(WebVideoFullscreenModelMediaElement::fastSeek): forwards to HTMLMediaEelement
(WebVideoFullscreenModelMediaElement::beginScanningForward): forwards to HTMLMediaEelement
(WebVideoFullscreenModelMediaElement::beginScanningBackward): forwards to HTMLMediaEelement
(WebVideoFullscreenModelMediaElement::endScanning): forwards to HTMLMediaEelement

Source/WebKit2:
Plumb through scanning/seeking functions.

* UIProcess/ios/WebVideoFullscreenManagerProxy.h:
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::fastSeek):
(WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
(WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
(WebKit::WebVideoFullscreenManagerProxy::endScanning):
* WebProcess/ios/WebVideoFullscreenManager.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] REGRESSION(167145): JavaScript media controls are broken
https://bugs.webkit.org/show_bug.cgi?id=131573

Reviewed by Brent Fulgham.

* PlatformEfl.cmake: Add the localized strings file to the list of user agent scripts.
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::mediaControlsScript): Include the localized strings file in the script body.


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