Add a way to get a WKWebProcessPlugInBrowserContextController from a handle
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2013 20:42:42 +0000 (20:42 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Nov 2013 20:42:42 +0000 (20:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=124063

Reviewed by Beth Dakin.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158942 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h

index 733ae25..658aeff 100644 (file)
@@ -1,5 +1,16 @@
 2013-11-08  Anders Carlsson  <andersca@apple.com>
 
+        Add a way to get a WKWebProcessPlugInBrowserContextController from a handle
+        https://bugs.webkit.org/show_bug.cgi?id=124063
+
+        Reviewed by Beth Dakin.
+
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        (+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]):
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
+
+2013-11-08  Anders Carlsson  <andersca@apple.com>
+
         More work on WKBrowsingContextHandle
         https://bugs.webkit.org/show_bug.cgi?id=124060
 
index 1ddba7e..b3ec8dc 100644 (file)
@@ -35,7 +35,9 @@
 #import "WKBundlePagePrivate.h"
 #import "WKDOMInternals.h"
 #import "WKRetainPtr.h"
+#import "WKWebProcessPlugInInternal.h"
 #import "WebPage.h"
+#import "WebProcess.h"
 #import <WebCore/Document.h>
 #import <WebCore/Frame.h>
 
@@ -89,6 +91,15 @@ using namespace WebKit;
     return [[[WKBrowsingContextHandle alloc] _initWithPageID:toImpl(_bundlePageRef.get())->pageID()] autorelease];
 }
 
++ (instancetype)lookUpBrowsingContextFromHandle:(WKBrowsingContextHandle *)handle
+{
+    WebPage* webPage = WebProcess::shared().webPage(handle.pageID);
+    if (!webPage)
+        return nil;
+
+    return [[WKWebProcessPlugInController _shared] _browserContextControllerForBundlePageRef:toAPI(webPage)];
+}
+
 @end
 
 #endif // WK_API_ENABLED