Title: [204284] trunk/Source/WebKit2
Revision
204284
Author
m...@apple.com
Date
2016-08-09 10:01:39 -0700 (Tue, 09 Aug 2016)

Log Message

Add WKPage SPI for looking up a WKFrame given a WKFrameHandle
https://bugs.webkit.org/show_bug.cgi?id=160695

Reviewed by Anders Carlsson.

* UIProcess/API/C/WKPage.cpp:
(WKPageLookUpFrameFromHandle): Added. Gets the frame from the map in the page’s process and
  returns it if it belongs to the page.
* UIProcess/API/C/WKPagePrivate.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (204283 => 204284)


--- trunk/Source/WebKit2/ChangeLog	2016-08-09 16:57:46 UTC (rev 204283)
+++ trunk/Source/WebKit2/ChangeLog	2016-08-09 17:01:39 UTC (rev 204284)
@@ -1,3 +1,15 @@
+2016-08-09  Dan Bernstein  <m...@apple.com>
+
+        Add WKPage SPI for looking up a WKFrame given a WKFrameHandle
+        https://bugs.webkit.org/show_bug.cgi?id=160695
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageLookUpFrameFromHandle): Added. Gets the frame from the map in the page’s process and
+          returns it if it belongs to the page.
+        * UIProcess/API/C/WKPagePrivate.h:
+
 2016-08-08  Anders Carlsson  <ander...@apple.com>
 
         Move plug-in code from WebPlatformStrategies to WebPluginInfoProvider

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


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2016-08-09 16:57:46 UTC (rev 204283)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2016-08-09 17:01:39 UTC (rev 204284)
@@ -33,6 +33,7 @@
 #include "APIDictionary.h"
 #include "APIFindClient.h"
 #include "APIFindMatchesClient.h"
+#include "APIFrameHandle.h"
 #include "APIFrameInfo.h"
 #include "APIGeometry.h"
 #include "APIHitTestResult.h"
@@ -2639,6 +2640,16 @@
     return toAPI(&API::Array::create(WTFMove(relatedPages)).leakRef());
 }
 
+WKFrameRef WKPageLookUpFrameFromHandle(WKPageRef pageRef, WKFrameHandleRef handleRef)
+{
+    auto page = toImpl(pageRef);
+    auto frame = page->process().webFrame(toImpl(handleRef)->frameID());
+    if (!frame || frame->page() != page)
+        return nullptr;
+
+    return toAPI(frame);
+}
+
 void WKPageSetMayStartMediaWhenInWindow(WKPageRef pageRef, bool mayStartMedia)
 {
     toImpl(pageRef)->setMayStartMediaWhenInWindow(mayStartMedia);

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h (204283 => 204284)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2016-08-09 16:57:46 UTC (rev 204283)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h	2016-08-09 17:01:39 UTC (rev 204284)
@@ -101,6 +101,8 @@
     
 WK_EXPORT WKArrayRef WKPageCopyRelatedPages(WKPageRef page);
 
+WK_EXPORT WKFrameRef WKPageLookUpFrameFromHandle(WKPageRef page, WKFrameHandleRef handle);
+
 enum {
     kWKScrollPinningBehaviorDoNotPin,
     kWKScrollPinningBehaviorPinToTop,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to