[Cocoa] Add a _certificateChain property to WKWebProcessPlugInFrame
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2014 17:45:50 +0000 (17:45 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Apr 2014 17:45:50 +0000 (17:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131370

Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(-[WKWebProcessPlugInFrame _certificateChain]): Added this getter, which uses the new
WebFrame::certificateInfo.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::certificateInfo): Added this getter.
* WebProcess/WebPage/WebFrame.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.h

index 9d4edba..d100848 100644 (file)
@@ -1,5 +1,20 @@
 2014-04-08  Dan Bernstein  <mitz@apple.com>
 
+        [Cocoa] Add a _certificateChain property to WKWebProcessPlugInFrame
+        https://bugs.webkit.org/show_bug.cgi?id=131370
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
+        (-[WKWebProcessPlugInFrame _certificateChain]): Added this getter, which uses the new
+        WebFrame::certificateInfo.
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::certificateInfo): Added this getter.
+        * WebProcess/WebPage/WebFrame.h:
+
+2014-04-08  Dan Bernstein  <mitz@apple.com>
+
         [Cocoa] Add a bundle form delegate method corresponding to textDidChangeInTextField
         https://bugs.webkit.org/show_bug.cgi?id=131369
 
index 217880e..1395728 100644 (file)
@@ -37,6 +37,7 @@
 #import "WebProcess.h"
 #import "_WKFrameHandleInternal.h"
 #import <JavaScriptCore/JSValue.h>
+#import <WebCore/CertificateInfo.h>
 #import <WebCore/IntPoint.h>
 
 using namespace WebKit;
@@ -110,6 +111,11 @@ using namespace WebKit;
     return _frame->page()->mainFrameHasCustomContentProvider();
 }
 
+- (NSArray *)_certificateChain
+{
+    return (NSArray *)_frame->certificateInfo().certificateChain();
+}
+
 #pragma mark WKObject protocol implementation
 
 - (API::Object&)_apiObject
index ce5de32..277ab75 100644 (file)
@@ -36,6 +36,7 @@
 @property (nonatomic, readonly) WKWebProcessPlugInBrowserContextController *_browserContextController;
 
 @property (nonatomic, readonly) BOOL _hasCustomContentProvider;
+@property (nonatomic, readonly) NSArray *_certificateChain;
 
 @end
 
index f418d09..f0dd31e 100644 (file)
@@ -44,6 +44,7 @@
 #include <JavaScriptCore/JSLock.h>
 #include <JavaScriptCore/JSValueRef.h>
 #include <WebCore/ArchiveResource.h>
+#include <WebCore/CertificateInfo.h>
 #include <WebCore/Chrome.h>
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/EventHandler.h>
@@ -401,6 +402,18 @@ String WebFrame::url() const
     return documentLoader->url().string();
 }
 
+const WebCore::CertificateInfo& WebFrame::certificateInfo() const
+{
+    if (!m_coreFrame)
+        return std::move(CertificateInfo());
+
+    DocumentLoader* documentLoader = m_coreFrame->loader().documentLoader();
+    if (!documentLoader)
+        return std::move(CertificateInfo());
+
+    return std::move(CertificateInfo(documentLoader->response()));
+}
+
 String WebFrame::innerText() const
 {
     if (!m_coreFrame)
index 77195b9..a137eed 100644 (file)
@@ -43,6 +43,7 @@ class Array;
 }
 
 namespace WebCore {
+class CertificateInfo;
 class Frame;
 class HTMLFrameOwnerElement;
 class IntPoint;
@@ -91,6 +92,7 @@ public:
     bool isMainFrame() const;
     String name() const;
     String url() const;
+    const WebCore::CertificateInfo& certificateInfo() const;
     String innerText() const;
     bool isFrameSet() const;
     WebFrame* parentFrame() const;