Update RegExp Tracing code
https://bugs.webkit.org/show_bug.cgi?id=130381

Reviewed by Andreas Kling.

Updated the regular expression tracing code for 8/16 bit JIT as
well as match only entry points.  Also added average string length
metric.

* runtime/RegExp.cpp:
(JSC::RegExp::RegExp):
(JSC::RegExp::match):
(JSC::RegExp::printTraceData):
* runtime/RegExp.h:
* runtime/VM.cpp:
(JSC::VM::addRegExpToTrace):
(JSC::VM::dumpRegExpTrace):
* runtime/VM.h:
* yarr/YarrJIT.h:
(JSC::Yarr::YarrCodeBlock::get8BitMatchOnlyAddr):
(JSC::Yarr::YarrCodeBlock::get16BitMatchOnlyAddr):
(JSC::Yarr::YarrCodeBlock::get8BitMatchAddr):
(JSC::Yarr::YarrCodeBlock::get16BitMatchAddr):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make image controls menu work in WK2
<rdar://problem/16294412> and https://bugs.webkit.org/show_bug.cgi?id=130424

Reviewed by Tim Horton.

* Platform/SharedMemory.h:
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::Handle::~Handle):
(WebKit::SharedMemory::Handle::clear):

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::Handle::~Handle):
(WebKit::SharedMemory::Handle::clear):

* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::operator=):
(WebKit::ContextMenuContextData::encode):
(WebKit::ContextMenuContextData::decode):
* Shared/ContextMenuContextData.h:
(WebKit::ContextMenuContextData::controlledImageHandle):

* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::Handle::clear):
* Shared/ShareableBitmap.h:
* UIProcess/WebContextMenuProxy.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::internalShowContextMenu):
(WebKit::WebPageProxy::replaceControlledImage):
* UIProcess/WebPageProxy.h:

* UIProcess/efl/WebContextMenuProxyEfl.cpp:
(WebKit::WebContextMenuProxyEfl::showContextMenu):
* UIProcess/efl/WebContextMenuProxyEfl.h:

* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::showContextMenu):
* UIProcess/gtk/WebContextMenuProxyGtk.h:

Add a sharing service context menu that lives side-by-side with the normal one:
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]):
(-[WKSharingServicePickerDelegate setMenuProxy:WebKit::]):
(-[WKSharingServicePickerDelegate setPicker:]):
(-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]):
(-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
(-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
(-[WKSharingServicePickerDelegate sharingService:sourceFrameOnScreenForShareItem:]):
(-[WKSharingServicePickerDelegate sharingService:transitionImageForShareItem:contentRect:]):
(-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]):
(WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
(WebKit::WebContextMenuProxyMac::setupImageServicesMenu):
(WebKit::WebContextMenuProxyMac::clearImageServicesMenu):
(WebKit::WebContextMenuProxyMac::populate):
(WebKit::WebContextMenuProxyMac::showContextMenu):
(WebKit::WebContextMenuProxyMac::window):
(WebKit::WebContextMenuProxyMac::replaceControlledImage):

* WebProcess/WebPage/WebContextMenu.cpp:
(WebKit::WebContextMenu::show):
(WebKit::WebContextMenu::replaceControlledImage):
* WebProcess/WebPage/WebContextMenu.h:

Teach the WebProcess how to accept the replaced image.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::replaceControlledImage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165857 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebRTC] Fix layering violation in RTCStatsRequest
https://bugs.webkit.org/show_bug.cgi?id=130426

Reviewed by Eric Carlson.

RTCStatsRequest::track() should return a MediaStreamTrackPrivate*.

No new tests needed.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
* Modules/mediastream/RTCStatsRequestImpl.cpp:
(WebCore::RTCStatsRequestImpl::create):
(WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl):
(WebCore::RTCStatsRequestImpl::track):
* Modules/mediastream/RTCStatsRequestImpl.h:
* platform/mediastream/RTCStatsRequest.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaDocument should set a max-width on its <video> element.
https://bugs.webkit.org/show_bug.cgi?id=114691

Reviewed by Eric Carlson.

Set a style attribute containing max-width:100% and max-height:100% so that large videos
are entirely visible within the browser window bounds.

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix iOS production build.

* JavaScriptCore.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unify <media> element callback registration and unregistration
https://bugs.webkit.org/show_bug.cgi?id=130417

Reviewed by Eric Carlson.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::registerWithDocument):
(WebCore::HTMLMediaElement::unregisterWithDocument):
(WebCore::HTMLMediaElement::didMoveToNewDocument):
* html/HTMLMediaElement.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WebKit2] Mark layer contents as being opaque if they are
https://bugs.webkit.org/show_bug.cgi?id=130427
<rdar://problem/15540434>

Reviewed by Simon Fraser.

* Shared/mac/RemoteLayerBackingStore.h:
(WebKit::RemoteLayerBackingStore::isOpaque):
* Shared/mac/RemoteLayerBackingStore.mm:
(RemoteLayerBackingStore::RemoteLayerBackingStore):
(RemoteLayerBackingStore::ensureBackingStore):
(RemoteLayerBackingStore::encode):
(RemoteLayerBackingStore::decode):
(RemoteLayerBackingStore::display):
(RemoteLayerBackingStore::applyBackingStoreToLayer):
Move the code to set a RemoteLayerBackingStore as a CALayer's contents
from RemoteLayerTreePropertyApplier to RemoteLayerBackingStore (mostly
as a way to keep the USE(IOSURFACE) #ifs in one place).
Remove the surface() getter, because it's no longer needed, and make
image() private as it can be now (and rename it to createImageForFrontBuffer
for clarity's sake).

Add an isOpaque argument to ensureBackingStore, encode/decode it, and
add a getter. If isOpaque is true when applying backing store to the
CALayer on the UI process side, set CALayer.contentsOpaque to let CA know.

Make opaque bitmaps if not using accelerated drawing. For the IOSurface
case, we can't make opaque IOSurfaces, but telling CA that we have filled
the whole bitmap still enables similar optimizations.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):
Reset contentsOpaque if the layer loses its backing store.

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<):
(WebKit::dumpChangedLayers):
Add a bit more logging about RemoteLayerBackingStore's opaqueness
and acceleratedness.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::updateBackingStore):
(PlatformCALayerRemote::setOpaque):
Invalidate the RemoteLayerBackingStore if layer opaqueness changes.

* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::paintsOpaquelyAtNonIntegralScales):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsOpaque):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintsOpaquelyAtNonIntegralScales):
* rendering/RenderLayerBacking.h:
r159463 stopped us from setting layers opaque if they were being painted
at non-integral scale. This makes sense for compositing layers, which
are painted by arbitrary elements, but the main frame's RenderView
will always paint its entire contents. To restore the opaque contents
optimization to the main frame's tiles, don't de-opaquify layers
belonging to the main frame's RenderView.


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