Title: [267387] trunk/Source/WebKit
Revision
267387
Author
timo...@apple.com
Date
2020-09-21 17:37:16 -0700 (Mon, 21 Sep 2020)

Log Message

Add some WKWebProcessPlugInFrame SPI needed by Safari.
https://bugs.webkit.org/show_bug.cgi?id=216809
rdar://problem/69336928

Reviewed by Brian Weinstein.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(+[WKWebProcessPlugInFrame lookUpFrameFromJSContext:]): Added.
(-[WKWebProcessPlugInFrame _securityOrigin]): Added.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (267386 => 267387)


--- trunk/Source/WebKit/ChangeLog	2020-09-22 00:17:33 UTC (rev 267386)
+++ trunk/Source/WebKit/ChangeLog	2020-09-22 00:37:16 UTC (rev 267387)
@@ -1,3 +1,16 @@
+2020-09-21  Timothy Hatcher  <timo...@apple.com>
+
+        Add some WKWebProcessPlugInFrame SPI needed by Safari.
+        https://bugs.webkit.org/show_bug.cgi?id=216809
+        rdar://problem/69336928
+
+        Reviewed by Brian Weinstein.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
+        (+[WKWebProcessPlugInFrame lookUpFrameFromJSContext:]): Added.
+        (-[WKWebProcessPlugInFrame _securityOrigin]): Added.
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
+
 2020-09-21  Andres Gonzalez  <andresg...@apple.com>
 
         Make accessibility isolated tree a non-experimental feature.

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm (267386 => 267387)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm	2020-09-22 00:17:33 UTC (rev 267386)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm	2020-09-22 00:37:16 UTC (rev 267387)
@@ -52,6 +52,11 @@
     return wrapper(WebKit::WebProcess::singleton().webFrame(handle->_frameHandle->frameID()));
 }
 
++ (instancetype)lookUpFrameFromJSContext:(JSContext *)context
+{
+    return wrapper(WebKit::WebFrame::frameForContext(context.JSGlobalContextRef));
+}
+
 - (void)dealloc
 {
     _frame->~WebFrame();
@@ -110,6 +115,14 @@
     return wrapper(API::FrameHandle::create(_frame->frameID()));
 }
 
+- (NSString *)_securityOrigin
+{
+    auto* coreFrame = _frame->coreFrame();
+    if (!coreFrame)
+        return nil;
+    return coreFrame->document()->securityOrigin().toString();
+}
+
 static RetainPtr<NSArray> collectIcons(WebCore::Frame* frame, OptionSet<WebCore::LinkIconType> iconTypes)
 {
     if (!frame)

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h (267386 => 267387)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h	2020-09-22 00:17:33 UTC (rev 267386)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h	2020-09-22 00:37:16 UTC (rev 267387)
@@ -25,11 +25,13 @@
 
 #import "WKWebProcessPlugInFrame.h"
 
+@class JSContext;
 @class WKWebProcessPlugInBrowserContextController;
 
 @interface WKWebProcessPlugInFrame (WKPrivate)
 
 + (instancetype)lookUpFrameFromHandle:(_WKFrameHandle *)handle;
++ (instancetype)lookUpFrameFromJSContext:(JSContext *)context;
 
 @property (nonatomic, readonly) WKWebProcessPlugInBrowserContextController *_browserContextController;
 
@@ -37,6 +39,7 @@
 @property (nonatomic, readonly) NSArray *_certificateChain;
 @property (nonatomic, readonly) SecTrustRef _serverTrust;
 @property (nonatomic, readonly) NSURL *_provisionalURL;
+@property (nonatomic, readonly) NSString *_securityOrigin;
 
 @property (nonatomic, readonly) WKWebProcessPlugInFrame *_parentFrame;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to