<!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>[164409] 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/164409">164409</a></dd>
<dt>Author</dt> <dd>ap@apple.com</dd>
<dt>Date</dt> <dd>2014-02-19 19:21:41 -0800 (Wed, 19 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WK2] IPC callback classes should not be tightly coupled to C API
https://bugs.webkit.org/show_bug.cgi?id=129030
Reviewed by Anders Carlsson.
Changed CallbackBase subclasses to take an std::function (with context captured inside).
Instead of C API objects, these callback functions take implementation ones.
There are VoidAPICallback and GenericAPICallback helpers for the common case of C API.
* Shared/SecurityOriginData.h:
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetApplicationCacheOrigins):
* UIProcess/API/C/WKContext.cpp:
(WKContextGetStatistics):
(WKContextGetStatisticsWithOptions):
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerGetHostnamesWithCookies):
(WKCookieManagerGetHTTPCookieAcceptPolicy):
* UIProcess/API/C/WKDatabaseManager.cpp:
(WKDatabaseManagerGetDatabasesByOrigin):
(WKDatabaseManagerGetDatabaseOrigins):
* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetMainResourceData):
(WKFrameGetResourceData):
(WKFrameGetWebArchive):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetKeyValueStorageOrigins):
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
* UIProcess/API/C/WKMediaCacheManager.cpp:
(WKMediaCacheManagerGetHostnamesWithMediaCache):
* UIProcess/API/C/WKOriginDataManager.cpp:
(WKOriginDataManagerGetOrigins):
* UIProcess/API/C/WKPage.cpp:
(WKPageRunJavaScriptInMainFrame):
(WKPageRenderTreeExternalRepresentation):
(WKPageGetSourceForFrame):
(WKPageGetContentsAsString):
(WKPageGetSelectionAsWebArchiveData):
(WKPageGetContentsAsMHTMLData):
(WKPageForceRepaint):
(WKPageValidateCommand):
(WKPageComputePagesForPrinting):
(WKPageDrawPagesToPDF):
* UIProcess/API/C/WKPluginSiteDataManager.cpp:
(WKPluginSiteDataManagerGetSitesWithData):
(WKPluginSiteDataManagerClearSiteData):
(WKPluginSiteDataManagerClearAllSiteData):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerGetCacheOrigins):
* UIProcess/API/gtk/WebKitCookieManager.cpp:
(webkit_cookie_manager_get_accept_policy):
(webkit_cookie_manager_get_domains_with_cookies):
* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(drawPagesForPrintingCompleted):
(webkitPrintOperationPrintPagesForFrame):
* UIProcess/API/gtk/WebKitWebResource.cpp:
(resourceDataCallback):
(webkit_web_resource_get_data):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_can_execute_editing_command):
(webkitWebViewRunJavaScriptCallback):
(webkit_web_view_run_javascript):
(resourcesStreamReadCallback):
(getContentsAsMHTMLDataCallback):
(webkit_web_view_save):
(webkit_web_view_save_to_file):
* UIProcess/API/ios/WKInteractionView.mm:
(-[WKInteractionView _define:]):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKInteractionView changeSelectionWithGestureAt:withGesture:withState:]):
(-[WKInteractionView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
(-[WKInteractionView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
(-[WKInteractionView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKInteractionView applyAutocorrection:toString:withCompletionHandler:]):
(-[WKInteractionView requestAutocorrectionContextWithCompletionHandler:]):
* UIProcess/API/mac/WKPrintingView.mm:
(pageDidDrawToImage):
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(pageDidComputePageRects):
(-[WKPrintingView _askPageToComputePageRects]):
(-[WKPrintingView _drawPreview:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView validateUserInterfaceItem:]):
(-[WKView startSpeaking:]):
* UIProcess/AutoCorrectionCallback.h:
(WebKit::AutocorrectionDataCallback::create):
(WebKit::AutocorrectionDataCallback::performCallbackWithReturnValue):
(WebKit::AutocorrectionDataCallback::invalidate):
(WebKit::AutocorrectionDataCallback::AutocorrectionDataCallback):
(WebKit::AutocorrectionContextCallback::create):
(WebKit::AutocorrectionContextCallback::performCallbackWithReturnValue):
(WebKit::AutocorrectionContextCallback::invalidate):
(WebKit::AutocorrectionContextCallback::AutocorrectionContextCallback):
* UIProcess/GenericCallback.h:
(WebKit::CallbackBase::CallbackBase):
(WebKit::CallbackBase::generateCallbackID):
(WebKit::VoidCallback::create):
(WebKit::VoidCallback::performCallback):
(WebKit::VoidCallback::invalidate):
(WebKit::VoidCallback::VoidCallback):
(WebKit::VoidAPICallback::create):
(WebKit::GenericCallback::create):
(WebKit::GenericCallback::performCallbackWithReturnValue):
(WebKit::GenericCallback::invalidate):
(WebKit::GenericCallback::GenericCallback):
(WebKit::GenericAPICallback::create):
(WebKit::ComputedPagesCallback::create):
(WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
(WebKit::ComputedPagesCallback::invalidate):
(WebKit::ComputedPagesCallback::ComputedPagesCallback):
(WebKit::ImageCallback::create):
(WebKit::ImageCallback::performCallbackWithReturnValue):
(WebKit::ImageCallback::invalidate):
(WebKit::ImageCallback::ImageCallback):
* UIProcess/Plugins/WebPluginSiteDataManager.h:
* UIProcess/StatisticsRequest.h:
* UIProcess/WebApplicationCacheManagerProxy.h:
* UIProcess/WebContext.h:
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebDatabaseManagerProxy.h:
* UIProcess/WebFrameProxy.h:
* UIProcess/WebKeyValueStorageManager.h:
* UIProcess/WebMediaCacheManagerProxy.h:
* UIProcess/WebOriginDataManagerProxy.h:
* UIProcess/WebPageProxy.h:
(WebKit::ValidateCommandCallback::create):
(WebKit::ValidateCommandCallback::performCallbackWithReturnValue):
(WebKit::ValidateCommandCallback::invalidate):
(WebKit::ValidateCommandCallback::ValidateCommandCallback):
(WebKit::GestureCallback::create):
(WebKit::GestureCallback::performCallbackWithReturnValue):
(WebKit::GestureCallback::invalidate):
(WebKit::GestureCallback::GestureCallback):
(WebKit::TouchesCallback::create):
(WebKit::TouchesCallback::performCallbackWithReturnValue):
(WebKit::TouchesCallback::invalidate):
(WebKit::TouchesCallback::TouchesCallback):
* UIProcess/WebResourceCacheManagerProxy.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedSecurityOriginDatah">trunk/Source/WebKit2/Shared/SecurityOriginData.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKApplicationCacheManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKContextcpp">trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKCookieManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKDatabaseManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKFramecpp">trunk/Source/WebKit2/UIProcess/API/C/WKFrame.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKKeyValueStorageManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKMediaCacheManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKOriginDataManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp</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="#trunkSourceWebKit2UIProcessAPICWKResourceCacheManagercpp">trunk/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitCookieManagercpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitPrintOperationcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebResourcecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKInteractionViewmm">trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKPrintingViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAutoCorrectionCallbackh">trunk/Source/WebKit2/UIProcess/AutoCorrectionCallback.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessGenericCallbackh">trunk/Source/WebKit2/UIProcess/GenericCallback.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsWebPluginSiteDataManagerh">trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessStatisticsRequesth">trunk/Source/WebKit2/UIProcess/StatisticsRequest.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebApplicationCacheManagerProxyh">trunk/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebContexth">trunk/Source/WebKit2/UIProcess/WebContext.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebCookieManagerProxyh">trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebDatabaseManagerProxyh">trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebFrameProxyh">trunk/Source/WebKit2/UIProcess/WebFrameProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebKeyValueStorageManagerh">trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebMediaCacheManagerProxyh">trunk/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebOriginDataManagerProxyh">trunk/Source/WebKit2/UIProcess/WebOriginDataManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebResourceCacheManagerProxyh">trunk/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKFullScreenWindowControllermm">trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -1,3 +1,147 @@
</span><ins>+2014-02-18 Alexey Proskuryakov <ap@apple.com>
+
+ [WK2] IPC callback classes should not be tightly coupled to C API
+ https://bugs.webkit.org/show_bug.cgi?id=129030
+
+ Reviewed by Anders Carlsson.
+
+ Changed CallbackBase subclasses to take an std::function (with context captured inside).
+ Instead of C API objects, these callback functions take implementation ones.
+ There are VoidAPICallback and GenericAPICallback helpers for the common case of C API.
+
+ * Shared/SecurityOriginData.h:
+ * UIProcess/API/C/WKApplicationCacheManager.cpp:
+ (WKApplicationCacheManagerGetApplicationCacheOrigins):
+ * UIProcess/API/C/WKContext.cpp:
+ (WKContextGetStatistics):
+ (WKContextGetStatisticsWithOptions):
+ * UIProcess/API/C/WKCookieManager.cpp:
+ (WKCookieManagerGetHostnamesWithCookies):
+ (WKCookieManagerGetHTTPCookieAcceptPolicy):
+ * UIProcess/API/C/WKDatabaseManager.cpp:
+ (WKDatabaseManagerGetDatabasesByOrigin):
+ (WKDatabaseManagerGetDatabaseOrigins):
+ * UIProcess/API/C/WKFrame.cpp:
+ (WKFrameGetMainResourceData):
+ (WKFrameGetResourceData):
+ (WKFrameGetWebArchive):
+ * UIProcess/API/C/WKKeyValueStorageManager.cpp:
+ (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
+ (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
+ * UIProcess/API/C/WKMediaCacheManager.cpp:
+ (WKMediaCacheManagerGetHostnamesWithMediaCache):
+ * UIProcess/API/C/WKOriginDataManager.cpp:
+ (WKOriginDataManagerGetOrigins):
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageRunJavaScriptInMainFrame):
+ (WKPageRenderTreeExternalRepresentation):
+ (WKPageGetSourceForFrame):
+ (WKPageGetContentsAsString):
+ (WKPageGetSelectionAsWebArchiveData):
+ (WKPageGetContentsAsMHTMLData):
+ (WKPageForceRepaint):
+ (WKPageValidateCommand):
+ (WKPageComputePagesForPrinting):
+ (WKPageDrawPagesToPDF):
+ * UIProcess/API/C/WKPluginSiteDataManager.cpp:
+ (WKPluginSiteDataManagerGetSitesWithData):
+ (WKPluginSiteDataManagerClearSiteData):
+ (WKPluginSiteDataManagerClearAllSiteData):
+ * UIProcess/API/C/WKResourceCacheManager.cpp:
+ (WKResourceCacheManagerGetCacheOrigins):
+ * UIProcess/API/gtk/WebKitCookieManager.cpp:
+ (webkit_cookie_manager_get_accept_policy):
+ (webkit_cookie_manager_get_domains_with_cookies):
+ * UIProcess/API/gtk/WebKitPrintOperation.cpp:
+ (drawPagesForPrintingCompleted):
+ (webkitPrintOperationPrintPagesForFrame):
+ * UIProcess/API/gtk/WebKitWebResource.cpp:
+ (resourceDataCallback):
+ (webkit_web_resource_get_data):
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkit_web_view_can_execute_editing_command):
+ (webkitWebViewRunJavaScriptCallback):
+ (webkit_web_view_run_javascript):
+ (resourcesStreamReadCallback):
+ (getContentsAsMHTMLDataCallback):
+ (webkit_web_view_save):
+ (webkit_web_view_save_to_file):
+ * UIProcess/API/ios/WKInteractionView.mm:
+ (-[WKInteractionView _define:]):
+ (selectionChangedWithGesture):
+ (selectionChangedWithTouch):
+ (-[WKInteractionView changeSelectionWithGestureAt:withGesture:withState:]):
+ (-[WKInteractionView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
+ (-[WKInteractionView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
+ (-[WKInteractionView requestAutocorrectionRectsForString:withCompletionHandler:]):
+ (-[WKInteractionView applyAutocorrection:toString:withCompletionHandler:]):
+ (-[WKInteractionView requestAutocorrectionContextWithCompletionHandler:]):
+ * UIProcess/API/mac/WKPrintingView.mm:
+ (pageDidDrawToImage):
+ (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
+ (pageDidComputePageRects):
+ (-[WKPrintingView _askPageToComputePageRects]):
+ (-[WKPrintingView _drawPreview:]):
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView validateUserInterfaceItem:]):
+ (-[WKView startSpeaking:]):
+ * UIProcess/AutoCorrectionCallback.h:
+ (WebKit::AutocorrectionDataCallback::create):
+ (WebKit::AutocorrectionDataCallback::performCallbackWithReturnValue):
+ (WebKit::AutocorrectionDataCallback::invalidate):
+ (WebKit::AutocorrectionDataCallback::AutocorrectionDataCallback):
+ (WebKit::AutocorrectionContextCallback::create):
+ (WebKit::AutocorrectionContextCallback::performCallbackWithReturnValue):
+ (WebKit::AutocorrectionContextCallback::invalidate):
+ (WebKit::AutocorrectionContextCallback::AutocorrectionContextCallback):
+ * UIProcess/GenericCallback.h:
+ (WebKit::CallbackBase::CallbackBase):
+ (WebKit::CallbackBase::generateCallbackID):
+ (WebKit::VoidCallback::create):
+ (WebKit::VoidCallback::performCallback):
+ (WebKit::VoidCallback::invalidate):
+ (WebKit::VoidCallback::VoidCallback):
+ (WebKit::VoidAPICallback::create):
+ (WebKit::GenericCallback::create):
+ (WebKit::GenericCallback::performCallbackWithReturnValue):
+ (WebKit::GenericCallback::invalidate):
+ (WebKit::GenericCallback::GenericCallback):
+ (WebKit::GenericAPICallback::create):
+ (WebKit::ComputedPagesCallback::create):
+ (WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
+ (WebKit::ComputedPagesCallback::invalidate):
+ (WebKit::ComputedPagesCallback::ComputedPagesCallback):
+ (WebKit::ImageCallback::create):
+ (WebKit::ImageCallback::performCallbackWithReturnValue):
+ (WebKit::ImageCallback::invalidate):
+ (WebKit::ImageCallback::ImageCallback):
+ * UIProcess/Plugins/WebPluginSiteDataManager.h:
+ * UIProcess/StatisticsRequest.h:
+ * UIProcess/WebApplicationCacheManagerProxy.h:
+ * UIProcess/WebContext.h:
+ * UIProcess/WebCookieManagerProxy.h:
+ * UIProcess/WebDatabaseManagerProxy.h:
+ * UIProcess/WebFrameProxy.h:
+ * UIProcess/WebKeyValueStorageManager.h:
+ * UIProcess/WebMediaCacheManagerProxy.h:
+ * UIProcess/WebOriginDataManagerProxy.h:
+ * UIProcess/WebPageProxy.h:
+ (WebKit::ValidateCommandCallback::create):
+ (WebKit::ValidateCommandCallback::performCallbackWithReturnValue):
+ (WebKit::ValidateCommandCallback::invalidate):
+ (WebKit::ValidateCommandCallback::ValidateCommandCallback):
+ (WebKit::GestureCallback::create):
+ (WebKit::GestureCallback::performCallbackWithReturnValue):
+ (WebKit::GestureCallback::invalidate):
+ (WebKit::GestureCallback::GestureCallback):
+ (WebKit::TouchesCallback::create):
+ (WebKit::TouchesCallback::performCallbackWithReturnValue):
+ (WebKit::TouchesCallback::invalidate):
+ (WebKit::TouchesCallback::TouchesCallback):
+ * UIProcess/WebResourceCacheManagerProxy.h:
+ * UIProcess/mac/WKFullScreenWindowController.mm:
+ (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
+
</ins><span class="cx"> 2014-02-19 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Avoid sending redundant layer properties to the UI process, and avoid allocation of RemoteLayerBackingStore unless we need it
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedSecurityOriginDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/SecurityOriginData.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/SecurityOriginData.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/Shared/SecurityOriginData.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> struct SecurityOriginData {
</span><span class="cx"> static SecurityOriginData fromSecurityOrigin(const WebCore::SecurityOrigin*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKApplicationCacheManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+
</ins><span class="cx"> WKTypeID WKApplicationCacheManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebApplicationCacheManagerProxy::APIType);
</span><span class="lines">@@ -38,7 +40,7 @@
</span><span class="cx">
</span><span class="cx"> void WKApplicationCacheManagerGetApplicationCacheOrigins(WKApplicationCacheManagerRef applicationCacheManagerRef, void* context, WKApplicationCacheManagerGetApplicationCacheOriginsFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(applicationCacheManagerRef)->getApplicationCacheOrigins(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(applicationCacheManagerRef)->getApplicationCacheOrigins(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKApplicationCacheManagerDeleteEntriesForOrigin(WKApplicationCacheManagerRef applicationCacheManagerRef, WKSecurityOriginRef originRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKDictionaryRef> DictionaryAPICallback;
+
</ins><span class="cx"> WKTypeID WKContextGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebContext::APIType);
</span><span class="lines">@@ -416,12 +418,12 @@
</span><span class="cx">
</span><span class="cx"> void WKContextGetStatistics(WKContextRef contextRef, void* context, WKContextGetStatisticsFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(contextRef)->getStatistics(0xFFFFFFFF, DictionaryCallback::create(context, callback));
</del><ins>+ toImpl(contextRef)->getStatistics(0xFFFFFFFF, DictionaryAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKContextGetStatisticsWithOptions(WKContextRef contextRef, WKStatisticsOptions optionsMask, void* context, WKContextGetStatisticsFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(contextRef)->getStatistics(optionsMask, DictionaryCallback::create(context, callback));
</del><ins>+ toImpl(contextRef)->getStatistics(optionsMask, DictionaryAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKContextGarbageCollectJavaScriptObjects(WKContextRef contextRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKCookieManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,9 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+typedef GenericAPICallback<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyAPICallback;
+
</ins><span class="cx"> WKTypeID WKCookieManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebCookieManagerProxy::APIType);
</span><span class="lines">@@ -43,7 +46,7 @@
</span><span class="cx">
</span><span class="cx"> void WKCookieManagerGetHostnamesWithCookies(WKCookieManagerRef cookieManagerRef, void* context, WKCookieManagerGetCookieHostnamesFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(cookieManagerRef)->getHostnamesWithCookies(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(cookieManagerRef)->getHostnamesWithCookies(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKCookieManagerDeleteCookiesForHostname(WKCookieManagerRef cookieManagerRef, WKStringRef hostname)
</span><span class="lines">@@ -68,7 +71,7 @@
</span><span class="cx">
</span><span class="cx"> void WKCookieManagerGetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, void* context, WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(cookieManager)->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyCallback::create(context, callback));
</del><ins>+ toImpl(cookieManager)->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKCookieManagerStartObservingCookieChanges(WKCookieManagerRef cookieManager)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKDatabaseManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+
</ins><span class="cx"> WKTypeID WKDatabaseManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(SQL_DATABASE)
</span><span class="lines">@@ -155,7 +157,7 @@
</span><span class="cx"> void WKDatabaseManagerGetDatabasesByOrigin(WKDatabaseManagerRef databaseManagerRef, void* context, WKDatabaseManagerGetDatabasesByOriginFunction callback)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(SQL_DATABASE)
</span><del>- toImpl(databaseManagerRef)->getDatabasesByOrigin(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(databaseManagerRef)->getDatabasesByOrigin(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(databaseManagerRef);
</span><span class="cx"> UNUSED_PARAM(context);
</span><span class="lines">@@ -166,7 +168,7 @@
</span><span class="cx"> void WKDatabaseManagerGetDatabaseOrigins(WKDatabaseManagerRef databaseManagerRef, void* context, WKDatabaseManagerGetDatabaseOriginsFunction callback)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(SQL_DATABASE)
</span><del>- toImpl(databaseManagerRef)->getDatabaseOrigins(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(databaseManagerRef)->getDatabaseOrigins(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(databaseManagerRef);
</span><span class="cx"> UNUSED_PARAM(context);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKFrame.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKFrame.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKFrame.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKDataRef> DataAPICallback;
+
</ins><span class="cx"> WKTypeID WKFrameGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebFrameProxy::APIType);
</span><span class="lines">@@ -124,17 +126,17 @@
</span><span class="cx">
</span><span class="cx"> void WKFrameGetMainResourceData(WKFrameRef frameRef, WKFrameGetResourceDataFunction callback, void* context)
</span><span class="cx"> {
</span><del>- toImpl(frameRef)->getMainResourceData(DataCallback::create(context, callback));
</del><ins>+ toImpl(frameRef)->getMainResourceData(DataAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKFrameGetResourceData(WKFrameRef frameRef, WKURLRef resourceURL, WKFrameGetResourceDataFunction callback, void* context)
</span><span class="cx"> {
</span><del>- toImpl(frameRef)->getResourceData(toImpl(resourceURL), DataCallback::create(context, callback));
</del><ins>+ toImpl(frameRef)->getResourceData(toImpl(resourceURL), DataAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKFrameGetWebArchive(WKFrameRef frameRef, WKFrameGetWebArchiveFunction callback, void* context)
</span><span class="cx"> {
</span><del>- toImpl(frameRef)->getWebArchive(DataCallback::create(context, callback));
</del><ins>+ toImpl(frameRef)->getWebArchive(DataAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // NOTE: These are deprecated and should be removed. They currently do nothing.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKKeyValueStorageManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+
</ins><span class="cx"> WKTypeID WKKeyValueStorageManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebKeyValueStorageManager::APIType);
</span><span class="lines">@@ -56,12 +58,12 @@
</span><span class="cx">
</span><span class="cx"> void WKKeyValueStorageManagerGetKeyValueStorageOrigins(WKKeyValueStorageManagerRef keyValueStorageManagerRef, void* context, WKKeyValueStorageManagerGetKeyValueStorageOriginsFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(keyValueStorageManagerRef)->getKeyValueStorageOrigins(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(keyValueStorageManagerRef)->getKeyValueStorageOrigins(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKKeyValueStorageManagerGetStorageDetailsByOrigin(WKKeyValueStorageManagerRef keyValueStorageManagerRef, void* context, WKKeyValueStorageManagerGetStorageDetailsByOriginFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(keyValueStorageManagerRef)->getStorageDetailsByOrigin(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(keyValueStorageManagerRef)->getStorageDetailsByOrigin(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKKeyValueStorageManagerDeleteEntriesForOrigin(WKKeyValueStorageManagerRef keyValueStorageManagerRef, WKSecurityOriginRef originRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKMediaCacheManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+
</ins><span class="cx"> WKTypeID WKMediaCacheManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebMediaCacheManagerProxy::APIType);
</span><span class="lines">@@ -38,7 +40,7 @@
</span><span class="cx">
</span><span class="cx"> void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManagerRef, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(mediaCacheManagerRef)->getHostnamesWithMediaCache(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(mediaCacheManagerRef)->getHostnamesWithMediaCache(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManagerRef, WKStringRef hostname)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKOriginDataManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+
</ins><span class="cx"> WKTypeID WKOriginDataManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebOriginDataManagerProxy::APIType);
</span><span class="lines">@@ -38,7 +40,7 @@
</span><span class="cx">
</span><span class="cx"> void WKOriginDataManagerGetOrigins(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types, void* context, WKOriginDataManagerGetOriginsFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(originDataManagerRef)->getOrigins(types, ArrayCallback::create(context, callback));
</del><ins>+ toImpl(originDataManagerRef)->getOrigins(types, ArrayAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKOriginDataManagerDeleteEntriesForOrigin(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types, WKSecurityOriginRef originRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -74,6 +74,10 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKDataRef> DataAPICallback;
+typedef GenericAPICallback<WKStringRef, StringImpl*> StringAPICallback;
+typedef GenericAPICallback<WKSerializedScriptValueRef> ScriptValueAPICallback;
+
</ins><span class="cx"> WKTypeID WKPageGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebPageProxy::APIType);
</span><span class="lines">@@ -1472,7 +1476,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(context, callback));
</del><ins>+ toImpl(pageRef)->runJavaScriptInMainFrame(toImpl(scriptRef)->string(), ScriptValueAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #ifdef __BLOCKS__
</span><span class="lines">@@ -1491,17 +1495,17 @@
</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(context, callback));
</del><ins>+ toImpl(pageRef)->getRenderTreeExternalRepresentation(StringAPICallback::create(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(context, callback));
</del><ins>+ toImpl(pageRef)->getSourceForFrame(toImpl(frameRef), StringAPICallback::create(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(context, callback));
</del><ins>+ toImpl(pageRef)->getContentsAsString(StringAPICallback::create(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="lines">@@ -1511,13 +1515,13 @@
</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(context, callback));
</del><ins>+ toImpl(pageRef)->getSelectionAsWebArchiveData(DataAPICallback::create(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="cx"> {
</span><span class="cx"> #if ENABLE(MHTML)
</span><del>- toImpl(pageRef)->getContentsAsMHTMLData(DataCallback::create(context, callback), useBinaryEncoding);
</del><ins>+ toImpl(pageRef)->getContentsAsMHTMLData(DataAPICallback::create(context, callback), useBinaryEncoding);
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(pageRef);
</span><span class="cx"> UNUSED_PARAM(useBinaryEncoding);
</span><span class="lines">@@ -1528,7 +1532,7 @@
</span><span class="cx">
</span><span class="cx"> void WKPageForceRepaint(WKPageRef pageRef, void* context, WKPageForceRepaintFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(pageRef)->forceRepaint(VoidCallback::create(context, callback));
</del><ins>+ toImpl(pageRef)->forceRepaint(VoidAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WK_EXPORT WKURLRef WKPageCopyPendingAPIRequestURL(WKPageRef pageRef)
</span><span class="lines">@@ -1563,7 +1567,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));
</del><ins>+ toImpl(pageRef)->validateCommand(toImpl(command)->string(), ValidateCommandCallback::create([context, callback](bool error, StringImpl* commandName, bool isEnabled, int32_t state) {
+ callback(toAPI(commandName), isEnabled, state, error ? toAPI(API::Error::create().get()) : 0, context);
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageExecuteCommand(WKPageRef pageRef, WKStringRef command)
</span><span class="lines">@@ -1572,25 +1578,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-struct ComputedPagesContext {
- ComputedPagesContext(WKPageComputePagesForPrintingFunction callback, void* context)
- : callback(callback)
- , context(context)
- {
- }
- WKPageComputePagesForPrintingFunction callback;
- void* context;
-};
-
-static void computedPagesCallback(const Vector<WebCore::IntRect>& rects, double scaleFactor, WKErrorRef error, void* untypedContext)
-{
- OwnPtr<ComputedPagesContext> context = adoptPtr(static_cast<ComputedPagesContext*>(untypedContext));
- Vector<WKRect> wkRects(rects.size());
- for (size_t i = 0; i < rects.size(); ++i)
- wkRects[i] = toAPI(rects[i]);
- context->callback(wkRects.data(), wkRects.size(), scaleFactor, error, context->context);
-}
-
</del><span class="cx"> static PrintInfo printInfoFromWKPrintInfo(const WKPrintInfo& printInfo)
</span><span class="cx"> {
</span><span class="cx"> PrintInfo result;
</span><span class="lines">@@ -1602,7 +1589,12 @@
</span><span class="cx">
</span><span class="cx"> void WKPageComputePagesForPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, WKPageComputePagesForPrintingFunction callback, void* context)
</span><span class="cx"> {
</span><del>- toImpl(page)->computePagesForPrinting(toImpl(frame), printInfoFromWKPrintInfo(printInfo), ComputedPagesCallback::create(new ComputedPagesContext(callback, context), computedPagesCallback));
</del><ins>+ toImpl(page)->computePagesForPrinting(toImpl(frame), printInfoFromWKPrintInfo(printInfo), ComputedPagesCallback::create([context, callback](bool error, const Vector<WebCore::IntRect>& rects, double scaleFactor) {
+ Vector<WKRect> wkRects(rects.size());
+ for (size_t i = 0; i < rects.size(); ++i)
+ wkRects[i] = toAPI(rects[i]);
+ callback(wkRects.data(), wkRects.size(), scaleFactor, error ? toAPI(API::Error::create().get()) : 0, context);
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageBeginPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo)
</span><span class="lines">@@ -1612,7 +1604,7 @@
</span><span class="cx">
</span><span class="cx"> void WKPageDrawPagesToPDF(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, uint32_t first, uint32_t count, WKPageDrawToPDFFunction callback, void* context)
</span><span class="cx"> {
</span><del>- toImpl(page)->drawPagesToPDF(toImpl(frame), printInfoFromWKPrintInfo(printInfo), first, count, DataCallback::create(context, callback));
</del><ins>+ toImpl(page)->drawPagesToPDF(toImpl(frame), printInfoFromWKPrintInfo(printInfo), first, count, DataAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKPageEndPrinting(WKPageRef page)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPluginSiteDataManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -36,6 +36,10 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+#if ENABLE(NETSCAPE_PLUGIN_API)
+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+#endif
+
</ins><span class="cx"> WKTypeID WKPluginSiteDataManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="lines">@@ -48,7 +52,7 @@
</span><span class="cx"> void WKPluginSiteDataManagerGetSitesWithData(WKPluginSiteDataManagerRef managerRef, void* context, WKPluginSiteDataManagerGetSitesWithDataFunction callback)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>- toImpl(managerRef)->getSitesWithData(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(managerRef)->getSitesWithData(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(managerRef);
</span><span class="cx"> UNUSED_PARAM(context);
</span><span class="lines">@@ -72,7 +76,7 @@
</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));
</del><ins>+ toImpl(managerRef)->clearSiteData(toImpl(sitesRef), toNPClearSiteDataFlags(flags), maxAgeInSeconds, VoidAPICallback::create(context, function));
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(managerRef);
</span><span class="cx"> UNUSED_PARAM(sitesRef);
</span><span class="lines">@@ -86,7 +90,7 @@
</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));
</del><ins>+ toImpl(managerRef)->clearSiteData(0, NP_CLEAR_ALL, std::numeric_limits<uint64_t>::max(), VoidAPICallback::create(context, function));
</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="trunkSourceWebKit2UIProcessAPICWKResourceCacheManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+
</ins><span class="cx"> WKTypeID WKResourceCacheManagerGetTypeID()
</span><span class="cx"> {
</span><span class="cx"> return toAPI(WebResourceCacheManagerProxy::APIType);
</span><span class="lines">@@ -38,7 +40,7 @@
</span><span class="cx">
</span><span class="cx"> void WKResourceCacheManagerGetCacheOrigins(WKResourceCacheManagerRef cacheManagerRef, void* context, WKResourceCacheManagerGetCacheOriginsFunction callback)
</span><span class="cx"> {
</span><del>- toImpl(cacheManagerRef)->getCacheOrigins(ArrayCallback::create(context, callback));
</del><ins>+ toImpl(cacheManagerRef)->getCacheOrigins(ArrayAPICallback::create(context, callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WKResourceCacheManagerClearCacheForOrigin(WKResourceCacheManagerRef cacheManagerRef, WKSecurityOriginRef originRef, WKResourceCachesToClear cachesToClear)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitCookieManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -30,6 +30,9 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><ins>+typedef GenericAPICallback<WKArrayRef> ArrayAPICallback;
+typedef GenericAPICallback<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyAPICallback;
+
</ins><span class="cx"> /**
</span><span class="cx"> * SECTION: WebKitCookieManager
</span><span class="cx"> * @Short_description: Defines how to handle cookies in a #WebKitWebContext
</span><span class="lines">@@ -175,7 +178,7 @@
</span><span class="cx"> g_return_if_fail(WEBKIT_IS_COOKIE_MANAGER(manager));
</span><span class="cx">
</span><span class="cx"> GTask* task = g_task_new(manager, cancellable, callback, userData);
</span><del>- manager->priv->webCookieManager->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyCallback::create(task, webkitCookieManagerGetAcceptPolicyCallback));
</del><ins>+ manager->priv->webCookieManager->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyAPICallback::create(task, webkitCookieManagerGetAcceptPolicyCallback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -233,7 +236,7 @@
</span><span class="cx"> g_return_if_fail(WEBKIT_IS_COOKIE_MANAGER(manager));
</span><span class="cx">
</span><span class="cx"> GTask* task = g_task_new(manager, cancellable, callback, userData);
</span><del>- manager->priv->webCookieManager->getHostnamesWithCookies(ArrayCallback::create(task, webkitCookieManagerGetDomainsWithCookiesCallback));
</del><ins>+ manager->priv->webCookieManager->getHostnamesWithCookies(ArrayAPICallback::create(task, webkitCookieManagerGetDomainsWithCookiesCallback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitPrintOperationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -252,30 +252,31 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-static void drawPagesForPrintingCompleted(WKErrorRef wkPrintError, WKErrorRef, void* context)
</del><ins>+static void drawPagesForPrintingCompleted(API::Error* wkPrintError, WebKitPrintOperation* printOperation)
</ins><span class="cx"> {
</span><del>- GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(WEBKIT_PRINT_OPERATION(context));
-
</del><span class="cx"> // When running synchronously WebPageProxy::printFrame() calls endPrinting().
</span><span class="cx"> if (printOperation->priv->printMode == PrintInfo::PrintModeAsync && printOperation->priv->webView) {
</span><span class="cx"> WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));
</span><span class="cx"> page->endPrinting();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- const WebCore::ResourceError& resourceError = wkPrintError ? toImpl(wkPrintError)->platformError() : WebCore::ResourceError();
</del><ins>+ const WebCore::ResourceError& resourceError = wkPrintError ? wkPrintError->platformError() : WebCore::ResourceError();
</ins><span class="cx"> if (!resourceError.isNull()) {
</span><span class="cx"> GUniquePtr<GError> printError(g_error_new_literal(g_quark_from_string(resourceError.domain().utf8().data()),
</span><span class="cx"> resourceError.errorCode(), resourceError.localizedDescription().utf8().data()));
</span><del>- g_signal_emit(printOperation.get(), signals[FAILED], 0, printError.get());
</del><ins>+ g_signal_emit(printOperation, signals[FAILED], 0, printError.get());
</ins><span class="cx"> }
</span><del>- g_signal_emit(printOperation.get(), signals[FINISHED], 0, NULL);
</del><ins>+ g_signal_emit(printOperation, signals[FINISHED], 0, NULL);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void webkitPrintOperationPrintPagesForFrame(WebKitPrintOperation* printOperation, WebFrameProxy* webFrame, GtkPrintSettings* printSettings, GtkPageSetup* pageSetup)
</span><span class="cx"> {
</span><span class="cx"> PrintInfo printInfo(printSettings, pageSetup, printOperation->priv->printMode);
</span><span class="cx"> WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(printOperation->priv->webView));
</span><del>- page->drawPagesForPrinting(webFrame, printInfo, PrintFinishedCallback::create(g_object_ref(printOperation), &drawPagesForPrintingCompleted));
</del><ins>+ g_object_ref(printOperation);
+ page->drawPagesForPrinting(webFrame, printInfo, PrintFinishedCallback::create([printOperation](bool /*error*/, API::Error* printError) {
+ drawPagesForPrintingCompleted(printError, adoptGRef(printOperation).get());
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WebKitPrintOperationResponse webkitPrintOperationRunDialogForFrame(WebKitPrintOperation* printOperation, GtkWindow* parent, WebFrameProxy* webFrame)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -314,12 +314,11 @@
</span><span class="cx"> };
</span><span class="cx"> WEBKIT_DEFINE_ASYNC_DATA_STRUCT(ResourceGetDataAsyncData)
</span><span class="cx">
</span><del>-static void resourceDataCallback(WKDataRef wkData, WKErrorRef, void* context)
</del><ins>+static void resourceDataCallback(API::Data* wkData, GTask* task)
</ins><span class="cx"> {
</span><del>- GRefPtr<GTask> task = adoptGRef(G_TASK(context));
- ResourceGetDataAsyncData* data = static_cast<ResourceGetDataAsyncData*>(g_task_get_task_data(task.get()));
- data->webData = toImpl(wkData);
- g_task_return_boolean(task.get(), TRUE);
</del><ins>+ ResourceGetDataAsyncData* data = static_cast<ResourceGetDataAsyncData*>(g_task_get_task_data(task));
+ data->webData = wkData;
+ g_task_return_boolean(task, TRUE);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -341,10 +340,14 @@
</span><span class="cx"> GTask* task = g_task_new(resource, cancellable, callback, userData);
</span><span class="cx"> g_task_set_task_data(task, createResourceGetDataAsyncData(), reinterpret_cast<GDestroyNotify>(destroyResourceGetDataAsyncData));
</span><span class="cx"> if (resource->priv->isMainResource)
</span><del>- resource->priv->frame->getMainResourceData(DataCallback::create(task, resourceDataCallback));
</del><ins>+ resource->priv->frame->getMainResourceData(DataCallback::create([task](bool /*error*/, API::Data* data) {
+ resourceDataCallback(data, adoptGRef(task).get());
+ }));
</ins><span class="cx"> else {
</span><span class="cx"> String url = String::fromUTF8(resource->priv->uri.data());
</span><del>- resource->priv->frame->getResourceData(API::URL::create(url).get(), DataCallback::create(task, resourceDataCallback));
</del><ins>+ resource->priv->frame->getResourceData(API::URL::create(url).get(), DataCallback::create([task](bool /*error*/, API::Data* data) {
+ resourceDataCallback(data, adoptGRef(task).get());
+ }));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -2510,12 +2510,6 @@
</span><span class="cx"> return zoomTextOnly ? page->textZoomFactor() : page->pageZoomFactor();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void didValidateCommand(WKStringRef command, bool isEnabled, int32_t state, WKErrorRef, void* context)
-{
- GRefPtr<GTask> task = adoptGRef(G_TASK(context));
- g_task_return_boolean(task.get(), isEnabled);
-}
-
</del><span class="cx"> /**
</span><span class="cx"> * webkit_web_view_can_execute_editing_command:
</span><span class="cx"> * @web_view: a #WebKitWebView
</span><span class="lines">@@ -2535,7 +2529,9 @@
</span><span class="cx"> g_return_if_fail(command);
</span><span class="cx">
</span><span class="cx"> GTask* task = g_task_new(webView, cancellable, callback, userData);
</span><del>- getPage(webView)->validateCommand(String::fromUTF8(command), ValidateCommandCallback::create(task, didValidateCommand));
</del><ins>+ getPage(webView)->validateCommand(String::fromUTF8(command), ValidateCommandCallback::create([task](bool /*error*/, StringImpl* /*command*/, bool isEnabled, int32_t /*state*/) {
+ g_task_return_boolean(adoptGRef(task).get(), isEnabled);
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -2612,20 +2608,19 @@
</span><span class="cx"> return webView->priv->javascriptGlobalContext;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void webkitWebViewRunJavaScriptCallback(WKSerializedScriptValueRef wkSerializedScriptValue, WKErrorRef, void* context)
</del><ins>+static void webkitWebViewRunJavaScriptCallback(WebSerializedScriptValue* wkSerializedScriptValue, GTask* task)
</ins><span class="cx"> {
</span><del>- GRefPtr<GTask> task = adoptGRef(G_TASK(context));
- if (g_task_return_error_if_cancelled(task.get()))
</del><ins>+ if (g_task_return_error_if_cancelled(task))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (!wkSerializedScriptValue) {
</span><del>- g_task_return_new_error(task.get(), WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED,
</del><ins>+ g_task_return_new_error(task, WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED,
</ins><span class="cx"> _("An exception was raised in JavaScript"));
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- WebKitWebView* webView = WEBKIT_WEB_VIEW(g_task_get_source_object(task.get()));
- g_task_return_pointer(task.get(), webkitJavascriptResultCreate(webView, toImpl(wkSerializedScriptValue)),
</del><ins>+ WebKitWebView* webView = WEBKIT_WEB_VIEW(g_task_get_source_object(task));
+ g_task_return_pointer(task, webkitJavascriptResultCreate(webView, wkSerializedScriptValue),
</ins><span class="cx"> reinterpret_cast<GDestroyNotify>(webkit_javascript_result_unref));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2649,7 +2644,9 @@
</span><span class="cx"> g_return_if_fail(script);
</span><span class="cx">
</span><span class="cx"> GTask* task = g_task_new(webView, cancellable, callback, userData);
</span><del>- getPage(webView)->runJavaScriptInMainFrame(String::fromUTF8(script), ScriptValueCallback::create(task, webkitWebViewRunJavaScriptCallback));
</del><ins>+ getPage(webView)->runJavaScriptInMainFrame(String::fromUTF8(script), ScriptValueCallback::create([task](bool /*error*/, WebSerializedScriptValue* serializedScriptValue) {
+ webkitWebViewRunJavaScriptCallback(serializedScriptValue, adoptGRef(task).get());
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -2738,7 +2735,9 @@
</span><span class="cx"> WebKitWebView* webView = WEBKIT_WEB_VIEW(g_task_get_source_object(task.get()));
</span><span class="cx"> gpointer outputStreamData = g_memory_output_stream_get_data(G_MEMORY_OUTPUT_STREAM(object));
</span><span class="cx"> getPage(webView)->runJavaScriptInMainFrame(String::fromUTF8(reinterpret_cast<const gchar*>(outputStreamData)),
</span><del>- ScriptValueCallback::create(task.leakRef(), webkitWebViewRunJavaScriptCallback));
</del><ins>+ ScriptValueCallback::create([task](bool /*error*/, WebSerializedScriptValue* serializedScriptValue) {
+ webkitWebViewRunJavaScriptCallback(serializedScriptValue, task.get());
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -2865,16 +2864,16 @@
</span><span class="cx"> g_task_return_boolean(task.get(), TRUE);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void getContentsAsMHTMLDataCallback(WKDataRef wkData, WKErrorRef, void* context)
</del><ins>+static void getContentsAsMHTMLDataCallback(API::Data* wkData, GTask* taskPtr)
</ins><span class="cx"> {
</span><del>- GRefPtr<GTask> task = adoptGRef(G_TASK(context));
</del><ins>+ GRefPtr<GTask> task = adoptGRef(taskPtr);
</ins><span class="cx"> if (g_task_return_error_if_cancelled(task.get()))
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> ViewSaveAsyncData* data = static_cast<ViewSaveAsyncData*>(g_task_get_task_data(task.get()));
</span><span class="cx"> // We need to retain the data until the asyncronous process
</span><span class="cx"> // initiated by the user has finished completely.
</span><del>- data->webData = toImpl(wkData);
</del><ins>+ data->webData = wkData;
</ins><span class="cx">
</span><span class="cx"> // If we are saving to a file we need to write the data on disk before finishing.
</span><span class="cx"> if (g_task_get_source_tag(task.get()) == webkit_web_view_save_to_file) {
</span><span class="lines">@@ -2914,7 +2913,9 @@
</span><span class="cx"> GTask* task = g_task_new(webView, cancellable, callback, userData);
</span><span class="cx"> g_task_set_source_tag(task, reinterpret_cast<gpointer>(webkit_web_view_save));
</span><span class="cx"> g_task_set_task_data(task, createViewSaveAsyncData(), reinterpret_cast<GDestroyNotify>(destroyViewSaveAsyncData));
</span><del>- getPage(webView)->getContentsAsMHTMLData(DataCallback::create(task, getContentsAsMHTMLDataCallback), false);
</del><ins>+ getPage(webView)->getContentsAsMHTMLData(DataCallback::create([task](bool /*error*/, API::Data* data) {
+ getContentsAsMHTMLDataCallback(data, task);
+ }), false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -2977,7 +2978,9 @@
</span><span class="cx"> data->file = file;
</span><span class="cx"> g_task_set_task_data(task, data, reinterpret_cast<GDestroyNotify>(destroyViewSaveAsyncData));
</span><span class="cx">
</span><del>- getPage(webView)->getContentsAsMHTMLData(DataCallback::create(task, getContentsAsMHTMLDataCallback), false);
</del><ins>+ getPage(webView)->getContentsAsMHTMLData(DataCallback::create([task](bool /*error*/, API::Data* data) {
+ getContentsAsMHTMLDataCallback(data, task);
+ }), false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKInteractionViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -907,24 +907,19 @@
</span><span class="cx"> [_webSelectionAssistant showDictionaryFor:text fromRect:presentationRect];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void selectedString(WKStringRef string, WKErrorRef error, void* context)
</del><ins>+- (void)_define:(id)sender
</ins><span class="cx"> {
</span><del>- if (error)
- return;
- if (!string)
- return;
</del><ins>+ _page->getSelectionOrContentsAsString(StringCallback::create([self](bool error, StringImpl* string) {
+ if (error)
+ return;
+ if (!string)
+ return;
</ins><span class="cx">
</span><del>- NSString *convertedString = toImpl(string)->string();
- WKInteractionView* view = static_cast<WKInteractionView*>(context);
- ASSERT(view);
- [view _showDictionary:convertedString];
</del><ins>+ NSString *convertedString = *string;
+ [self _showDictionary:convertedString];
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)_define:(id)sender
-{
- _page->getSelectionOrContentsAsString(StringCallback::create(self, selectedString));
-}
-
</del><span class="cx"> // UIWKInteractionViewProtocol
</span><span class="cx">
</span><span class="cx"> static inline WKGestureType toWKGestureType(UIWKGestureType gestureType)
</span><span class="lines">@@ -1083,28 +1078,24 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void selectionChangedWithGesture(const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, WKErrorRef error, void* context)
</del><ins>+static void selectionChangedWithGesture(bool error, WKInteractionView *view, const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags)
</ins><span class="cx"> {
</span><span class="cx"> if (error) {
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- WKInteractionView *view = static_cast<WKInteractionView*>(context);
- ASSERT(view);
</del><span class="cx"> if ([view webSelectionAssistant])
</span><span class="cx"> [(UIWKSelectionAssistant *)[view webSelectionAssistant] selectionChangedWithGestureAt:(CGPoint)point withGesture:toUIWKGestureType((WKGestureType)gestureType) withState:toUIGestureRecognizerState(static_cast<WKGestureRecognizerState>(gestureState)) withFlags:(toUIWKSelectionFlags((WKSelectionFlags)flags))];
</span><span class="cx"> else
</span><span class="cx"> [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithGestureAt:(CGPoint)point withGesture:toUIWKGestureType((WKGestureType)gestureType) withState:toUIGestureRecognizerState(static_cast<WKGestureRecognizerState>(gestureState)) withFlags:(toUIWKSelectionFlags((WKSelectionFlags)flags))];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void selectionChangedWithTouch(const WebCore::IntPoint& point, uint32_t touch, WKErrorRef error, void* context)
</del><ins>+static void selectionChangedWithTouch(bool error, WKInteractionView *view, const WebCore::IntPoint& point, uint32_t touch)
</ins><span class="cx"> {
</span><span class="cx"> if (error) {
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- WKInteractionView *view = static_cast<WKInteractionView*>(context);
- ASSERT(view);
</del><span class="cx"> if ([view webSelectionAssistant])
</span><span class="cx"> [(UIWKSelectionAssistant *)[view webSelectionAssistant] selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:toUIWKSelectionTouch((WKSelectionTouch)touch)];
</span><span class="cx"> else
</span><span class="lines">@@ -1113,17 +1104,23 @@
</span><span class="cx">
</span><span class="cx"> - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state
</span><span class="cx"> {
</span><del>- _page->selectWithGesture(WebCore::IntPoint(point), CharacterGranularity, toWKGestureType(gestureType), toWKGestureRecognizerState(state), GestureCallback::create(self, selectionChangedWithGesture));
</del><ins>+ _page->selectWithGesture(WebCore::IntPoint(point), CharacterGranularity, toWKGestureType(gestureType), toWKGestureRecognizerState(state), GestureCallback::create([self](bool error, const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags) {
+ selectionChangedWithGesture(error, self, point, gestureType, gestureState, flags);
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart
</span><span class="cx"> {
</span><del>- _page->updateSelectionWithTouches(WebCore::IntPoint(point), toWKSelectionTouch(touch), baseIsStart, TouchesCallback::create(self, selectionChangedWithTouch));
</del><ins>+ _page->updateSelectionWithTouches(WebCore::IntPoint(point), toWKSelectionTouch(touch), baseIsStart, TouchesCallback::create([self](bool error, const WebCore::IntPoint& point, uint32_t touch) {
+ selectionChangedWithTouch(error, self, point, touch);
+ }));
</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="cx"> {
</span><del>- _page->selectWithTwoTouches(WebCore::IntPoint(from), WebCore::IntPoint(to), toWKGestureType(gestureType), toWKGestureRecognizerState(gestureState), GestureCallback::create(self, selectionChangedWithGesture));
</del><ins>+ _page->selectWithTwoTouches(WebCore::IntPoint(from), WebCore::IntPoint(to), toWKGestureType(gestureType), toWKGestureRecognizerState(gestureState), GestureCallback::create([self](bool error, const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags) {
+ selectionChangedWithGesture(error, self, point, gestureType, gestureState, flags);
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (WKAutoCorrectionData *)autocorrectionData
</span><span class="lines">@@ -1131,29 +1128,6 @@
</span><span class="cx"> return &_autocorrectionData;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void autocorrectionData(const Vector<FloatRect>& rects, const String& fontName, double fontSize, uint64_t traits, WKErrorRef error, void* context)
-{
- WKInteractionView* view = static_cast<WKInteractionView*>(context);
- ASSERT(view);
- CGRect firstRect = CGRectZero;
- CGRect lastRect = CGRectZero;
- if (rects.size()) {
- firstRect = rects[0];
- lastRect = rects[rects.size() - 1];
- }
-
- WKAutoCorrectionData *autocorrectionData = view.autocorrectionData;
- autocorrectionData->fontName = fontName;
- autocorrectionData->fontSize = fontSize;
- autocorrectionData->fontTraits = traits;
- autocorrectionData->textFirstRect = firstRect;
- autocorrectionData->textLastRect = lastRect;
-
- autocorrectionData->autocorrectionHandler(rects.size() ? [WKAutocorrectionRects autocorrectionRectsWithRects:firstRect lastRect:lastRect] : nil);
- [autocorrectionData->autocorrectionHandler release];
- autocorrectionData->autocorrectionHandler = nil;
-}
-
</del><span class="cx"> // The completion handler can pass nil if input does not match the actual text preceding the insertion point.
</span><span class="cx"> - (void)requestAutocorrectionRectsForString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForInput))completionHandler
</span><span class="cx"> {
</span><span class="lines">@@ -1162,7 +1136,25 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> _autocorrectionData.autocorrectionHandler = [completionHandler copy];
</span><del>- _page->requestAutocorrectionData(input, AutocorrectionDataCallback::create(self, autocorrectionData));
</del><ins>+ _page->requestAutocorrectionData(input, AutocorrectionDataCallback::create([self, completionHandler](bool, const Vector<FloatRect>& rects, const String& fontName, double fontSize, uint64_t traits) {
+ CGRect firstRect = CGRectZero;
+ CGRect lastRect = CGRectZero;
+ if (rects.size()) {
+ firstRect = rects[0];
+ lastRect = rects[rects.size() - 1];
+ }
+
+ WKAutoCorrectionData *autocorrectionData = self.autocorrectionData;
+ autocorrectionData->fontName = fontName;
+ autocorrectionData->fontSize = fontSize;
+ autocorrectionData->fontTraits = traits;
+ autocorrectionData->textFirstRect = firstRect;
+ autocorrectionData->textLastRect = lastRect;
+
+ autocorrectionData->autocorrectionHandler(rects.size() ? [WKAutocorrectionRects autocorrectionRectsWithRects:firstRect lastRect:lastRect] : nil);
+ [autocorrectionData->autocorrectionHandler release];
+ autocorrectionData->autocorrectionHandler = nil;
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (CGRect)textFirstRect
</span><span class="lines">@@ -1175,30 +1167,17 @@
</span><span class="cx"> return (_page->editorState().hasComposition) ? _page->editorState().lastMarkedRect : _autocorrectionData.textLastRect;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void autocorrectionResult(WKStringRef correction, WKErrorRef error, void* context)
-{
- WKInteractionView* view = static_cast<WKInteractionView*>(context);
- ASSERT(view);
- WKAutoCorrectionData *autocorrectionData = view.autocorrectionData;
-
- autocorrectionData->autocorrectionHandler(correction ? [WKAutocorrectionRects autocorrectionRectsWithRects:autocorrectionData->textFirstRect lastRect:autocorrectionData->textLastRect] : nil);
- [autocorrectionData->autocorrectionHandler release];
- autocorrectionData->autocorrectionHandler = nil;
-}
-
</del><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="cx"> - (void)applyAutocorrection:(NSString *)correction toString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForCorrection))completionHandler
</span><span class="cx"> {
</span><span class="cx"> _autocorrectionData.autocorrectionHandler = [completionHandler copy];
</span><del>- _page->applyAutocorrection(correction, input, StringCallback::create(self, autocorrectionResult));
-}
</del><ins>+ _page->applyAutocorrection(correction, input, StringCallback::create([self](bool /*error*/, StringImpl* string) {
+ WKAutoCorrectionData *autocorrectionData = self.autocorrectionData;
</ins><span class="cx">
</span><del>-static void autocorrectionContext(const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length, WKErrorRef error, void* context)
-{
- WKInteractionView* view = static_cast<WKInteractionView*>(context);
- ASSERT(view);
- WKAutoCorrectionData *autocorrectionData = view.autocorrectionData;
- autocorrectionData->autocorrectionContextHandler([WKAutocorrectionContext autocorrectionContextWithData:beforeText markedText:markedText selectedText:selectedText afterText:afterText selectedRangeInMarkedText:NSMakeRange(location, length)]);
</del><ins>+ autocorrectionData->autocorrectionHandler(string ? [WKAutocorrectionRects autocorrectionRectsWithRects:autocorrectionData->textFirstRect lastRect:autocorrectionData->textLastRect] : nil);
+ [autocorrectionData->autocorrectionHandler release];
+ autocorrectionData->autocorrectionHandler = nil;
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)requestAutocorrectionContextWithCompletionHandler:(void (^)(UIWKAutocorrectionContext *autocorrectionContext))completionHandler
</span><span class="lines">@@ -1217,7 +1196,10 @@
</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, autocorrectionContext));
</del><ins>+ _page->requestAutocorrectionContext(AutocorrectionContextCallback::create([self, completionHandler](bool /*error*/, const String& beforeText, const String& markedText, const String& selectedText, const String& afterText, uint64_t location, uint64_t length) {
+ WKAutoCorrectionData *autocorrectionData = self.autocorrectionData;
+ autocorrectionData->autocorrectionContextHandler([WKAutocorrectionContext autocorrectionContextWithData:beforeText markedText:markedText selectedText:selectedText afterText:afterText selectedRangeInMarkedText:NSMakeRange(location, length)]);
+ }));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKPrintingViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -207,11 +207,10 @@
</span><span class="cx"> uint64_t callbackID;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-static void pageDidDrawToImage(const ShareableBitmap::Handle& imageHandle, WKErrorRef, void* untypedContext)
</del><ins>+static void pageDidDrawToImage(const ShareableBitmap::Handle& imageHandle, IPCCallbackContext* context)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(RunLoop::isMain());
</span><span class="cx">
</span><del>- OwnPtr<IPCCallbackContext> context = adoptPtr(static_cast<IPCCallbackContext*>(untypedContext));
</del><span class="cx"> WKPrintingView *view = context->view.get();
</span><span class="cx">
</span><span class="cx"> // If the user has already changed print setup, then this response is obsolete. And if this callback is not in response to the latest request,
</span><span class="lines">@@ -236,25 +235,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void pageDidDrawToPDF(WKDataRef dataRef, WKErrorRef, void* untypedContext)
-{
- ASSERT(RunLoop::isMain());
-
- OwnPtr<IPCCallbackContext> context = adoptPtr(static_cast<IPCCallbackContext*>(untypedContext));
- WKPrintingView *view = context->view.get();
- API::Data* data = toImpl(dataRef);
-
- if (context->callbackID == view->_expectedPrintCallback) {
- ASSERT(![view _isPrintingPreview]);
- ASSERT(view->_printedPagesData.isEmpty());
- ASSERT(!view->_printedPagesPDFDocument);
- if (data)
- view->_printedPagesData.append(data->bytes(), data->size());
- view->_expectedPrintCallback = 0;
- view->_printingCallbackCondition.notify_one();
- }
-}
-
</del><span class="cx"> - (void)_preparePDFDataForPrintingOnSecondaryThread
</span><span class="cx"> {
</span><span class="cx"> ASSERT(RunLoop::isMain());
</span><span class="lines">@@ -283,7 +263,22 @@
</span><span class="cx"> _webFrame->page()->beginPrinting(_webFrame.get(), printInfo);
</span><span class="cx">
</span><span class="cx"> IPCCallbackContext* context = new IPCCallbackContext;
</span><del>- RefPtr<DataCallback> callback = DataCallback::create(context, pageDidDrawToPDF);
</del><ins>+ RefPtr<DataCallback> callback = DataCallback::create([context](bool, API::Data* data) {
+ ASSERT(RunLoop::isMain());
+
+ OwnPtr<IPCCallbackContext> contextDeleter = adoptPtr(context);
+ WKPrintingView *view = context->view.get();
+
+ if (context->callbackID == view->_expectedPrintCallback) {
+ ASSERT(![view _isPrintingPreview]);
+ ASSERT(view->_printedPagesData.isEmpty());
+ ASSERT(!view->_printedPagesPDFDocument);
+ if (data)
+ view->_printedPagesData.append(data->bytes(), data->size());
+ view->_expectedPrintCallback = 0;
+ view->_printingCallbackCondition.notify_one();
+ }
+ });
</ins><span class="cx"> _expectedPrintCallback = callback->callbackID();
</span><span class="cx">
</span><span class="cx"> context->view = self;
</span><span class="lines">@@ -292,11 +287,10 @@
</span><span class="cx"> _webFrame->page()->drawPagesToPDF(_webFrame.get(), printInfo, firstPage - 1, lastPage - firstPage + 1, callback.get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void pageDidComputePageRects(const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting, WKErrorRef, void* untypedContext)
</del><ins>+static void pageDidComputePageRects(const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting, IPCCallbackContext* context)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(RunLoop::isMain());
</span><span class="cx">
</span><del>- OwnPtr<IPCCallbackContext> context = adoptPtr(static_cast<IPCCallbackContext*>(untypedContext));
</del><span class="cx"> WKPrintingView *view = context->view.get();
</span><span class="cx">
</span><span class="cx"> // If the user has already changed print setup, then this response is obsolete.
</span><span class="lines">@@ -344,7 +338,10 @@
</span><span class="cx"> ASSERT(!_expectedComputedPagesCallback);
</span><span class="cx">
</span><span class="cx"> IPCCallbackContext* context = new IPCCallbackContext;
</span><del>- RefPtr<ComputedPagesCallback> callback = ComputedPagesCallback::create(context, pageDidComputePageRects);
</del><ins>+ RefPtr<ComputedPagesCallback> callback = ComputedPagesCallback::create([context](bool, const Vector<WebCore::IntRect>& pageRects, double totalScaleFactorForPrinting) {
+ OwnPtr<IPCCallbackContext> contextDeleter = adoptPtr(context);
+ pageDidComputePageRects(pageRects, totalScaleFactorForPrinting, context);
+ });
</ins><span class="cx"> _expectedComputedPagesCallback = callback->callbackID();
</span><span class="cx"> context->view = self;
</span><span class="cx"> context->callbackID = _expectedComputedPagesCallback;
</span><span class="lines">@@ -493,7 +490,10 @@
</span><span class="cx"> _webFrame->page()->beginPrinting(_webFrame.get(), PrintInfo([_printOperation printInfo]));
</span><span class="cx">
</span><span class="cx"> IPCCallbackContext* context = new IPCCallbackContext;
</span><del>- RefPtr<ImageCallback> callback = ImageCallback::create(context, pageDidDrawToImage);
</del><ins>+ RefPtr<ImageCallback> callback = ImageCallback::create([context](bool, const ShareableBitmap::Handle& imageHandle) {
+ OwnPtr<IPCCallbackContext> contextDeleter = adoptPtr(context);
+ pageDidDrawToImage(imageHandle, context);
+ });
</ins><span class="cx"> _latestExpectedPreviewCallback = callback->callbackID();
</span><span class="cx"> _expectedPreviewCallbacks.add(_latestExpectedPreviewCallback, scaledPrintingRect);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -728,18 +728,6 @@
</span><span class="cx"> return (NSToolbarItem *)item;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void validateCommandCallback(WKStringRef commandName, bool isEnabled, int32_t state, WKErrorRef error, void* context)
-{
- // If the process exits before the command can be validated, we'll be called back with an error.
- if (error)
- return;
-
- WKView* wkView = static_cast<WKView*>(context);
- ASSERT(wkView);
-
- [wkView _setUserInterfaceItemState:nsStringFromWebCoreString(toImpl(commandName)->string()) enabled:isEnabled state:state];
-}
-
</del><span class="cx"> - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
</span><span class="cx"> {
</span><span class="cx"> SEL action = [item action];
</span><span class="lines">@@ -831,7 +819,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, validateCommandCallback));
</del><ins>+ _data->_page->validateCommand(commandName, ValidateCommandCallback::create([self](bool error, StringImpl* commandName, bool isEnabled, int32_t state) {
+ // If the process exits before the command can be validated, we'll be called back with an error.
+ if (error)
+ return;
+
+ [self _setUserInterfaceItemState:nsStringFromWebCoreString(commandName) enabled:isEnabled state:state];
+ }));
</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">@@ -840,22 +834,18 @@
</span><span class="cx"> return YES;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void speakString(WKStringRef string, WKErrorRef error, void*)
</del><ins>+- (IBAction)startSpeaking:(id)sender
</ins><span class="cx"> {
</span><del>- if (error)
- return;
- if (!string)
- return;
</del><ins>+ _data->_page->getSelectionOrContentsAsString(StringCallback::create([self](bool error, StringImpl* string) {
+ if (error)
+ return;
+ if (!string)
+ return;
</ins><span class="cx">
</span><del>- NSString *convertedString = toImpl(string)->string();
- [NSApp speakString:convertedString];
</del><ins>+ [NSApp speakString:*string];
+ }));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (IBAction)startSpeaking:(id)sender
-{
- _data->_page->getSelectionOrContentsAsString(StringCallback::create(0, speakString));
-}
-
</del><span class="cx"> - (IBAction)stopSpeaking:(id)sender
</span><span class="cx"> {
</span><span class="cx"> [NSApp stopSpeaking:sender];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAutoCorrectionCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/AutoCorrectionCallback.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/AutoCorrectionCallback.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/AutoCorrectionCallback.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -37,11 +37,11 @@
</span><span class="cx">
</span><span class="cx"> class AutocorrectionDataCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(const Vector<WebCore::FloatRect>&, const String&, double, uint64_t, WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool, const Vector<WebCore::FloatRect>&, const String&, double, uint64_t)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<AutocorrectionDataCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<AutocorrectionDataCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new AutocorrectionDataCallback(context, callback));
</del><ins>+ return adoptRef(new AutocorrectionDataCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~AutocorrectionDataCallback()
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- m_callback(returnValue1, returnValue2, returnValue3, returnValue4, 0, context());
</del><ins>+ m_callback(false, returnValue1, returnValue2, returnValue3, returnValue4);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -62,16 +62,14 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- RefPtr<API::Error> error = API::Error::create();
- m_callback(Vector<WebCore::FloatRect>(), String(), 0, 0, toAPI(error.get()), context());
</del><ins>+ m_callback(true, Vector<WebCore::FloatRect>(), String(), 0, 0);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- AutocorrectionDataCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ AutocorrectionDataCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx"> }
</span><span class="lines">@@ -81,11 +79,11 @@
</span><span class="cx">
</span><span class="cx"> class AutocorrectionContextCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(const String&, const String&, const String&, const String&, uint64_t, uint64_t, WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool, const String&, const String&, const String&, const String&, uint64_t, uint64_t)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<AutocorrectionContextCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<AutocorrectionContextCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new AutocorrectionContextCallback(context, callback));
</del><ins>+ return adoptRef(new AutocorrectionContextCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~AutocorrectionContextCallback()
</span><span class="lines">@@ -97,7 +95,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- m_callback(returnValue1, returnValue2, returnValue3, returnValue4, returnValue5, returnValue6, 0, context());
</del><ins>+ m_callback(false, returnValue1, returnValue2, returnValue3, returnValue4, returnValue5, returnValue6);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -106,16 +104,14 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- RefPtr<API::Error> error = API::Error::create();
- m_callback(String(), String(), String(), String(), 0, 0, toAPI(error.get()), context());
</del><ins>+ m_callback(true, String(), String(), String(), String(), 0, 0);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- AutocorrectionContextCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ AutocorrectionContextCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessGenericCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/GenericCallback.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/GenericCallback.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/GenericCallback.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -29,7 +29,9 @@
</span><span class="cx"> #include "APIError.h"
</span><span class="cx"> #include "ShareableBitmap.h"
</span><span class="cx"> #include "WKAPICast.h"
</span><ins>+#include <functional>
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><ins>+#include <wtf/MainThread.h>
</ins><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="lines">@@ -44,32 +46,29 @@
</span><span class="cx"> uint64_t callbackID() const { return m_callbackID; }
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- explicit CallbackBase(void* context)
- : m_context(context)
- , m_callbackID(generateCallbackID())
</del><ins>+ explicit CallbackBase()
+ : m_callbackID(generateCallbackID())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void* context() const { return m_context; }
-
</del><span class="cx"> private:
</span><span class="cx"> static uint64_t generateCallbackID()
</span><span class="cx"> {
</span><ins>+ ASSERT(isMainThread());
</ins><span class="cx"> static uint64_t uniqueCallbackID = 1;
</span><span class="cx"> return uniqueCallbackID++;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void* m_context;
</del><span class="cx"> uint64_t m_callbackID;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class VoidCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<VoidCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<VoidCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new VoidCallback(context, callback));
</del><ins>+ return adoptRef(new VoidCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~VoidCallback()
</span><span class="lines">@@ -82,9 +81,9 @@
</span><span class="cx"> if (!m_callback)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- m_callback(0, context());
</del><ins>+ m_callback(false);
</ins><span class="cx">
</span><del>- m_callback = 0;
</del><ins>+ m_callback = nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void invalidate()
</span><span class="lines">@@ -92,30 +91,40 @@
</span><span class="cx"> if (!m_callback)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<API::Error> error = API::Error::create();
- m_callback(toAPI(error.get()), context());
-
- m_callback = 0;
</del><ins>+ m_callback(true);
+
+ m_callback = nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- VoidCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ VoidCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CallbackFunction m_callback;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<typename APIReturnValueType, typename InternalReturnValueType = typename APITypeInfo<APIReturnValueType>::ImplType>
</del><ins>+class VoidAPICallback : public CallbackBase {
+public:
+ typedef void (*CallbackFunction)(WKErrorRef, void*);
+
+ static PassRefPtr<VoidCallback> create(void* context, CallbackFunction callback)
+ {
+ return VoidCallback::create([context, callback](bool error) {
+ callback(error ? toAPI(API::Error::create().get()) : 0, context);
+ });
+ }
+};
+
+template<typename T>
</ins><span class="cx"> class GenericCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(APIReturnValueType, WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool, T)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<GenericCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<GenericCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new GenericCallback(context, callback));
</del><ins>+ return adoptRef(new GenericCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~GenericCallback()
</span><span class="lines">@@ -123,43 +132,56 @@
</span><span class="cx"> ASSERT(!m_callback);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- void performCallbackWithReturnValue(InternalReturnValueType returnValue)
</del><ins>+ void performCallbackWithReturnValue(T returnValue)
</ins><span class="cx"> {
</span><del>- ASSERT(m_callback);
</del><ins>+ if (!m_callback)
+ return;
</ins><span class="cx">
</span><del>- m_callback(toAPI(returnValue), 0, context());
</del><ins>+ m_callback(false, returnValue);
</ins><span class="cx">
</span><del>- m_callback = 0;
</del><ins>+ m_callback = nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void invalidate()
</span><span class="cx"> {
</span><del>- ASSERT(m_callback);
</del><ins>+ if (!m_callback)
+ return;
</ins><span class="cx">
</span><del>- RefPtr<API::Error> error = API::Error::create();
- m_callback(0, toAPI(error.get()), context());
-
- m_callback = 0;
</del><ins>+ m_callback(true, T());
+
+ m_callback = nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- GenericCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ GenericCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CallbackFunction m_callback;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-// FIXME: Make a version of CallbackBase with two arguments, and define ComputedPagesCallback as a specialization.
</del><ins>+template<typename APIReturnValueType, typename InternalReturnValueType = typename APITypeInfo<APIReturnValueType>::ImplType>
+class GenericAPICallback : public CallbackBase {
+public:
+ typedef void (*CallbackFunction)(APIReturnValueType, WKErrorRef, void*);
+
+ static PassRefPtr<GenericCallback<InternalReturnValueType>> create(void* context, CallbackFunction callback)
+ {
+ return GenericCallback<InternalReturnValueType>::create([context, callback](bool error, InternalReturnValueType returnValue) {
+ callback(toAPI(returnValue), error ? toAPI(API::Error::create().get()) : 0, context);
+ });
+ }
+};
+
+// FIXME: Make a version of GenericCallback with two arguments, and define ComputedPagesCallback as a specialization.
</ins><span class="cx"> class ComputedPagesCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(const Vector<WebCore::IntRect>&, double, WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool, const Vector<WebCore::IntRect>&, double)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<ComputedPagesCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<ComputedPagesCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new ComputedPagesCallback(context, callback));
</del><ins>+ return adoptRef(new ComputedPagesCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~ComputedPagesCallback()
</span><span class="lines">@@ -171,7 +193,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- m_callback(returnValue1, returnValue2, 0, context());
</del><ins>+ m_callback(false, returnValue1, returnValue2);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -180,17 +202,15 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- RefPtr<API::Error> error = API::Error::create();
- m_callback(Vector<WebCore::IntRect>(), 0, toAPI(error.get()), context());
</del><ins>+ m_callback(true, Vector<WebCore::IntRect>(), 0);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx">
</span><del>- ComputedPagesCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ ComputedPagesCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -199,11 +219,11 @@
</span><span class="cx">
</span><span class="cx"> class ImageCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(const ShareableBitmap::Handle&, WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool, const ShareableBitmap::Handle&)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<ImageCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<ImageCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new ImageCallback(context, callback));
</del><ins>+ return adoptRef(new ImageCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~ImageCallback()
</span><span class="lines">@@ -215,7 +235,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- m_callback(returnValue1, 0, context());
</del><ins>+ m_callback(true, returnValue1);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -226,16 +246,15 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<API::Error> error = API::Error::create();
</span><span class="cx"> ShareableBitmap::Handle handle;
</span><del>- m_callback(handle, toAPI(error.get()), context());
</del><ins>+ m_callback(false, handle);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx">
</span><del>- ImageCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ ImageCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsWebPluginSiteDataManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> class WebContext;
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> class WebPluginSiteDataManager : public API::ObjectImpl<API::Object::Type::PluginSiteDataManager> {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessStatisticsRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/StatisticsRequest.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/StatisticsRequest.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/StatisticsRequest.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">
</span><span class="cx"> struct StatisticsData;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKDictionaryRef> DictionaryCallback;
</del><ins>+typedef GenericCallback<ImmutableDictionary*> DictionaryCallback;
</ins><span class="cx">
</span><span class="cx"> enum StatisticsRequestType {
</span><span class="cx"> StatisticsRequestTypeWebContent = 0x00000001,
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebApplicationCacheManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> class WebSecurityOrigin;
</span><span class="cx"> struct SecurityOriginData;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> class WebApplicationCacheManagerProxy : public API::ObjectImpl<API::Object::Type::ApplicationCacheManager>, public WebContextSupplement, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> struct WebPageConfiguration;
</span><span class="cx"> struct WebProcessCreationParameters;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKDictionaryRef> DictionaryCallback;
</del><ins>+typedef GenericCallback<ImmutableDictionary*> DictionaryCallback;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(NETWORK_INFO)
</span><span class="cx"> class WebNetworkInfoManagerProxy;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebCookieManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -48,8 +48,8 @@
</span><span class="cx"> class WebContext;
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
-typedef GenericCallback<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
+typedef GenericCallback<HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyCallback;
</ins><span class="cx">
</span><span class="cx"> class WebCookieManagerProxy : public API::ObjectImpl<API::Object::Type::CookieManager>, public WebContextSupplement, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebDatabaseManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx"> class WebSecurityOrigin;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> class WebDatabaseManagerProxy : public API::ObjectImpl<API::Object::Type::DatabaseManager>, public WebContextSupplement, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebFrameProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebFrameProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebFrameProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebFrameProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> class WebFramePolicyListenerProxy;
</span><span class="cx"> class WebPageProxy;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKDataRef> DataCallback;
</del><ins>+typedef GenericCallback<API::Data*> DataCallback;
</ins><span class="cx">
</span><span class="cx"> class WebFrameProxy : public API::ObjectImpl<API::Object::Type::Frame> {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebKeyValueStorageManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManager.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManager.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManager.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> class WebKeyValueStorageManager : public API::ObjectImpl<API::Object::Type::KeyValueStorageManager>, public WebContextSupplement {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebMediaCacheManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> class WebContext;
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> class WebMediaCacheManagerProxy : public API::ObjectImpl<API::Object::Type::MediaCacheManager>, public WebContextSupplement, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebOriginDataManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebOriginDataManagerProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebOriginDataManagerProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebOriginDataManagerProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> class WebSecurityOrigin;
</span><span class="cx"> struct SecurityOriginData;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> class WebOriginDataManagerProxy : public API::ObjectImpl<API::Object::Type::OriginDataManager>, public WebContextSupplement, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -166,11 +166,11 @@
</span><span class="cx"> class WebVibrationProxy;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-typedef GenericCallback<WKStringRef, StringImpl*> StringCallback;
-typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback;
</del><ins>+typedef GenericCallback<StringImpl*> StringCallback;
+typedef GenericCallback<WebSerializedScriptValue*> ScriptValueCallback;
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(GTK)
</span><del>-typedef GenericCallback<WKErrorRef> PrintFinishedCallback;
</del><ins>+typedef GenericCallback<API::Error*> PrintFinishedCallback;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="lines">@@ -187,11 +187,11 @@
</span><span class="cx"> // FIXME: Make a version of CallbackBase with three arguments, and define ValidateCommandCallback as a specialization.
</span><span class="cx"> class ValidateCommandCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(WKStringRef, bool, int32_t, WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool, StringImpl*, bool, int32_t)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<ValidateCommandCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<ValidateCommandCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new ValidateCommandCallback(context, callback));
</del><ins>+ return adoptRef(new ValidateCommandCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~ValidateCommandCallback()
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- m_callback(toAPI(returnValue1), returnValue2, returnValue3, 0, context());
</del><ins>+ m_callback(false, returnValue1, returnValue2, returnValue3);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -212,17 +212,15 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- RefPtr<API::Error> error = API::Error::create();
- m_callback(0, 0, 0, toAPI(error.get()), context());
</del><ins>+ m_callback(true, 0, 0, 0);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx">
</span><del>- ValidateCommandCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ ValidateCommandCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -232,11 +230,11 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> class GestureCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, WKErrorRef, void*);
</del><ins>+ typedef std::function<void (bool, const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<GestureCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<GestureCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new GestureCallback(context, callback));
</del><ins>+ return adoptRef(new GestureCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~GestureCallback()
</span><span class="lines">@@ -248,7 +246,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- m_callback(returnValue1, returnValue2, returnValue3, returnValue4, 0, context());
</del><ins>+ m_callback(false, returnValue1, returnValue2, returnValue3, returnValue4);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -257,17 +255,15 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- RefPtr<API::Error> error = API::Error::create();
- m_callback(WebCore::IntPoint(), 0, 0, 0, toAPI(error.get()), context());
</del><ins>+ m_callback(true, WebCore::IntPoint(), 0, 0, 0);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx">
</span><del>- GestureCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ GestureCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx"> }
</span><span class="lines">@@ -277,11 +273,11 @@
</span><span class="cx">
</span><span class="cx"> class TouchesCallback : public CallbackBase {
</span><span class="cx"> public:
</span><del>- typedef void (*CallbackFunction)(const WebCore::IntPoint&, uint32_t, WKErrorRef, void*);
</del><ins>+ typedef std::function<void(bool, const WebCore::IntPoint&, uint32_t)> CallbackFunction;
</ins><span class="cx">
</span><del>- static PassRefPtr<TouchesCallback> create(void* context, CallbackFunction callback)
</del><ins>+ static PassRefPtr<TouchesCallback> create(CallbackFunction callback)
</ins><span class="cx"> {
</span><del>- return adoptRef(new TouchesCallback(context, callback));
</del><ins>+ return adoptRef(new TouchesCallback(callback));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~TouchesCallback()
</span><span class="lines">@@ -293,7 +289,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><del>- m_callback(returnValue1, returnValue2, 0, context());
</del><ins>+ m_callback(true, returnValue1, returnValue2);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -303,16 +299,15 @@
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx">
</span><span class="cx"> RefPtr<API::Error> error = API::Error::create();
</span><del>- m_callback(WebCore::IntPoint(), 0, toAPI(error.get()), context());
</del><ins>+ m_callback(false, WebCore::IntPoint(), 0);
</ins><span class="cx">
</span><span class="cx"> m_callback = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx">
</span><del>- TouchesCallback(void* context, CallbackFunction callback)
- : CallbackBase(context)
- , m_callback(callback)
</del><ins>+ TouchesCallback(CallbackFunction callback)
+ : m_callback(callback)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_callback);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebResourceCacheManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx"> class WebSecurityOrigin;
</span><span class="cx">
</span><del>-typedef GenericCallback<WKArrayRef> ArrayCallback;
</del><ins>+typedef GenericCallback<API::Array*> ArrayCallback;
</ins><span class="cx">
</span><span class="cx"> class WebResourceCacheManagerProxy : public API::ObjectImpl<API::Object::Type::CacheManager>, public WebContextSupplement, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKFullScreenWindowControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (164408 => 164409)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm        2014-02-20 03:03:39 UTC (rev 164408)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm        2014-02-20 03:21:41 UTC (rev 164409)
</span><span class="lines">@@ -367,8 +367,6 @@
</span><span class="cx"> [[self window] exitFullScreenMode:self];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void completeFinishExitFullScreenAnimationAfterRepaint(WKErrorRef, void*);
-
</del><span class="cx"> - (void)finishedExitFullScreenAnimation:(bool)completed
</span><span class="cx"> {
</span><span class="cx"> if (_fullScreenState != ExitingFullScreen)
</span><span class="lines">@@ -411,7 +409,9 @@
</span><span class="cx"> // clears _repaintCallback.
</span><span class="cx"> ASSERT(!_repaintCallback);
</span><span class="cx"> }
</span><del>- _repaintCallback = VoidCallback::create(self, completeFinishExitFullScreenAnimationAfterRepaint);
</del><ins>+ _repaintCallback = VoidCallback::create([self](bool) {
+ [self completeFinishExitFullScreenAnimationAfterRepaint];
+ });
</ins><span class="cx"> [self _page]->forceRepaint(_repaintCallback);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -423,11 +423,6 @@
</span><span class="cx"> NSEnableScreenUpdates();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void completeFinishExitFullScreenAnimationAfterRepaint(WKErrorRef, void* _self)
-{
- [(WKFullScreenWindowController*)_self completeFinishExitFullScreenAnimationAfterRepaint];
-}
-
</del><span class="cx"> - (void)performClose:(id)sender
</span><span class="cx"> {
</span><span class="cx"> if ([self isFullScreen])
</span></span></pre>
</div>
</div>
</body>
</html>