Title: [170126] trunk/Source/WebKit2
Revision
170126
Author
ander...@apple.com
Date
2014-06-18 16:04:58 -0700 (Wed, 18 Jun 2014)

Log Message

Add back WKPageRunJavaScriptInMainFrame_b for now
https://bugs.webkit.org/show_bug.cgi?id=134045
<rdar://problem/17368879>

Reviewed by Tim Horton.

Reverted changeset:

"Remove WKPageRunJavaScriptInMainFrame_b"
https://bugs.webkit.org/show_bug.cgi?id=133926
http://trac.webkit.org/changeset/169991

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (170125 => 170126)


--- trunk/Source/WebKit2/ChangeLog	2014-06-18 22:57:29 UTC (rev 170125)
+++ trunk/Source/WebKit2/ChangeLog	2014-06-18 23:04:58 UTC (rev 170126)
@@ -1,5 +1,19 @@
 2014-06-18  Anders Carlsson  <ander...@apple.com>
 
+        Add back WKPageRunJavaScriptInMainFrame_b for now
+        https://bugs.webkit.org/show_bug.cgi?id=134045
+        <rdar://problem/17368879>
+
+        Reviewed by Tim Horton.
+
+        Reverted changeset:
+
+        "Remove WKPageRunJavaScriptInMainFrame_b"
+        https://bugs.webkit.org/show_bug.cgi?id=133926
+        http://trac.webkit.org/changeset/169991
+
+2014-06-18  Anders Carlsson  <ander...@apple.com>
+
         Simplify WebPageProxy::saveRecentSearches and WebPageProxy::loadRecentSearches
         https://bugs.webkit.org/show_bug.cgi?id=134041
 

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (170125 => 170126)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2014-06-18 22:57:29 UTC (rev 170125)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2014-06-18 23:04:58 UTC (rev 170126)
@@ -1565,6 +1565,20 @@
     toImpl(pageRef)->runJavaScriptInMainFrame(toImpl(scriptRef)->string(), toGenericCallbackFunction(context, callback));
 }
 
+#ifdef __BLOCKS__
+static void callRunJavaScriptBlockAndRelease(WKSerializedScriptValueRef resultValue, WKErrorRef error, void* context)
+{
+    WKPageRunJavaScriptBlock block = (WKPageRunJavaScriptBlock)context;
+    block(resultValue, error);
+    Block_release(block);
+}
+
+void WKPageRunJavaScriptInMainFrame_b(WKPageRef pageRef, WKStringRef scriptRef, WKPageRunJavaScriptBlock block)
+{
+    WKPageRunJavaScriptInMainFrame(pageRef, scriptRef, Block_copy(block), callRunJavaScriptBlockAndRelease);
+}
+#endif
+
 static std::function<void (const String&, CallbackBase::Error)> toGenericCallbackFunction(void* context, void (*callback)(WKStringRef, WKErrorRef, void*))
 {
     return [context, callback](const String& returnValue, CallbackBase::Error error) {

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.h (170125 => 170126)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.h	2014-06-18 22:57:29 UTC (rev 170125)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.h	2014-06-18 23:04:58 UTC (rev 170126)
@@ -212,6 +212,10 @@
 
 typedef void (*WKPageRunJavaScriptFunction)(WKSerializedScriptValueRef, WKErrorRef, void*);
 WK_EXPORT void WKPageRunJavaScriptInMainFrame(WKPageRef page, WKStringRef script, void* context, WKPageRunJavaScriptFunction function);
+#ifdef __BLOCKS__
+typedef void (^WKPageRunJavaScriptBlock)(WKSerializedScriptValueRef, WKErrorRef);
+WK_EXPORT void WKPageRunJavaScriptInMainFrame_b(WKPageRef page, WKStringRef script, WKPageRunJavaScriptBlock block);
+#endif
 
 typedef void (*WKPageGetSourceForFrameFunction)(WKStringRef, WKErrorRef, void*);
 WK_EXPORT void WKPageGetSourceForFrame(WKPageRef page, WKFrameRef frame, void* context, WKPageGetSourceForFrameFunction function);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to