<!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&lt;&gt; function parameters into std::function&lt;&gt;
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  &lt;mitz@apple.com&gt;
+
+        Part 2 of: Change GenericCallback&lt;&gt; function parameters into std::function&lt;&gt;
+        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  &lt;ljaehun.lim@samsung.com&gt;
</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  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><del>-        Part 1 of Change GenericCallback&lt;&gt; function parameters into std::function&lt;&gt;
</del><ins>+        Part 1 of: Change GenericCallback&lt;&gt; function parameters into std::function&lt;&gt;
</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)-&gt;runJavaScriptInMainFrame(toImpl(scriptRef)-&gt;string(), ScriptValueCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+    toImpl(pageRef)-&gt;runJavaScriptInMainFrame(toImpl(scriptRef)-&gt;string(), toGenericCallbackFunction(context, callback));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static std::function&lt;void (const String&amp;, CallbackBase::Error)&gt; 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)-&gt;getRenderTreeExternalRepresentation(StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+    toImpl(pageRef)-&gt;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)-&gt;getSourceForFrame(toImpl(frameRef), StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+    toImpl(pageRef)-&gt;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)-&gt;getContentsAsString(StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+    toImpl(pageRef)-&gt;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)-&gt;getBytecodeProfile(StringCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+    toImpl(pageRef)-&gt;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)-&gt;getSelectionAsWebArchiveData(DataCallback::create(toGenericCallbackFunction(context, callback)));
</del><ins>+    toImpl(pageRef)-&gt;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)-&gt;validateCommand(toImpl(command)-&gt;string(), ValidateCommandCallback::create([context, callback](const String&amp; commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
</del><ins>+    toImpl(pageRef)-&gt;validateCommand(toImpl(command)-&gt;string(), [context, callback](const String&amp; 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)-&gt;clearSiteData(toImpl(sitesRef), toNPClearSiteDataFlags(flags), maxAgeInSeconds, VoidCallback::create([context, function](CallbackBase::Error error) {
</del><ins>+    toImpl(managerRef)-&gt;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)-&gt;clearSiteData(0, NP_CLEAR_ALL, std::numeric_limits&lt;uint64_t&gt;::max(), VoidCallback::create([context, function](CallbackBase::Error error) {
</del><ins>+    toImpl(managerRef)-&gt;clearSiteData(0, NP_CLEAR_ALL, std::numeric_limits&lt;uint64_t&gt;::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-&gt;runJavaScriptInMainFrame(javaScriptString, WebKit::ScriptValueCallback::create([handler](WebKit::WebSerializedScriptValue* serializedScriptValue, WebKit::ScriptValueCallback::Error errorCode) {
</del><ins>+    _page-&gt;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-&gt;_page-&gt;validateCommand(commandName, ValidateCommandCallback::create([self](const String&amp; commandName, bool isEnabled, int32_t state, CallbackBase::Error error) {
</del><ins>+        _data-&gt;_page-&gt;validateCommand(commandName, [self](const String&amp; 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-&gt;_page-&gt;getSelectionOrContentsAsString(StringCallback::create([self](const String&amp; string, CallbackBase::Error error) {
</del><ins>+    _data-&gt;_page-&gt;getSelectionOrContentsAsString([self](const String&amp; 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&lt;id&gt; completionHandler = adoptNS([completionHandlerPtr copy]);
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;selectedRange&quot;);
</span><del>-    _data-&gt;_page-&gt;getSelectedRangeAsync(EditingRangeCallback::create([completionHandler](const EditingRange&amp; editingRangeResult, CallbackBase::Error error) {
</del><ins>+    _data-&gt;_page-&gt;getSelectedRangeAsync([completionHandler](const EditingRange&amp; 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, &quot;    ...selectedRange failed.&quot;);
</span><span class="lines">@@ -1477,7 +1477,7 @@
</span><span class="cx">         else
</span><span class="cx">             LOG(TextInput, &quot;    -&gt; selectedRange returned (%llu, %llu)&quot;, 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&lt;id&gt; completionHandler = adoptNS([completionHandlerPtr copy]);
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;markedRange&quot;);
</span><del>-    _data-&gt;_page-&gt;getMarkedRangeAsync(EditingRangeCallback::create([completionHandler](const EditingRange&amp; editingRangeResult, CallbackBase::Error error) {
</del><ins>+    _data-&gt;_page-&gt;getMarkedRangeAsync([completionHandler](const EditingRange&amp; 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, &quot;    ...markedRange failed.&quot;);
</span><span class="lines">@@ -1498,7 +1498,7 @@
</span><span class="cx">         else
</span><span class="cx">             LOG(TextInput, &quot;    -&gt; markedRange returned (%llu, %llu)&quot;, 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&lt;id&gt; completionHandler = adoptNS([completionHandlerPtr copy]);
</span><span class="cx"> 
</span><span class="cx">     LOG(TextInput, &quot;hasMarkedText&quot;);
</span><del>-    _data-&gt;_page-&gt;getMarkedRangeAsync(EditingRangeCallback::create([completionHandler](const EditingRange&amp; editingRangeResult, CallbackBase::Error error) {
</del><ins>+    _data-&gt;_page-&gt;getMarkedRangeAsync([completionHandler](const EditingRange&amp; 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, &quot;    ...hasMarkedText failed.&quot;);
</span><span class="lines">@@ -1516,7 +1516,7 @@
</span><span class="cx">         BOOL hasMarkedText = editingRangeResult.location != notFound;
</span><span class="cx">         LOG(TextInput, &quot;    -&gt; hasMarkedText returned %u&quot;, 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-&gt;_page-&gt;firstRectForCharacterRangeAsync(theRange, RectForCharacterRangeCallback::create([self, completionHandler](const IntRect&amp; rect, const EditingRange&amp; actualRange, CallbackBase::Error error) {
</del><ins>+    _data-&gt;_page-&gt;firstRectForCharacterRangeAsync(theRange, [self, completionHandler](const IntRect&amp; rect, const EditingRange&amp; 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, &quot;    ...firstRectForCharacterRange failed.&quot;);
</span><span class="lines">@@ -1567,7 +1567,7 @@
</span><span class="cx"> 
</span><span class="cx">         LOG(TextInput, &quot;    -&gt; firstRectForCharacterRange returned (%f, %f, %f, %f)&quot;, 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-&gt;_page-&gt;characterIndexForPointAsync(IntPoint(thePoint), UnsignedCallback::create([completionHandler](uint64_t result, CallbackBase::Error error) {
</del><ins>+    _data-&gt;_page-&gt;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, &quot;    ...characterIndexForPoint failed.&quot;);
</span><span class="lines">@@ -1596,7 +1596,7 @@
</span><span class="cx">             result = NSNotFound;
</span><span class="cx">         LOG(TextInput, &quot;    -&gt; characterIndexForPoint returned %lu&quot;, 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-&gt;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&lt;VoidCallback&gt; prpCallback)
</del><ins>+void WebPluginSiteDataManager::clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, std::function&lt;void (CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;VoidCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;VoidCallback&gt; 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-&gt;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&lt;void (API::Array*, CallbackBase::Error)&gt;);
</span><span class="cx">     void didGetSitesWithData(const Vector&lt;String&gt;&amp; sites, uint64_t callbackID);
</span><span class="cx"> 
</span><del>-    void clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, PassRefPtr&lt;VoidCallback&gt;);
</del><ins>+    void clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, std::function&lt;void (CallbackBase::Error)&gt;);
</ins><span class="cx">     void didClearSiteData(uint64_t callbackID);
</span><span class="cx"> 
</span><span class="cx">     void didGetSitesWithDataForSinglePlugin(const Vector&lt;String&gt;&amp; 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-&gt;send(Messages::WebPage::ClearSelection(), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::validateCommand(const String&amp; commandName, PassRefPtr&lt;ValidateCommandCallback&gt; callback)
</del><ins>+void WebPageProxy::validateCommand(const String&amp; commandName, std::function&lt;void (const String&amp;, bool, int32_t, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;ValidateCommandCallback&gt; callback = ValidateCommandCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -2183,9 +2185,9 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::CountStringMatches(string, options, maxMatchCount), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::runJavaScriptInMainFrame(const String&amp; script, PassRefPtr&lt;ScriptValueCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::runJavaScriptInMainFrame(const String&amp; script, std::function&lt;void (WebSerializedScriptValue*, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;ScriptValueCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;ScriptValueCallback&gt; callback = ScriptValueCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -2196,9 +2198,9 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::RunJavaScriptInMainFrame(script, callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::getRenderTreeExternalRepresentation(PassRefPtr&lt;StringCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::getRenderTreeExternalRepresentation(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;StringCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;StringCallback&gt; callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -2209,9 +2211,9 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::GetRenderTreeExternalRepresentation(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, PassRefPtr&lt;StringCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::getSourceForFrame(WebFrameProxy* frame, std::function&lt;void (const String&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;StringCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;StringCallback&gt; callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -2223,9 +2225,9 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::GetSourceForFrame(frame-&gt;frameID(), callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::getContentsAsString(PassRefPtr&lt;StringCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::getContentsAsString(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;StringCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;StringCallback&gt; callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -2237,9 +2239,9 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::GetContentsAsString(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::getBytecodeProfile(PassRefPtr&lt;StringCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::getBytecodeProfile(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;StringCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;StringCallback&gt; callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&lt;DataCallback&gt; prpCallback, bool useBinaryEncoding)
</del><ins>+void WebPageProxy::getContentsAsMHTMLData(std::function&lt;void (API::Data*, CallbackBase::Error)&gt; callbackFunction, bool useBinaryEncoding)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;DataCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;DataCallback&gt; callback = DataCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&lt;StringCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::getSelectionOrContentsAsString(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;StringCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;StringCallback&gt; callback = StringCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -2279,9 +2281,9 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::GetSelectionOrContentsAsString(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::getSelectionAsWebArchiveData(PassRefPtr&lt;DataCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::getSelectionAsWebArchiveData(std::function&lt;void (API::Data*, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;DataCallback&gt; callback = prpCallback;
</del><ins>+    RefPtr&lt;DataCallback&gt; callback = DataCallback::create(std::move(callbackFunction));
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&lt;EditingRangeCallback&gt; callback)
</del><ins>+void WebPageProxy::getMarkedRangeAsync(std::function&lt;void (EditingRange, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;EditingRangeCallback&gt; callback = EditingRangeCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&lt;EditingRangeCallback&gt; callback)
</del><ins>+void WebPageProxy::getSelectedRangeAsync(std::function&lt;void (EditingRange, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;EditingRangeCallback&gt; callback = EditingRangeCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&amp; point, PassRefPtr&lt;UnsignedCallback&gt; callback)
</del><ins>+void WebPageProxy::characterIndexForPointAsync(const WebCore::IntPoint&amp; point, std::function&lt;void (uint64_t, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;UnsignedCallback&gt; callback = UnsignedCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&amp; range, PassRefPtr&lt;RectForCharacterRangeCallback&gt; callback)
</del><ins>+void WebPageProxy::firstRectForCharacterRangeAsync(const EditingRange&amp; range, std::function&lt;void (const WebCore::IntRect&amp;, const EditingRange&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;RectForCharacterRangeCallback&gt; callback = RectForCharacterRangeCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&lt;void (const ShareableBitmap::Handle&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;ImageCallback&gt; callback = ImageCallback::create(callbackFunction);
</del><ins>+    RefPtr&lt;ImageCallback&gt; callback = ImageCallback::create(std::move(callbackFunction));
</ins><span class="cx"> 
</span><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&amp; mimeType);
</span><span class="cx"> 
</span><span class="cx">     void executeEditCommand(const String&amp; commandName);
</span><del>-    void validateCommand(const String&amp; commandName, PassRefPtr&lt;ValidateCommandCallback&gt;);
</del><ins>+    void validateCommand(const String&amp; commandName, std::function&lt;void (const String&amp;, bool, int32_t, CallbackBase::Error)&gt;);
</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&amp; exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedRect(); }
</span><span class="lines">@@ -398,17 +398,17 @@
</span><span class="cx">     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&amp;);
</span><span class="cx"> 
</span><span class="cx">     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, std::function&lt;void (const WebCore::IntPoint&amp;, uint32_t, uint32_t, uint32_t, CallbackBase::Error)&gt;);
</span><del>-    void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, PassRefPtr&lt;TouchesCallback&gt;);
</del><ins>+    void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, std::function&lt;void (const WebCore::IntPoint&amp;, uint32_t, CallbackBase::Error)&gt;);
</ins><span class="cx">     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function&lt;void (const WebCore::IntPoint&amp;, uint32_t, uint32_t, uint32_t, CallbackBase::Error)&gt;);
</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&amp; textForAutocorrection, PassRefPtr&lt;AutocorrectionDataCallback&gt;);
-    void applyAutocorrection(const String&amp; correction, const String&amp; originalText, PassRefPtr&lt;StringCallback&gt;);
</del><ins>+    void requestAutocorrectionData(const String&amp; textForAutocorrection, std::function&lt;void (const Vector&lt;WebCore::FloatRect&gt;&amp;, const String&amp;, double, uint64_t, CallbackBase::Error)&gt;);
+    void applyAutocorrection(const String&amp; correction, const String&amp; originalText, std::function&lt;void (const String&amp;, CallbackBase::Error)&gt;);
</ins><span class="cx">     bool applyAutocorrection(const String&amp; correction, const String&amp; originalText);
</span><del>-    void requestAutocorrectionContext(PassRefPtr&lt;AutocorrectionContextCallback&gt;);
</del><ins>+    void requestAutocorrectionContext(std::function&lt;void (const String&amp;, const String&amp;, const String&amp;, const String&amp;, uint64_t, uint64_t, CallbackBase::Error)&gt;);
</ins><span class="cx">     void getAutocorrectionContext(String&amp; contextBefore, String&amp; markedText, String&amp; selectedText, String&amp; contextAfter, uint64_t&amp; location, uint64_t&amp; length);
</span><del>-    void requestDictationContext(PassRefPtr&lt;DictationContextCallback&gt;);
</del><ins>+    void requestDictationContext(std::function&lt;void (const String&amp;, const String&amp;, const String&amp;, CallbackBase::Error)&gt;);
</ins><span class="cx">     void replaceDictatedText(const String&amp; oldText, const String&amp; newText);
</span><span class="cx">     void replaceSelectedText(const String&amp; oldText, const String&amp; newText);
</span><span class="cx">     void didReceivePositionInformation(const InteractionInformationAtPosition&amp;);
</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&amp; text, const EditingRange&amp; replacementRange);
</span><del>-    void getMarkedRangeAsync(PassRefPtr&lt;EditingRangeCallback&gt;);
-    void getSelectedRangeAsync(PassRefPtr&lt;EditingRangeCallback&gt;);
-    void characterIndexForPointAsync(const WebCore::IntPoint&amp;, PassRefPtr&lt;UnsignedCallback&gt;);
-    void firstRectForCharacterRangeAsync(const EditingRange&amp;, PassRefPtr&lt;RectForCharacterRangeCallback&gt;);
</del><ins>+    void getMarkedRangeAsync(std::function&lt;void (EditingRange, CallbackBase::Error)&gt;);
+    void getSelectedRangeAsync(std::function&lt;void (EditingRange, CallbackBase::Error)&gt;);
+    void characterIndexForPointAsync(const WebCore::IntPoint&amp;, std::function&lt;void (uint64_t, CallbackBase::Error)&gt;);
+    void firstRectForCharacterRangeAsync(const EditingRange&amp;, std::function&lt;void (const WebCore::IntRect&amp;, const EditingRange&amp;, CallbackBase::Error)&gt;);
</ins><span class="cx">     void setCompositionAsync(const String&amp; text, Vector&lt;WebCore::CompositionUnderline&gt; underlines, const EditingRange&amp; selectionRange, const EditingRange&amp; 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&amp;);
</span><span class="cx">     void didFindStringMatches(const String&amp;, const Vector&lt;Vector&lt;WebCore::IntRect&gt;&gt;&amp; matchRects, int32_t firstIndexAfterSelection);
</span><span class="cx"> 
</span><del>-    void getContentsAsString(PassRefPtr&lt;StringCallback&gt;);
-    void getBytecodeProfile(PassRefPtr&lt;StringCallback&gt;);
</del><ins>+    void getContentsAsString(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt;);
+    void getBytecodeProfile(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt;);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(MHTML)
</span><del>-    void getContentsAsMHTMLData(PassRefPtr&lt;DataCallback&gt;, bool useBinaryEncoding);
</del><ins>+    void getContentsAsMHTMLData(std::function&lt;void (API::Data*, CallbackBase::Error)&gt;, bool useBinaryEncoding);
</ins><span class="cx"> #endif
</span><span class="cx">     void getMainResourceDataOfFrame(WebFrameProxy*, std::function&lt;void (API::Data*, CallbackBase::Error)&gt;);
</span><span class="cx">     void getResourceDataFromFrame(WebFrameProxy*, API::URL*, std::function&lt;void (API::Data*, CallbackBase::Error)&gt;);
</span><del>-    void getRenderTreeExternalRepresentation(PassRefPtr&lt;StringCallback&gt;);
-    void getSelectionOrContentsAsString(PassRefPtr&lt;StringCallback&gt;);
-    void getSelectionAsWebArchiveData(PassRefPtr&lt;DataCallback&gt;);
-    void getSourceForFrame(WebFrameProxy*, PassRefPtr&lt;StringCallback&gt;);
</del><ins>+    void getRenderTreeExternalRepresentation(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt;);
+    void getSelectionOrContentsAsString(std::function&lt;void (const String&amp;, CallbackBase::Error)&gt;);
+    void getSelectionAsWebArchiveData(std::function&lt;void (API::Data*, CallbackBase::Error)&gt;);
+    void getSourceForFrame(WebFrameProxy*, std::function&lt;void (const String&amp;, CallbackBase::Error)&gt;);
</ins><span class="cx">     void getWebArchiveOfFrame(WebFrameProxy*, std::function&lt;void (API::Data*, CallbackBase::Error)&gt;);
</span><del>-    void runJavaScriptInMainFrame(const String&amp;, PassRefPtr&lt;ScriptValueCallback&gt;);
</del><ins>+    void runJavaScriptInMainFrame(const String&amp;, std::function&lt;void (WebSerializedScriptValue*, CallbackBase::Error)&gt; callbackFunction);
</ins><span class="cx">     void forceRepaint(PassRefPtr&lt;VoidCallback&gt;);
</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&lt;void (const ShareableBitmap::Handle&amp;, CallbackBase::Error)&gt;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     WebPageProxy(PageClient&amp;, WebProcessProxy&amp;, uint64_t pageID, const WebPageConfiguration&amp;);
</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-&gt;getSelectionOrContentsAsString(StringCallback::create([self](const String&amp; string, CallbackBase::Error error) {
</del><ins>+    _page-&gt;getSelectionOrContentsAsString([self](const String&amp; 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-&gt;updateSelectionWithTouches(WebCore::IntPoint(point), static_cast&lt;uint32_t&gt;(toSelectionTouch(touch)), baseIsStart, TouchesCallback::create([self, touch](const WebCore::IntPoint&amp; point, uint32_t touch, CallbackBase::Error error) {
</del><ins>+    _page-&gt;updateSelectionWithTouches(WebCore::IntPoint(point), static_cast&lt;uint32_t&gt;(toSelectionTouch(touch)), baseIsStart, [self, touch](const WebCore::IntPoint&amp; point, uint32_t touch, CallbackBase::Error error) {
</ins><span class="cx">         selectionChangedWithTouch(self, point, touch, error);
</span><span class="cx">         if (touch != UIWKSelectionTouchStarted &amp;&amp; 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-&gt;requestAutocorrectionData(input, AutocorrectionDataCallback::create([self](const Vector&lt;FloatRect&gt;&amp; rects, const String&amp; fontName, double fontSize, uint64_t traits, CallbackBase::Error) {
</del><ins>+    _page-&gt;requestAutocorrectionData(input, [self](const Vector&lt;FloatRect&gt;&amp; rects, const String&amp; 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-&gt;requestDictationContext(DictationContextCallback::create([dictationHandler](const String&amp; selectedText, const String&amp; beforeText, const String&amp; afterText, CallbackBase::Error) {
</del><ins>+    _page-&gt;requestDictationContext([dictationHandler](const String&amp; selectedText, const String&amp; beforeText, const String&amp; 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-&gt;applyAutocorrection(correction, input, StringCallback::create([self](const String&amp; string, CallbackBase::Error error) {
</del><ins>+    _page-&gt;applyAutocorrection(correction, input, [self](const String&amp; 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-&gt;requestAutocorrectionContext(AutocorrectionContextCallback::create([self](const String&amp; beforeText, const String&amp; markedText, const String&amp; selectedText, const String&amp; afterText, uint64_t location, uint64_t length, CallbackBase::Error) {
</del><ins>+        _page-&gt;requestAutocorrectionContext([self](const String&amp; beforeText, const String&amp; markedText, const String&amp; selectedText, const String&amp; 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-&gt;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&lt;TouchesCallback&gt; callback)
</del><ins>+void WebPageProxy::updateSelectionWithTouches(const WebCore::IntPoint point, uint32_t touches, bool baseIsStart, std::function&lt;void (const WebCore::IntPoint&amp;, uint32_t, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;TouchesCallback&gt; callback = TouchesCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -339,8 +341,10 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::ReplaceSelectedText(oldText, newText), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::requestAutocorrectionData(const String&amp; textForAutocorrection, PassRefPtr&lt;AutocorrectionDataCallback&gt; callback)
</del><ins>+void WebPageProxy::requestAutocorrectionData(const String&amp; textForAutocorrection, std::function&lt;void (const Vector&lt;WebCore::FloatRect&gt;&amp;, const String&amp;, double, uint64_t, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;AutocorrectionDataCallback&gt; callback = AutocorrectionDataCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -351,8 +355,10 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::RequestAutocorrectionData(textForAutocorrection, callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::applyAutocorrection(const String&amp; correction, const String&amp; originalText, PassRefPtr&lt;StringCallback&gt; callback)
</del><ins>+void WebPageProxy::applyAutocorrection(const String&amp; correction, const String&amp; originalText, std::function&lt;void (const String&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;StringCallback&gt; callback = StringCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;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&lt;DictationContextCallback&gt; callback)
</del><ins>+void WebPageProxy::requestDictationContext(std::function&lt;void (const String&amp;, const String&amp;, const String&amp;, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;DictationContextCallback&gt; callback = DictationContextCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span><span class="lines">@@ -382,8 +390,10 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::RequestDictationContext(callbackID), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::requestAutocorrectionContext(PassRefPtr&lt;AutocorrectionContextCallback&gt; callback)
</del><ins>+void WebPageProxy::requestAutocorrectionContext(std::function&lt;void (const String&amp;, const String&amp;, const String&amp;, const String&amp;, uint64_t, uint64_t, CallbackBase::Error)&gt; callbackFunction)
</ins><span class="cx"> {
</span><ins>+    RefPtr&lt;AutocorrectionContextCallback&gt; callback = AutocorrectionContextCallback::create(std::move(callbackFunction));
+
</ins><span class="cx">     if (!isValid()) {
</span><span class="cx">         callback-&gt;invalidate();
</span><span class="cx">         return;
</span></span></pre>
</div>
</div>

</body>
</html>