Unreviewed, rolling out r175806.
https://bugs.webkit.org/show_bug.cgi?id=138666

Capturing CString is not thread safe (Requested by anttik on
#webkit).

Reverted changeset:

"[WK2] Use C++ lambdas in IPC::Connection"
https://bugs.webkit.org/show_bug.cgi?id=138018
http://trac.webkit.org/changeset/175806

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need to show the text indicator when Data Detectors shows a popover
https://bugs.webkit.org/show_bug.cgi?id=138664
<rdar://problem/18869900>

Reviewed by Beth Dakin.

* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:
(hasDataDetectorsCompletionAPI):
Determine if we have the new API.

(-[WKActionMenuController willDestroyView:]):
(-[WKActionMenuController willOpenMenu:withEvent:]):
Make use of the new API.
If we wanted to show a Data Detectors menu but have no items (or they're all
disabled), cancel the menu.
If we don't have it, manually manipulate the highlight.

(-[WKActionMenuController didCloseMenu:withEvent:]):
Make use of the new API.
If we don't have it, manually manipulate the highlight.

(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
Set up completion handlers if we have the new API; when DataDetectors
presents UI, show the text indicator, when it dismisses, hide it.
If we don't have the API, manually manipulate the highlight.

* platform/spi/mac/DataDetectorsSPI.h:
Add new DataDetectors SPI.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Two action menu item titles are swapped
https://bugs.webkit.org/show_bug.cgi?id=138667
<rdar://problem/18960409>

Reviewed by Beth Dakin.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _createActionMenuItemForTag:]):
Swap them back.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement new plug-in API for muting plug-ins
https://bugs.webkit.org/show_bug.cgi?id=138105

Reviewed by Anders Carlsson.

Source/WebCore:

Add the new NPNVmuteAudioBool NPNVariable.

Test: platform/mac-wk2/plugins/muted-state.html

* plugins/npapi.h:

Source/WebKit2:

Handle the setting of NPNVmuteAudioBool on the plug-in.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::PluginControllerProxy):
Initialize m_isMuted.
(WebKit::PluginControllerProxy::mutedStateChanged):
Tell the plugin about the new muted state.
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/PluginControllerProxy.messages.in:
Add the MutedStateChanged message.
* PluginProcess/PluginCreationParameters.cpp:
(WebKit::PluginCreationParameters::PluginCreationParameters):
Initialize isMuted.
(WebKit::PluginCreationParameters::encode):
Handle isMuted.
(WebKit::PluginCreationParameters::decode):
Ditto.
* PluginProcess/PluginCreationParameters.h:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetValue):
Get the plug-in's muted state.
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::isMuted):
Get the muted state from PluginControllerProxy.
(WebKit::NetscapePlugin::mutedStateChanged):
Call NPP_SetValue with NPNVmuteAudioBool and the updated muted state.
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Plugin.h:
(WebKit::Plugin::mutedStateChanged):
* WebProcess/Plugins/PluginController.h:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::initialize):
Set m_pendingPluginCreationParameters->isMuted.
(WebKit::PluginProxy::mutedStateChanged):
Send the MutedStateChanged message to the plugin process.
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pageMutedStateDidChange):
Call Plugin::mutedStateChanged() with the page's muted state.
(WebKit::PluginView::isMuted):
Get the page's current muted state.
* WebProcess/Plugins/PluginView.h:

Tools:

Add a new plug-in test for the mute API.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/TestNetscapePlugIn/Tests/mac/SetMuted.cpp: Added.
(SetMuted::SetMuted):
(SetMuted::isMuted):
(SetMuted::cachedIsMuted):
(SetMuted::ScriptableObject::hasProperty):
(SetMuted::ScriptableObject::getProperty):
(SetMuted::ScriptableObject::pluginTest):
(SetMuted::NPP_New):
(SetMuted::NPP_GetValue):
(SetMuted::NPP_SetValue):

LayoutTests:

* platform/mac-wk2/plugins/muted-state-expected.txt: Added.
* platform/mac-wk2/plugins/muted-state.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flaky Test: media/video-ended-event-slow-motion-playback.html
https://bugs.webkit.org/show_bug.cgi?id=136755

Reviewed by Jer Noble.

* media/video-ended-event-slow-motion-playback.html: The test verifies that playback
rate doesn't get rounded down to 0, and that is very easy to detect, no need for
flaky timeouts.

* platform/mac/TestExpectations: Remove the flakiness expectation. Also while at it,
updated media/video-playbackrate.html to match what the bots actually see.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WK1: Support default actions for images
https://bugs.webkit.org/show_bug.cgi?id=138668
-and corresponding-
rdar://problem/18785434

Reviewed by Tim Horton.

Source/WebCore:

Symbol needed for copying image.
* WebCore.exp.in:

Source/WebKit/mac:

* WebView/WebActionMenuController.h:
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController didCloseMenu:withEvent:]):
(-[WebActionMenuController _defaultMenuItemsForImage:]):
(-[WebActionMenuController _copyImage:]):
(temporaryPhotosDirectoryPath):
(pathToPhotoOnDisk):
(-[WebActionMenuController _canAddMediaToPhotos]):
(-[WebActionMenuController _addImageToPhotos:]):
(-[WebActionMenuController _saveImageToDownloads:]):
(-[WebActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
(-[WebActionMenuController sharingServicePicker:delegateForSharingService:]):
(-[WebActionMenuController sharingService:sourceWindowForShareItems:sharingContentScope:]):
(-[WebActionMenuController _createActionMenuItemForTag:withHitTestResult:]):
(-[WebActionMenuController _defaultMenuItemsForHitTestResult:]):
* WebView/WebUIDelegatePrivate.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make Mac media-source test expectations future compatible
https://bugs.webkit.org/show_bug.cgi?id=138674

Reviewed by Eric Carlson.

* platform/mac/TestExpectations:



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