<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[170041] trunk/Source/WebKit2</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/170041">170041</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2014-06-16 20:52:21 -0700 (Mon, 16 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Part 2 of: Change GenericCallback<> function parameters into std::function<>
https://bugs.webkit.org/show_bug.cgi?id=133927
Reviewed by Sam Weinig.
* UIProcess/API/C/WKPage.cpp:
(WKPageRunJavaScriptInMainFrame):
(WKPageRenderTreeExternalRepresentation):
(WKPageGetSourceForFrame):
(WKPageGetContentsAsString):
(WKPageGetBytecodeProfile):
(WKPageGetSelectionAsWebArchiveData):
(WKPageValidateCommand):
* UIProcess/API/C/WKPluginSiteDataManager.cpp:
(WKPluginSiteDataManagerClearSiteData):
(WKPluginSiteDataManagerClearAllSiteData):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView evaluateJavaScript:completionHandler:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView validateUserInterfaceItem:]):
(-[WKView startSpeaking:]):
(-[WKView selectedRangeWithCompletionHandler:]):
(-[WKView markedRangeWithCompletionHandler:]):
(-[WKView hasMarkedTextWithCompletionHandler:]):
(-[WKView firstRectForCharacterRange:completionHandler:]):
(-[WKView characterIndexForPoint:completionHandler:]):
* UIProcess/Plugins/WebPluginSiteDataManager.cpp:
(WebKit::WebPluginSiteDataManager::clearSiteData):
* UIProcess/Plugins/WebPluginSiteDataManager.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::validateCommand):
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getContentsAsMHTMLData):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMarkedRangeAsync):
(WebKit::WebPageProxy::getSelectedRangeAsync):
(WebKit::WebPageProxy::characterIndexForPointAsync):
(WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
(WebKit::WebPageProxy::takeSnapshot):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _define:]):
(-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView requestDictationContext:]):
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateSelectionWithTouches):
(WebKit::WebPageProxy::requestAutocorrectionData):
(WebKit::WebPageProxy::applyAutocorrection):
(WebKit::WebPageProxy::requestDictationContext):
(WebKit::WebPageProxy::requestAutocorrectionContext):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPagecpp">trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPluginSiteDataManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsWebPluginSiteDataManagercpp">trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsWebPluginSiteDataManagerh">trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -1,3 +1,64 @@
</span><ins>+2014-06-16 Dan Bernstein <mitz@apple.com>
+
+ Part 2 of: Change GenericCallback<> function parameters into std::function<>
+ https://bugs.webkit.org/show_bug.cgi?id=133927
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageRunJavaScriptInMainFrame):
+ (WKPageRenderTreeExternalRepresentation):
+ (WKPageGetSourceForFrame):
+ (WKPageGetContentsAsString):
+ (WKPageGetBytecodeProfile):
+ (WKPageGetSelectionAsWebArchiveData):
+ (WKPageValidateCommand):
+ * UIProcess/API/C/WKPluginSiteDataManager.cpp:
+ (WKPluginSiteDataManagerClearSiteData):
+ (WKPluginSiteDataManagerClearAllSiteData):
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView evaluateJavaScript:completionHandler:]):
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView validateUserInterfaceItem:]):
+ (-[WKView startSpeaking:]):
+ (-[WKView selectedRangeWithCompletionHandler:]):
+ (-[WKView markedRangeWithCompletionHandler:]):
+ (-[WKView hasMarkedTextWithCompletionHandler:]):
+ (-[WKView firstRectForCharacterRange:completionHandler:]):
+ (-[WKView characterIndexForPoint:completionHandler:]):
+ * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
+ (WebKit::WebPluginSiteDataManager::clearSiteData):
+ * UIProcess/Plugins/WebPluginSiteDataManager.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::validateCommand):
+ (WebKit::WebPageProxy::runJavaScriptInMainFrame):
+ (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
+ (WebKit::WebPageProxy::getSourceForFrame):
+ (WebKit::WebPageProxy::getContentsAsString):
+ (WebKit::WebPageProxy::getBytecodeProfile):
+ (WebKit::WebPageProxy::getContentsAsMHTMLData):
+ (WebKit::WebPageProxy::getSelectionOrContentsAsString):
+ (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
+ (WebKit::WebPageProxy::getMarkedRangeAsync):
+ (WebKit::WebPageProxy::getSelectedRangeAsync):
+ (WebKit::WebPageProxy::characterIndexForPointAsync):
+ (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
+ (WebKit::WebPageProxy::takeSnapshot):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _define:]):
+ (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
+ (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
+ (-[WKContentView requestDictationContext:]):
+ (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
+ (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::updateSelectionWithTouches):
+ (WebKit::WebPageProxy::requestAutocorrectionData):
+ (WebKit::WebPageProxy::applyAutocorrection):
+ (WebKit::WebPageProxy::requestDictationContext):
+ (WebKit::WebPageProxy::requestAutocorrectionContext):
+
</ins><span class="cx"> 2014-06-16 Jaehun Lim <ljaehun.lim@samsung.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed build fix after r170029
</span><span class="lines">@@ -175,7 +236,7 @@
</span><span class="cx">
</span><span class="cx"> 2014-06-15 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><del>- Part 1 of Change GenericCallback<> function parameters into std::function<>
</del><ins>+ Part 1 of: Change GenericCallback<> function parameters into std::function<>
</ins><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=133927
</span><span class="cx">
</span><span class="cx"> Reviewed by Sam Weinig.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -1562,7 +1562,7 @@
</span><span class="cx">
</span><span class="cx"> void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, WKStringRef scriptRef, void* context, WKPageRunJavaScriptFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->runJavaScriptInMainFrame(toImpl(scriptRef)->string(), ScriptValueCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+ toImpl(pageRef)->runJavaScriptInMainFrame(toImpl(scriptRef)->string(), toGenericCallbackFunction(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static std::function<void (const String&, CallbackBase::Error)> toGenericCallbackFunction(void* context, void (*callback)(WKStringRef, WKErrorRef, void*))
</span><span class="lines">@@ -1574,27 +1574,27 @@
</span><span class="cx">
</span><span class="cx"> void WKPageRenderTreeExternalRepresentation(WKPageRef pageRef, void* context, WKPageRenderTreeExternalRepresentationFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->getRenderTreeExternalRepresentation(StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+ toImpl(pageRef)->getRenderTreeExternalRepresentation(toGenericCallbackFunction(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageGetSourceForFrame(WKPageRef pageRef, WKFrameRef frameRef, void* context, WKPageGetSourceForFrameFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->getSourceForFrame(toImpl(frameRef), StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+ toImpl(pageRef)->getSourceForFrame(toImpl(frameRef), toGenericCallbackFunction(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageGetContentsAsString(WKPageRef pageRef, void* context, WKPageGetContentsAsStringFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->getContentsAsString(StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+ toImpl(pageRef)->getContentsAsString(toGenericCallbackFunction(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageGetBytecodeProfile(WKPageRef pageRef, void* context, WKPageGetBytecodeProfileFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->getBytecodeProfile(StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+ toImpl(pageRef)->getBytecodeProfile(toGenericCallbackFunction(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageGetSelectionAsWebArchiveData(WKPageRef pageRef, void* context, WKPageGetSelectionAsWebArchiveDataFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->getSelectionAsWebArchiveData(DataCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+ toImpl(pageRef)->getSelectionAsWebArchiveData(toGenericCallbackFunction(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageGetContentsAsMHTMLData(WKPageRef pageRef, bool useBinaryEncoding, void* context, WKPageGetContentsAsMHTMLDataFunction callback)
</span><span class="lines">@@ -1648,9 +1648,9 @@
</span><span class="cx">
</span><span class="cx"> void WKPageValidateCommand(WKPageRef pageRef, WKStringRef command, void* context, WKPageValidateCommandCallback callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->validateCommand(toImpl(command)->string(), ValidateCommandCallback::create([context, callback](const String& commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
</del><ins>+ toImpl(pageRef)->validateCommand(toImpl(command)->string(), [context, callback](const String& commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
</ins><span class="cx"> callback(toAPI(API::String::create(commandName).get()), isEnabled, state, error != CallbackBase::Error::None ? toAPI(API::Error::create().get()) : 0, context);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageExecuteCommand(WKPageRef pageRef, WKStringRef command)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPluginSiteDataManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -75,9 +75,9 @@
</span><span class="cx"> void WKPluginSiteDataManagerClearSiteData(WKPluginSiteDataManagerRef managerRef, WKArrayRef sitesRef, WKClearSiteDataFlags flags, uint64_t maxAgeInSeconds, void* context, WKPluginSiteDataManagerClearSiteDataFunction function)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>- toImpl(managerRef)->clearSiteData(toImpl(sitesRef), toNPClearSiteDataFlags(flags), maxAgeInSeconds, VoidCallback::create([context, function](CallbackBase::Error error) {
</del><ins>+ toImpl(managerRef)->clearSiteData(toImpl(sitesRef), toNPClearSiteDataFlags(flags), maxAgeInSeconds, [context, function](CallbackBase::Error error) {
</ins><span class="cx"> function(error == CallbackBase::Error::None ? nullptr : toAPI(API::Error::create().get()), context);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(managerRef);
</span><span class="cx"> UNUSED_PARAM(sitesRef);
</span><span class="lines">@@ -91,9 +91,9 @@
</span><span class="cx"> void WKPluginSiteDataManagerClearAllSiteData(WKPluginSiteDataManagerRef managerRef, void* context, WKPluginSiteDataManagerClearSiteDataFunction function)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>- toImpl(managerRef)->clearSiteData(0, NP_CLEAR_ALL, std::numeric_limits<uint64_t>::max(), VoidCallback::create([context, function](CallbackBase::Error error) {
</del><ins>+ toImpl(managerRef)->clearSiteData(0, NP_CLEAR_ALL, std::numeric_limits<uint64_t>::max(), [context, function](CallbackBase::Error error) {
</ins><span class="cx"> function(error == CallbackBase::Error::None ? nullptr : toAPI(API::Error::create().get()), context);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(managerRef);
</span><span class="cx"> UNUSED_PARAM(context);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -492,7 +492,7 @@
</span><span class="cx"> {
</span><span class="cx"> auto handler = adoptNS([completionHandler copy]);
</span><span class="cx">
</span><del>- _page->runJavaScriptInMainFrame(javaScriptString, WebKit::ScriptValueCallback::create([handler](WebKit::WebSerializedScriptValue* serializedScriptValue, WebKit::ScriptValueCallback::Error errorCode) {
</del><ins>+ _page->runJavaScriptInMainFrame(javaScriptString, [handler](WebKit::WebSerializedScriptValue* serializedScriptValue, WebKit::ScriptValueCallback::Error errorCode) {
</ins><span class="cx"> if (!handler)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -524,7 +524,7 @@
</span><span class="cx"> JSValue *value = [JSValue valueWithJSValueRef:valueRef inContext:context.get()];
</span><span class="cx">
</span><span class="cx"> completionHandler([value toObject], nil);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #pragma mark iOS-specific methods
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -835,13 +835,13 @@
</span><span class="cx"> // If we are not already awaiting validation for this command, start the asynchronous validation process.
</span><span class="cx"> // FIXME: Theoretically, there is a race here; when we get the answer it might be old, from a previous time
</span><span class="cx"> // we asked for the same command; there is no guarantee the answer is still valid.
</span><del>- _data->_page->validateCommand(commandName, ValidateCommandCallback::create([self](const String& commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
</del><ins>+ _data->_page->validateCommand(commandName, [self](const String& commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
</ins><span class="cx"> // If the process exits before the command can be validated, we'll be called back with an error.
</span><span class="cx"> if (error != CallbackBase::Error::None)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> [self _setUserInterfaceItemState:commandName enabled:isEnabled state:state];
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Treat as enabled until we get the result back from the web process and _setUserInterfaceItemState is called.
</span><span class="lines">@@ -852,14 +852,14 @@
</span><span class="cx">
</span><span class="cx"> - (IBAction)startSpeaking:(id)sender
</span><span class="cx"> {
</span><del>- _data->_page->getSelectionOrContentsAsString(StringCallback::create([self](const String& string, CallbackBase::Error error) {
</del><ins>+ _data->_page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
</ins><span class="cx"> if (error != CallbackBase::Error::None)
</span><span class="cx"> return;
</span><span class="cx"> if (!string)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> [NSApp speakString:string];
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (IBAction)stopSpeaking:(id)sender
</span><span class="lines">@@ -1464,7 +1464,7 @@
</span><span class="cx"> RetainPtr<id> completionHandler = adoptNS([completionHandlerPtr copy]);
</span><span class="cx">
</span><span class="cx"> LOG(TextInput, "selectedRange");
</span><del>- _data->_page->getSelectedRangeAsync(EditingRangeCallback::create([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
</del><ins>+ _data->_page->getSelectedRangeAsync([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
</ins><span class="cx"> void (^completionHandlerBlock)(NSRange) = (void (^)(NSRange))completionHandler.get();
</span><span class="cx"> if (error != CallbackBase::Error::None) {
</span><span class="cx"> LOG(TextInput, " ...selectedRange failed.");
</span><span class="lines">@@ -1477,7 +1477,7 @@
</span><span class="cx"> else
</span><span class="cx"> LOG(TextInput, " -> selectedRange returned (%llu, %llu)", result.location, result.length);
</span><span class="cx"> completionHandlerBlock(result);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)markedRangeWithCompletionHandler:(void(^)(NSRange markedRange))completionHandlerPtr
</span><span class="lines">@@ -1485,7 +1485,7 @@
</span><span class="cx"> RetainPtr<id> completionHandler = adoptNS([completionHandlerPtr copy]);
</span><span class="cx">
</span><span class="cx"> LOG(TextInput, "markedRange");
</span><del>- _data->_page->getMarkedRangeAsync(EditingRangeCallback::create([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
</del><ins>+ _data->_page->getMarkedRangeAsync([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
</ins><span class="cx"> void (^completionHandlerBlock)(NSRange) = (void (^)(NSRange))completionHandler.get();
</span><span class="cx"> if (error != CallbackBase::Error::None) {
</span><span class="cx"> LOG(TextInput, " ...markedRange failed.");
</span><span class="lines">@@ -1498,7 +1498,7 @@
</span><span class="cx"> else
</span><span class="cx"> LOG(TextInput, " -> markedRange returned (%llu, %llu)", result.location, result.length);
</span><span class="cx"> completionHandlerBlock(result);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)hasMarkedTextWithCompletionHandler:(void(^)(BOOL hasMarkedText))completionHandlerPtr
</span><span class="lines">@@ -1506,7 +1506,7 @@
</span><span class="cx"> RetainPtr<id> completionHandler = adoptNS([completionHandlerPtr copy]);
</span><span class="cx">
</span><span class="cx"> LOG(TextInput, "hasMarkedText");
</span><del>- _data->_page->getMarkedRangeAsync(EditingRangeCallback::create([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
</del><ins>+ _data->_page->getMarkedRangeAsync([completionHandler](const EditingRange& editingRangeResult, CallbackBase::Error error) {
</ins><span class="cx"> void (^completionHandlerBlock)(BOOL) = (void (^)(BOOL))completionHandler.get();
</span><span class="cx"> if (error != CallbackBase::Error::None) {
</span><span class="cx"> LOG(TextInput, " ...hasMarkedText failed.");
</span><span class="lines">@@ -1516,7 +1516,7 @@
</span><span class="cx"> BOOL hasMarkedText = editingRangeResult.location != notFound;
</span><span class="cx"> LOG(TextInput, " -> hasMarkedText returned %u", hasMarkedText);
</span><span class="cx"> completionHandlerBlock(hasMarkedText);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)attributedSubstringForProposedRange:(NSRange)nsRange completionHandler:(void(^)(NSAttributedString *attrString, NSRange actualRange))completionHandlerPtr
</span><span class="lines">@@ -1554,7 +1554,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- _data->_page->firstRectForCharacterRangeAsync(theRange, RectForCharacterRangeCallback::create([self, completionHandler](const IntRect& rect, const EditingRange& actualRange, CallbackBase::Error error) {
</del><ins>+ _data->_page->firstRectForCharacterRangeAsync(theRange, [self, completionHandler](const IntRect& rect, const EditingRange& actualRange, CallbackBase::Error error) {
</ins><span class="cx"> void (^completionHandlerBlock)(NSRect, NSRange) = (void (^)(NSRect, NSRange))completionHandler.get();
</span><span class="cx"> if (error != CallbackBase::Error::None) {
</span><span class="cx"> LOG(TextInput, " ...firstRectForCharacterRange failed.");
</span><span class="lines">@@ -1567,7 +1567,7 @@
</span><span class="cx">
</span><span class="cx"> LOG(TextInput, " -> firstRectForCharacterRange returned (%f, %f, %f, %f)", resultRect.origin.x, resultRect.origin.y, resultRect.size.width, resultRect.size.height);
</span><span class="cx"> completionHandlerBlock(resultRect, actualRange);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)characterIndexForPoint:(NSPoint)thePoint completionHandler:(void(^)(NSUInteger))completionHandlerPtr
</span><span class="lines">@@ -1585,7 +1585,7 @@
</span><span class="cx"> #pragma clang diagnostic pop
</span><span class="cx"> thePoint = [self convertPoint:thePoint fromView:nil]; // the point is relative to the main frame
</span><span class="cx">
</span><del>- _data->_page->characterIndexForPointAsync(IntPoint(thePoint), UnsignedCallback::create([completionHandler](uint64_t result, CallbackBase::Error error) {
</del><ins>+ _data->_page->characterIndexForPointAsync(IntPoint(thePoint), [completionHandler](uint64_t result, CallbackBase::Error error) {
</ins><span class="cx"> void (^completionHandlerBlock)(NSUInteger) = (void (^)(NSUInteger))completionHandler.get();
</span><span class="cx"> if (error != CallbackBase::Error::None) {
</span><span class="cx"> LOG(TextInput, " ...characterIndexForPoint failed.");
</span><span class="lines">@@ -1596,7 +1596,7 @@
</span><span class="cx"> result = NSNotFound;
</span><span class="cx"> LOG(TextInput, " -> characterIndexForPoint returned %lu", result);
</span><span class="cx"> completionHandlerBlock(result);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSTextInputContext *)inputContext
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsWebPluginSiteDataManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -168,9 +168,9 @@
</span><span class="cx"> callback->performCallbackWithReturnValue(API::Array::createStringArray(sites).get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPluginSiteDataManager::clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, PassRefPtr<VoidCallback> prpCallback)
</del><ins>+void WebPluginSiteDataManager::clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, std::function<void (CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<VoidCallback> callback = prpCallback;
</del><ins>+ RefPtr<VoidCallback> callback = VoidCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!m_webContext) {
</span><span class="cx"> // FIXME: If the context is invalid we should not call the callback. It'd be better to just return false from clearSiteData.
</span><span class="cx"> callback->invalidate(CallbackBase::Error::OwnerWasInvalidated);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsWebPluginSiteDataManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> void getSitesWithData(std::function<void (API::Array*, CallbackBase::Error)>);
</span><span class="cx"> void didGetSitesWithData(const Vector<String>& sites, uint64_t callbackID);
</span><span class="cx">
</span><del>- void clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, PassRefPtr<VoidCallback>);
</del><ins>+ void clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, std::function<void (CallbackBase::Error)>);
</ins><span class="cx"> void didClearSiteData(uint64_t callbackID);
</span><span class="cx">
</span><span class="cx"> void didGetSitesWithDataForSinglePlugin(const Vector<String>& sites, uint64_t callbackID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -1239,8 +1239,10 @@
</span><span class="cx"> m_process->send(Messages::WebPage::ClearSelection(), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback)
</del><ins>+void WebPageProxy::validateCommand(const String& commandName, std::function<void (const String&, bool, int32_t, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<ValidateCommandCallback> callback = ValidateCommandCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2183,9 +2185,9 @@
</span><span class="cx"> m_process->send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::runJavaScriptInMainFrame(const String& script, PassRefPtr<ScriptValueCallback> prpCallback)
</del><ins>+void WebPageProxy::runJavaScriptInMainFrame(const String& script, std::function<void (WebSerializedScriptValue*, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<ScriptValueCallback> callback = prpCallback;
</del><ins>+ RefPtr<ScriptValueCallback> callback = ScriptValueCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2196,9 +2198,9 @@
</span><span class="cx"> m_process->send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr<StringCallback> prpCallback)
</del><ins>+void WebPageProxy::getRenderTreeExternalRepresentation(std::function<void (const String&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<StringCallback> callback = prpCallback;
</del><ins>+ RefPtr<StringCallback> callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2209,9 +2211,9 @@
</span><span class="cx"> m_process->send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr<StringCallback> prpCallback)
</del><ins>+void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, std::function<void (const String&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<StringCallback> callback = prpCallback;
</del><ins>+ RefPtr<StringCallback> callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2223,9 +2225,9 @@
</span><span class="cx"> m_process->send(Messages::WebPage::GetSourceForFrame(frame->frameID(), callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::getContentsAsString(PassRefPtr<StringCallback> prpCallback)
</del><ins>+void WebPageProxy::getContentsAsString(std::function<void (const String&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<StringCallback> callback = prpCallback;
</del><ins>+ RefPtr<StringCallback> callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2237,9 +2239,9 @@
</span><span class="cx"> m_process->send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::getBytecodeProfile(PassRefPtr<StringCallback> prpCallback)
</del><ins>+void WebPageProxy::getBytecodeProfile(std::function<void (const String&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<StringCallback> callback = prpCallback;
</del><ins>+ RefPtr<StringCallback> callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2252,9 +2254,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MHTML)
</span><del>-void WebPageProxy::getContentsAsMHTMLData(PassRefPtr<DataCallback> prpCallback, bool useBinaryEncoding)
</del><ins>+void WebPageProxy::getContentsAsMHTMLData(std::function<void (API::Data*, CallbackBase::Error)> callbackFunction, bool useBinaryEncoding)
</ins><span class="cx"> {
</span><del>- RefPtr<DataCallback> callback = prpCallback;
</del><ins>+ RefPtr<DataCallback> callback = DataCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2266,9 +2268,9 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void WebPageProxy::getSelectionOrContentsAsString(PassRefPtr<StringCallback> prpCallback)
</del><ins>+void WebPageProxy::getSelectionOrContentsAsString(std::function<void (const String&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<StringCallback> callback = prpCallback;
</del><ins>+ RefPtr<StringCallback> callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -2279,9 +2281,9 @@
</span><span class="cx"> m_process->send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::getSelectionAsWebArchiveData(PassRefPtr<DataCallback> prpCallback)
</del><ins>+void WebPageProxy::getSelectionAsWebArchiveData(std::function<void (API::Data*, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<DataCallback> callback = prpCallback;
</del><ins>+ RefPtr<DataCallback> callback = DataCallback::create(std::move(callbackFunction));
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -4986,8 +4988,10 @@
</span><span class="cx"> process().send(Messages::WebPage::InsertTextAsync(text, replacementRange), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::getMarkedRangeAsync(PassRefPtr<EditingRangeCallback> callback)
</del><ins>+void WebPageProxy::getMarkedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<EditingRangeCallback> callback = EditingRangeCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -4999,8 +5003,10 @@
</span><span class="cx"> process().send(Messages::WebPage::GetMarkedRangeAsync(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::getSelectedRangeAsync(PassRefPtr<EditingRangeCallback> callback)
</del><ins>+void WebPageProxy::getSelectedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<EditingRangeCallback> callback = EditingRangeCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -5012,8 +5018,10 @@
</span><span class="cx"> process().send(Messages::WebPage::GetSelectedRangeAsync(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::characterIndexForPointAsync(const WebCore::IntPoint& point, PassRefPtr<UnsignedCallback> callback)
</del><ins>+void WebPageProxy::characterIndexForPointAsync(const WebCore::IntPoint& point, std::function<void (uint64_t, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<UnsignedCallback> callback = UnsignedCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -5025,8 +5033,10 @@
</span><span class="cx"> process().send(Messages::WebPage::CharacterIndexForPointAsync(point, callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::firstRectForCharacterRangeAsync(const EditingRange& range, PassRefPtr<RectForCharacterRangeCallback> callback)
</del><ins>+void WebPageProxy::firstRectForCharacterRangeAsync(const EditingRange& range, std::function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<RectForCharacterRangeCallback> callback = RectForCharacterRangeCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -5059,9 +5069,9 @@
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void WebPageProxy::takeSnapshot(IntRect rect, IntSize bitmapSize, SnapshotOptions options, ImageCallback::CallbackFunction callbackFunction)
</del><ins>+void WebPageProxy::takeSnapshot(IntRect rect, IntSize bitmapSize, SnapshotOptions options, std::function<void (const ShareableBitmap::Handle&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><del>- RefPtr<ImageCallback> callback = ImageCallback::create(callbackFunction);
</del><ins>+ RefPtr<ImageCallback> callback = ImageCallback::create(std::move(callbackFunction));
</ins><span class="cx">
</span><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx"> void addMIMETypeWithCustomContentProvider(const String& mimeType);
</span><span class="cx">
</span><span class="cx"> void executeEditCommand(const String& commandName);
</span><del>- void validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback>);
</del><ins>+ void validateCommand(const String& commandName, std::function<void (const String&, bool, int32_t, CallbackBase::Error)>);
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> double displayedContentScale() const { return m_lastVisibleContentRectUpdate.scale(); }
</span><span class="cx"> const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedRect(); }
</span><span class="lines">@@ -398,17 +398,17 @@
</span><span class="cx"> void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
</span><span class="cx">
</span><span class="cx"> void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
</span><del>- void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, PassRefPtr<TouchesCallback>);
</del><ins>+ void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, std::function<void (const WebCore::IntPoint&, uint32_t, CallbackBase::Error)>);
</ins><span class="cx"> void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
</span><span class="cx"> void updateBlockSelectionWithTouch(const WebCore::IntPoint, uint32_t touch, uint32_t handlePosition);
</span><span class="cx"> void extendSelection(WebCore::TextGranularity);
</span><span class="cx"> void selectWordBackward();
</span><del>- void requestAutocorrectionData(const String& textForAutocorrection, PassRefPtr<AutocorrectionDataCallback>);
- void applyAutocorrection(const String& correction, const String& originalText, PassRefPtr<StringCallback>);
</del><ins>+ void requestAutocorrectionData(const String& textForAutocorrection, std::function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)>);
+ void applyAutocorrection(const String& correction, const String& originalText, std::function<void (const String&, CallbackBase::Error)>);
</ins><span class="cx"> bool applyAutocorrection(const String& correction, const String& originalText);
</span><del>- void requestAutocorrectionContext(PassRefPtr<AutocorrectionContextCallback>);
</del><ins>+ void requestAutocorrectionContext(std::function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)>);
</ins><span class="cx"> void getAutocorrectionContext(String& contextBefore, String& markedText, String& selectedText, String& contextAfter, uint64_t& location, uint64_t& length);
</span><del>- void requestDictationContext(PassRefPtr<DictationContextCallback>);
</del><ins>+ void requestDictationContext(std::function<void (const String&, const String&, const String&, CallbackBase::Error)>);
</ins><span class="cx"> void replaceDictatedText(const String& oldText, const String& newText);
</span><span class="cx"> void replaceSelectedText(const String& oldText, const String& newText);
</span><span class="cx"> void didReceivePositionInformation(const InteractionInformationAtPosition&);
</span><span class="lines">@@ -471,10 +471,10 @@
</span><span class="cx"> LayerOrView* acceleratedCompositingRootLayer() const;
</span><span class="cx">
</span><span class="cx"> void insertTextAsync(const String& text, const EditingRange& replacementRange);
</span><del>- void getMarkedRangeAsync(PassRefPtr<EditingRangeCallback>);
- void getSelectedRangeAsync(PassRefPtr<EditingRangeCallback>);
- void characterIndexForPointAsync(const WebCore::IntPoint&, PassRefPtr<UnsignedCallback>);
- void firstRectForCharacterRangeAsync(const EditingRange&, PassRefPtr<RectForCharacterRangeCallback>);
</del><ins>+ void getMarkedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
+ void getSelectedRangeAsync(std::function<void (EditingRange, CallbackBase::Error)>);
+ void characterIndexForPointAsync(const WebCore::IntPoint&, std::function<void (uint64_t, CallbackBase::Error)>);
+ void firstRectForCharacterRangeAsync(const EditingRange&, std::function<void (const WebCore::IntRect&, const EditingRange&, CallbackBase::Error)>);
</ins><span class="cx"> void setCompositionAsync(const String& text, Vector<WebCore::CompositionUnderline> underlines, const EditingRange& selectionRange, const EditingRange& replacementRange);
</span><span class="cx"> void confirmCompositionAsync();
</span><span class="cx">
</span><span class="lines">@@ -651,20 +651,20 @@
</span><span class="cx"> void didFailToFindString(const String&);
</span><span class="cx"> void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);
</span><span class="cx">
</span><del>- void getContentsAsString(PassRefPtr<StringCallback>);
- void getBytecodeProfile(PassRefPtr<StringCallback>);
</del><ins>+ void getContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
+ void getBytecodeProfile(std::function<void (const String&, CallbackBase::Error)>);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(MHTML)
</span><del>- void getContentsAsMHTMLData(PassRefPtr<DataCallback>, bool useBinaryEncoding);
</del><ins>+ void getContentsAsMHTMLData(std::function<void (API::Data*, CallbackBase::Error)>, bool useBinaryEncoding);
</ins><span class="cx"> #endif
</span><span class="cx"> void getMainResourceDataOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
</span><span class="cx"> void getResourceDataFromFrame(WebFrameProxy*, API::URL*, std::function<void (API::Data*, CallbackBase::Error)>);
</span><del>- void getRenderTreeExternalRepresentation(PassRefPtr<StringCallback>);
- void getSelectionOrContentsAsString(PassRefPtr<StringCallback>);
- void getSelectionAsWebArchiveData(PassRefPtr<DataCallback>);
- void getSourceForFrame(WebFrameProxy*, PassRefPtr<StringCallback>);
</del><ins>+ void getRenderTreeExternalRepresentation(std::function<void (const String&, CallbackBase::Error)>);
+ void getSelectionOrContentsAsString(std::function<void (const String&, CallbackBase::Error)>);
+ void getSelectionAsWebArchiveData(std::function<void (API::Data*, CallbackBase::Error)>);
+ void getSourceForFrame(WebFrameProxy*, std::function<void (const String&, CallbackBase::Error)>);
</ins><span class="cx"> void getWebArchiveOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
</span><del>- void runJavaScriptInMainFrame(const String&, PassRefPtr<ScriptValueCallback>);
</del><ins>+ void runJavaScriptInMainFrame(const String&, std::function<void (WebSerializedScriptValue*, CallbackBase::Error)> callbackFunction);
</ins><span class="cx"> void forceRepaint(PassRefPtr<VoidCallback>);
</span><span class="cx">
</span><span class="cx"> float headerHeight(WebFrameProxy*);
</span><span class="lines">@@ -892,7 +892,7 @@
</span><span class="cx">
</span><span class="cx"> void setThumbnailScale(double);
</span><span class="cx">
</span><del>- void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, ImageCallback::CallbackFunction);
</del><ins>+ void takeSnapshot(WebCore::IntRect, WebCore::IntSize bitmapSize, SnapshotOptions, std::function<void (const ShareableBitmap::Handle&, CallbackBase::Error)>);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -1210,14 +1210,14 @@
</span><span class="cx">
</span><span class="cx"> - (void)_define:(id)sender
</span><span class="cx"> {
</span><del>- _page->getSelectionOrContentsAsString(StringCallback::create([self](const String& string, CallbackBase::Error error) {
</del><ins>+ _page->getSelectionOrContentsAsString([self](const String& string, CallbackBase::Error error) {
</ins><span class="cx"> if (error != CallbackBase::Error::None)
</span><span class="cx"> return;
</span><span class="cx"> if (!string)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> [self _showDictionary:string];
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // UIWKInteractionViewProtocol
</span><span class="lines">@@ -1439,11 +1439,11 @@
</span><span class="cx"> - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart
</span><span class="cx"> {
</span><span class="cx"> _usingGestureForSelection = YES;
</span><del>- _page->updateSelectionWithTouches(WebCore::IntPoint(point), static_cast<uint32_t>(toSelectionTouch(touch)), baseIsStart, TouchesCallback::create([self, touch](const WebCore::IntPoint& point, uint32_t touch, CallbackBase::Error error) {
</del><ins>+ _page->updateSelectionWithTouches(WebCore::IntPoint(point), static_cast<uint32_t>(toSelectionTouch(touch)), baseIsStart, [self, touch](const WebCore::IntPoint& point, uint32_t touch, CallbackBase::Error error) {
</ins><span class="cx"> selectionChangedWithTouch(self, point, touch, error);
</span><span class="cx"> if (touch != UIWKSelectionTouchStarted && touch != UIWKSelectionTouchMoved)
</span><span class="cx"> _usingGestureForSelection = NO;
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)changeSelectionWithTouchesFrom:(CGPoint)from to:(CGPoint)to withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState
</span><span class="lines">@@ -1476,7 +1476,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _autocorrectionData.autocorrectionHandler = [completionHandler copy];
</span><del>- _page->requestAutocorrectionData(input, AutocorrectionDataCallback::create([self](const Vector<FloatRect>& rects, const String& fontName, double fontSize, uint64_t traits, CallbackBase::Error) {
</del><ins>+ _page->requestAutocorrectionData(input, [self](const Vector<FloatRect>& rects, const String& fontName, double fontSize, uint64_t traits, CallbackBase::Error) {
</ins><span class="cx"> CGRect firstRect = CGRectZero;
</span><span class="cx"> CGRect lastRect = CGRectZero;
</span><span class="cx"> if (rects.size()) {
</span><span class="lines">@@ -1493,7 +1493,7 @@
</span><span class="cx"> _autocorrectionData.autocorrectionHandler(rects.size() ? [WKAutocorrectionRects autocorrectionRectsWithRects:firstRect lastRect:lastRect] : nil);
</span><span class="cx"> [_autocorrectionData.autocorrectionHandler release];
</span><span class="cx"> _autocorrectionData.autocorrectionHandler = nil;
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (UTF32Char)_characterBeforeCaretSelection
</span><span class="lines">@@ -1539,10 +1539,10 @@
</span><span class="cx"> {
</span><span class="cx"> UIWKDictationContextHandler dictationHandler = [completionHandler copy];
</span><span class="cx">
</span><del>- _page->requestDictationContext(DictationContextCallback::create([dictationHandler](const String& selectedText, const String& beforeText, const String& afterText, CallbackBase::Error) {
</del><ins>+ _page->requestDictationContext([dictationHandler](const String& selectedText, const String& beforeText, const String& afterText, CallbackBase::Error) {
</ins><span class="cx"> dictationHandler(selectedText, beforeText, afterText);
</span><span class="cx"> [dictationHandler release];
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // The completion handler should pass the rect of the correction text after replacing the input text, or nil if the replacement could not be performed.
</span><span class="lines">@@ -1556,11 +1556,11 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> _autocorrectionData.autocorrectionHandler = [completionHandler copy];
</span><del>- _page->applyAutocorrection(correction, input, StringCallback::create([self](const String& string, CallbackBase::Error error) {
</del><ins>+ _page->applyAutocorrection(correction, input, [self](const String& string, CallbackBase::Error error) {
</ins><span class="cx"> _autocorrectionData.autocorrectionHandler(!string.isNull() ? [WKAutocorrectionRects autocorrectionRectsWithRects:_autocorrectionData.textFirstRect lastRect:_autocorrectionData.textLastRect] : nil);
</span><span class="cx"> [_autocorrectionData.autocorrectionHandler release];
</span><span class="cx"> _autocorrectionData.autocorrectionHandler = nil;
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)requestAutocorrectionContextWithCompletionHandler:(void (^)(UIWKAutocorrectionContext *autocorrectionContext))completionHandler
</span><span class="lines">@@ -1579,9 +1579,9 @@
</span><span class="cx"> completionHandler([WKAutocorrectionContext autocorrectionContextWithData:beforeText markedText:markedText selectedText:selectedText afterText:afterText selectedRangeInMarkedText:NSMakeRange(location, length)]);
</span><span class="cx"> } else {
</span><span class="cx"> _autocorrectionData.autocorrectionContextHandler = [completionHandler copy];
</span><del>- _page->requestAutocorrectionContext(AutocorrectionContextCallback::create([self](const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackBase::Error) {
</del><ins>+ _page->requestAutocorrectionContext([self](const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, CallbackBase::Error) {
</ins><span class="cx"> _autocorrectionData.autocorrectionContextHandler([WKAutocorrectionContext autocorrectionContextWithData:beforeText markedText:markedText selectedText:selectedText afterText:afterText selectedRangeInMarkedText:NSMakeRange(location, length)]);
</span><del>- }));
</del><ins>+ });
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (170040 => 170041)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-06-17 02:26:36 UTC (rev 170040)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-06-17 03:52:21 UTC (rev 170041)
</span><span class="lines">@@ -317,8 +317,10 @@
</span><span class="cx"> m_process->send(Messages::WebPage::SelectWithGesture(point, (uint32_t)granularity, gestureType, gestureState, callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::updateSelectionWithTouches(const WebCore::IntPoint point, uint32_t touches, bool baseIsStart, PassRefPtr<TouchesCallback> callback)
</del><ins>+void WebPageProxy::updateSelectionWithTouches(const WebCore::IntPoint point, uint32_t touches, bool baseIsStart, std::function<void (const WebCore::IntPoint&, uint32_t, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<TouchesCallback> callback = TouchesCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -339,8 +341,10 @@
</span><span class="cx"> m_process->send(Messages::WebPage::ReplaceSelectedText(oldText, newText), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::requestAutocorrectionData(const String& textForAutocorrection, PassRefPtr<AutocorrectionDataCallback> callback)
</del><ins>+void WebPageProxy::requestAutocorrectionData(const String& textForAutocorrection, std::function<void (const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<AutocorrectionDataCallback> callback = AutocorrectionDataCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -351,8 +355,10 @@
</span><span class="cx"> m_process->send(Messages::WebPage::RequestAutocorrectionData(textForAutocorrection, callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::applyAutocorrection(const String& correction, const String& originalText, PassRefPtr<StringCallback> callback)
</del><ins>+void WebPageProxy::applyAutocorrection(const String& correction, const String& originalText, std::function<void (const String&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<StringCallback> callback = StringCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -370,8 +376,10 @@
</span><span class="cx"> return autocorrectionApplied;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::requestDictationContext(PassRefPtr<DictationContextCallback> callback)
</del><ins>+void WebPageProxy::requestDictationContext(std::function<void (const String&, const String&, const String&, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<DictationContextCallback> callback = DictationContextCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span><span class="lines">@@ -382,8 +390,10 @@
</span><span class="cx"> m_process->send(Messages::WebPage::RequestDictationContext(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPageProxy::requestAutocorrectionContext(PassRefPtr<AutocorrectionContextCallback> callback)
</del><ins>+void WebPageProxy::requestAutocorrectionContext(std::function<void (const String&, const String&, const String&, const String&, uint64_t, uint64_t, CallbackBase::Error)> callbackFunction)
</ins><span class="cx"> {
</span><ins>+ RefPtr<AutocorrectionContextCallback> callback = AutocorrectionContextCallback::create(std::move(callbackFunction));
+
</ins><span class="cx"> if (!isValid()) {
</span><span class="cx"> callback->invalidate();
</span><span class="cx"> return;
</span></span></pre>
</div>
</div>
</body>
</html>