<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[205150] trunk/Source/WebKit2</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/205150">205150</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-08-29 15:00:39 -0700 (Mon, 29 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Get rid of another use of WebProcessProxy::fromConnection
https://bugs.webkit.org/show_bug.cgi?id=161331
Reviewed by Dan Bernstein.
WebUserContentControllerProxy::didPostMessage uses WebProcessProxy::fromConnection to be able to find a WebFrameProxy from
a given frame ID. Since the WebFrameProxy is only used to construct an API::FrameInfo object from, introduce a FrameInfoData object
and fill it in on the web process side and send it over to the UI process where an API::FrameInfo object can be created.
* Shared/FrameInfoData.cpp: Added.
(WebKit::FrameInfoData::encode):
(WebKit::FrameInfoData::decode):
* Shared/FrameInfoData.h: Added.
* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::create):
(API::FrameInfo::FrameInfo):
* UIProcess/API/APIFrameInfo.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:
* UIProcess/UserContent/WebScriptMessageHandler.h:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::didPostMessage):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/UserContent/WebUserContentControllerProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/UserContent/WebUserContentController.cpp:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::info):
* WebProcess/WebPage/WebFrame.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIFrameInfocpp">trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIFrameInfoh">trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebScriptMessageHandlerh">trunk/Source/WebKit2/UIProcess/UserContent/WebScriptMessageHandler.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp">trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh">trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxymessagesin">trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp">trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebFramecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebFrameh">trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedFrameInfoDatacpp">trunk/Source/WebKit2/Shared/FrameInfoData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedFrameInfoDatah">trunk/Source/WebKit2/Shared/FrameInfoData.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/ChangeLog        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -1,5 +1,36 @@
</span><span class="cx"> 2016-08-29 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><ins>+ Get rid of another use of WebProcessProxy::fromConnection
+ https://bugs.webkit.org/show_bug.cgi?id=161331
+
+ Reviewed by Dan Bernstein.
+
+ WebUserContentControllerProxy::didPostMessage uses WebProcessProxy::fromConnection to be able to find a WebFrameProxy from
+ a given frame ID. Since the WebFrameProxy is only used to construct an API::FrameInfo object from, introduce a FrameInfoData object
+ and fill it in on the web process side and send it over to the UI process where an API::FrameInfo object can be created.
+
+ * Shared/FrameInfoData.cpp: Added.
+ (WebKit::FrameInfoData::encode):
+ (WebKit::FrameInfoData::decode):
+ * Shared/FrameInfoData.h: Added.
+ * UIProcess/API/APIFrameInfo.cpp:
+ (API::FrameInfo::create):
+ (API::FrameInfo::FrameInfo):
+ * UIProcess/API/APIFrameInfo.h:
+ * UIProcess/API/Cocoa/WKUserContentController.mm:
+ * UIProcess/UserContent/WebScriptMessageHandler.h:
+ * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
+ (WebKit::WebUserContentControllerProxy::didPostMessage):
+ * UIProcess/UserContent/WebUserContentControllerProxy.h:
+ * UIProcess/UserContent/WebUserContentControllerProxy.messages.in:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/UserContent/WebUserContentController.cpp:
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::info):
+ * WebProcess/WebPage/WebFrame.h:
+
+2016-08-29 Anders Carlsson <andersca@apple.com>
+
</ins><span class="cx"> Stop using WebProcessProxy::fromConnection in WebPageProxy
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=161322
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedFrameInfoDatacppfromrev205137trunkSourceWebKit2UIProcessAPIAPIFrameInfocpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/FrameInfoData.cpp (from rev 205137, trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.cpp) (0 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/FrameInfoData.cpp         (rev 0)
+++ trunk/Source/WebKit2/Shared/FrameInfoData.cpp        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FrameInfoData.h"
+
+#include "WebCoreArgumentCoders.h"
+
+namespace WebKit {
+
+void FrameInfoData::encode(IPC::Encoder& encoder) const
+{
+ encoder << isMainFrame;
+ encoder << request;
+ encoder << securityOrigin;
+ encoder << frameID;
+}
+
+bool FrameInfoData::decode(IPC::Decoder& decoder, FrameInfoData& result)
+{
+ if (!decoder.decode(result.isMainFrame))
+ return false;
+ if (!decoder.decode(result.request))
+ return false;
+ if (!decoder.decode(result.securityOrigin))
+ return false;
+ if (!decoder.decode(result.frameID))
+ return false;
+
+ return true;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedFrameInfoDatahfromrev205137trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxymessagesin"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/FrameInfoData.h (from rev 205137, trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.messages.in) (0 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/FrameInfoData.h         (rev 0)
+++ trunk/Source/WebKit2/Shared/FrameInfoData.h        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebCore/ResourceRequest.h>
+#include <WebCore/SecurityOriginData.h>
+
+namespace IPC {
+class Decoder;
+class Encoder;
+}
+
+namespace WebKit {
+
+struct FrameInfoData {
+ void encode(IPC::Encoder&) const;
+ static bool decode(IPC::Decoder&, FrameInfoData&);
+
+ bool isMainFrame { false };
+ WebCore::ResourceRequest request;
+ WebCore::SecurityOriginData securityOrigin;
+ uint64_t frameID { 0 };
+};
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIFrameInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.cpp (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.cpp        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.cpp        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -27,19 +27,37 @@
</span><span class="cx"> #include "APIFrameInfo.h"
</span><span class="cx">
</span><span class="cx"> #include "APIFrameHandle.h"
</span><ins>+#include "FrameInfoData.h"
</ins><span class="cx"> #include "WebFrameProxy.h"
</span><span class="cx">
</span><span class="cx"> namespace API {
</span><span class="cx">
</span><del>-// FIXME: This should use the full request of the frame, not just the URL.
-FrameInfo::FrameInfo(const WebKit::WebFrameProxy& frame, const WebCore::SecurityOrigin& securityOrigin)
- : m_isMainFrame(frame.isMainFrame())
- , m_request(WebCore::ResourceRequest(frame.url()))
- , m_securityOrigin(adoptRef(*SecurityOrigin::create(securityOrigin).leakRef()))
- , m_handle(API::FrameHandle::create(frame.frameID()))
</del><ins>+Ref<FrameInfo> FrameInfo::create(const WebKit::FrameInfoData& frameInfoData)
</ins><span class="cx"> {
</span><ins>+ return adoptRef(*new FrameInfo(frameInfoData));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+Ref<FrameInfo> FrameInfo::create(const WebKit::WebFrameProxy& frame, const WebCore::SecurityOrigin& securityOrigin)
+{
+ WebKit::FrameInfoData frameInfoData;
+
+ frameInfoData.isMainFrame = frame.isMainFrame();
+ // FIXME: This should use the full request of the frame, not just the URL.
+ frameInfoData.request = WebCore::ResourceRequest(frame.url());
+ frameInfoData.securityOrigin = WebCore::SecurityOriginData::fromSecurityOrigin(securityOrigin);
+ frameInfoData.frameID = frame.frameID();
+
+ return create(frameInfoData);
+}
+
+FrameInfo::FrameInfo(const WebKit::FrameInfoData& frameInfoData)
+ : m_isMainFrame(frameInfoData.isMainFrame)
+ , m_request(frameInfoData.request)
+ , m_securityOrigin(*SecurityOrigin::create(frameInfoData.securityOrigin.securityOrigin()))
+ , m_handle(API::FrameHandle::create(frameInfoData.frameID))
+{
+}
+
</ins><span class="cx"> FrameInfo::~FrameInfo()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIFrameInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.h (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.h        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.h        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef APIFrameInfo_h
-#define APIFrameInfo_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "APIObject.h"
</span><span class="cx"> #include <WebCore/ResourceRequest.h>
</span><span class="lines">@@ -35,6 +34,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class WebFrameProxy;
</span><ins>+struct FrameInfoData;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace API {
</span><span class="lines">@@ -44,14 +44,10 @@
</span><span class="cx">
</span><span class="cx"> class FrameInfo final : public ObjectImpl<Object::Type::FrameInfo> {
</span><span class="cx"> public:
</span><del>- static Ref<FrameInfo> create(const WebKit::WebFrameProxy& frame, const WebCore::SecurityOrigin& securityOrigin)
- {
- return adoptRef(*new FrameInfo(frame, securityOrigin));
- }
</del><ins>+ static Ref<FrameInfo> create(const WebKit::FrameInfoData&);
+ static Ref<FrameInfo> create(const WebKit::WebFrameProxy&, const WebCore::SecurityOrigin&);
</ins><span class="cx"> virtual ~FrameInfo();
</span><span class="cx">
</span><del>- FrameInfo(const WebKit::WebFrameProxy&, const WebCore::SecurityOrigin&);
-
</del><span class="cx"> bool isMainFrame() const { return m_isMainFrame; }
</span><span class="cx"> const WebCore::ResourceRequest& request() const { return m_request; }
</span><span class="cx"> SecurityOrigin& securityOrigin() { return m_securityOrigin.get(); }
</span><span class="lines">@@ -58,6 +54,8 @@
</span><span class="cx"> API::FrameHandle& handle() { return m_handle.get(); }
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ FrameInfo(const WebKit::FrameInfoData&);
+
</ins><span class="cx"> bool m_isMainFrame;
</span><span class="cx"> WebCore::ResourceRequest m_request;
</span><span class="cx"> Ref<SecurityOrigin> m_securityOrigin;
</span><span class="lines">@@ -65,5 +63,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace API
</span><del>-
-#endif // APIFrameInfo_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -100,10 +100,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void didPostMessage(WebKit::WebPageProxy& page, WebKit::WebFrameProxy& frame, const WebCore::SecurityOriginData& securityOriginData, WebCore::SerializedScriptValue& serializedScriptValue)
</del><ins>+ void didPostMessage(WebKit::WebPageProxy& page, const WebKit::FrameInfoData& frameInfoData, WebCore::SerializedScriptValue& serializedScriptValue) override
</ins><span class="cx"> {
</span><span class="cx"> @autoreleasepool {
</span><del>- RetainPtr<WKFrameInfo> frameInfo = wrapper(API::FrameInfo::create(frame, securityOriginData.securityOrigin()));
</del><ins>+ RetainPtr<WKFrameInfo> frameInfo = wrapper(API::FrameInfo::create(frameInfoData));
</ins><span class="cx"> id body = API::SerializedScriptValue::deserialize(serializedScriptValue, 0);
</span><span class="cx"> auto message = adoptNS([[WKScriptMessage alloc] _initWithBody:body webView:fromWebPageProxy(page) frameInfo:frameInfo.get() name:m_name.get()]);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebScriptMessageHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebScriptMessageHandler.h (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebScriptMessageHandler.h        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebScriptMessageHandler.h        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx">
</span><span class="cx"> class WebPageProxy;
</span><span class="cx"> class WebFrameProxy;
</span><ins>+struct FrameInfoData;
</ins><span class="cx">
</span><span class="cx"> class WebScriptMessageHandler : public RefCounted<WebScriptMessageHandler> {
</span><span class="cx"> public:
</span><span class="lines">@@ -50,7 +51,7 @@
</span><span class="cx"> class Client {
</span><span class="cx"> public:
</span><span class="cx"> virtual ~Client() { }
</span><del>- virtual void didPostMessage(WebPageProxy&, WebFrameProxy&, const WebCore::SecurityOriginData&, WebCore::SerializedScriptValue&) = 0;
</del><ins>+ virtual void didPostMessage(WebPageProxy&, const FrameInfoData&, WebCore::SerializedScriptValue&) = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static Ref<WebScriptMessageHandler> create(std::unique_ptr<Client>, const String& name, API::UserContentWorld&);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -321,17 +321,12 @@
</span><span class="cx"> removeUserContentWorldUses(world, numberRemoved);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebUserContentControllerProxy::didPostMessage(IPC::Connection& connection, uint64_t pageID, uint64_t frameID, const WebCore::SecurityOriginData& securityOrigin, uint64_t messageHandlerID, const IPC::DataReference& dataReference)
</del><ins>+void WebUserContentControllerProxy::didPostMessage(IPC::Connection& connection, uint64_t pageID, const FrameInfoData& frameInfoData, uint64_t messageHandlerID, const IPC::DataReference& dataReference)
</ins><span class="cx"> {
</span><span class="cx"> WebPageProxy* page = WebProcessProxy::webPage(pageID);
</span><span class="cx"> if (!page)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- WebProcessProxy* webProcess = WebProcessProxy::fromConnection(&connection);
- WebFrameProxy* frame = webProcess->webFrame(frameID);
- if (!frame)
- return;
-
</del><span class="cx"> if (!HashMap<uint64_t, RefPtr<WebScriptMessageHandler>>::isValidKey(messageHandlerID))
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -339,7 +334,7 @@
</span><span class="cx"> if (!handler)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- handler->client().didPostMessage(*page, *frame, securityOrigin, WebCore::SerializedScriptValue::adopt(dataReference.vector()));
</del><ins>+ handler->client().didPostMessage(*page, frameInfoData, WebCore::SerializedScriptValue::adopt(dataReference.vector()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">
</span><span class="cx"> class WebProcessProxy;
</span><span class="cx"> class WebScriptMessageHandler;
</span><ins>+struct FrameInfoData;
</ins><span class="cx">
</span><span class="cx"> class WebUserContentControllerProxy : public API::ObjectImpl<API::Object::Type::UserContentController>, private IPC::MessageReceiver {
</span><span class="cx"> public:
</span><span class="lines">@@ -100,7 +101,7 @@
</span><span class="cx"> // IPC::MessageReceiver.
</span><span class="cx"> void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
</span><span class="cx">
</span><del>- void didPostMessage(IPC::Connection&, uint64_t pageID, uint64_t frameID, const WebCore::SecurityOriginData&, uint64_t messageHandlerID, const IPC::DataReference&);
</del><ins>+ void didPostMessage(IPC::Connection&, uint64_t pageID, const FrameInfoData&, uint64_t messageHandlerID, const IPC::DataReference&);
</ins><span class="cx">
</span><span class="cx"> void addUserContentWorldUse(API::UserContentWorld&);
</span><span class="cx"> void removeUserContentWorldUses(API::UserContentWorld&, unsigned numberOfUsesToRemove);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.messages.in (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.messages.in        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.messages.in        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -24,5 +24,5 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> messages -> WebUserContentControllerProxy {
</span><del>- DidPostMessage(uint64_t pageID, uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t messageHandlerID, IPC::DataReference message) WantsConnection
</del><ins>+DidPostMessage(uint64_t pageID, struct WebKit::FrameInfoData frameInfoData, uint64_t messageHandlerID, IPC::DataReference message) WantsConnection
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -150,6 +150,8 @@
</span><span class="cx">                 1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */; };
</span><span class="cx">                 1A0F29E3120B44420053D1B9 /* VisitedLinkStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F29E1120B44420053D1B9 /* VisitedLinkStore.cpp */; };
</span><span class="cx">                 1A0F29E4120B44420053D1B9 /* VisitedLinkStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29E2120B44420053D1B9 /* VisitedLinkStore.h */; };
</span><ins>+                1A14F8E11D74C834006CBEC6 /* FrameInfoData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A14F8DF1D74C834006CBEC6 /* FrameInfoData.cpp */; };
+                1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A14F8E01D74C834006CBEC6 /* FrameInfoData.h */; };
</ins><span class="cx">                 1A158419189044F50017616C /* WKProcessPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A158417189044F50017616C /* WKProcessPool.mm */; };
</span><span class="cx">                 1A15841A189044F50017616C /* WKProcessPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A158418189044F50017616C /* WKProcessPool.h */; settings = {ATTRIBUTES = (Public, ); }; };
</span><span class="cx">                 1A17977F137EE82C00F97D45 /* PluginCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A17977D137EE82C00F97D45 /* PluginCreationParameters.cpp */; };
</span><span class="lines">@@ -2114,6 +2116,8 @@
</span><span class="cx">                 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkTable.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A0F29E1120B44420053D1B9 /* VisitedLinkStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkStore.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A0F29E2120B44420053D1B9 /* VisitedLinkStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkStore.h; sourceTree = "<group>"; };
</span><ins>+                1A14F8DF1D74C834006CBEC6 /* FrameInfoData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameInfoData.cpp; sourceTree = "<group>"; };
+                1A14F8E01D74C834006CBEC6 /* FrameInfoData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameInfoData.h; sourceTree = "<group>"; };
</ins><span class="cx">                 1A158417189044F50017616C /* WKProcessPool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKProcessPool.mm; sourceTree = "<group>"; };
</span><span class="cx">                 1A158418189044F50017616C /* WKProcessPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessPool.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A17635416B1D5D000D88FD6 /* StorageNamespaceImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceImpl.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -4512,6 +4516,8 @@
</span><span class="cx">                                 BCE81D8A1319F7EF00241910 /* FontInfo.cpp */,
</span><span class="cx">                                 BCE81D8B1319F7EF00241910 /* FontInfo.h */,
</span><span class="cx">                                 762B7481120BBA0100819339 /* FontSmoothingLevel.h */,
</span><ins>+                                1A14F8DF1D74C834006CBEC6 /* FrameInfoData.cpp */,
+                                1A14F8E01D74C834006CBEC6 /* FrameInfoData.h */,
</ins><span class="cx">                                 1AC75A1A1B3368270056745B /* HangDetectionDisabler.h */,
</span><span class="cx">                                 F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */,
</span><span class="cx">                                 BCCF6B2312C93E7A008F9C35 /* ImageOptions.h */,
</span><span class="lines">@@ -8158,6 +8164,7 @@
</span><span class="cx">                                 371A19421824D29300F32A5E /* WKNSDictionary.h in Headers */,
</span><span class="cx">                                 372CAF0B1833FD910040AC27 /* WKNSError.h in Headers */,
</span><span class="cx">                                 378E1A4A18208CD60031007A /* WKNSString.h in Headers */,
</span><ins>+                                1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */,
</ins><span class="cx">                                 378E1A4E18208D700031007A /* WKNSURL.h in Headers */,
</span><span class="cx">                                 37FC194B18510D6A008CFA47 /* WKNSURLAuthenticationChallenge.h in Headers */,
</span><span class="cx">                                 37183D57182F4E700080C811 /* WKNSURLExtras.h in Headers */,
</span><span class="lines">@@ -9103,6 +9110,7 @@
</span><span class="cx">                                 E47D1E981B0649FB002676A8 /* NetworkCacheData.cpp in Sources */,
</span><span class="cx">                                 E42E06141AA75B7000B11699 /* NetworkCacheDataCocoa.mm in Sources */,
</span><span class="cx">                                 E489D28D1A0A2DB80078C06A /* NetworkCacheDecoder.cpp in Sources */,
</span><ins>+                                1A14F8E11D74C834006CBEC6 /* FrameInfoData.cpp in Sources */,
</ins><span class="cx">                                 E489D28F1A0A2DB80078C06A /* NetworkCacheEncoder.cpp in Sources */,
</span><span class="cx">                                 E413F59F1AC1AF9D00345360 /* NetworkCacheEntry.cpp in Sources */,
</span><span class="cx">                                 E4697CCD1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "WebUserContentController.h"
</span><span class="cx">
</span><span class="cx"> #include "DataReference.h"
</span><ins>+#include "FrameInfoData.h"
</ins><span class="cx"> #include "InjectedBundleScriptWorld.h"
</span><span class="cx"> #include "WebCompiledContentExtension.h"
</span><span class="cx"> #include "WebFrame.h"
</span><span class="lines">@@ -241,7 +242,7 @@
</span><span class="cx"> if (!webPage)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- WebProcess::singleton().parentProcessConnection()->send(Messages::WebUserContentControllerProxy::DidPostMessage(webPage->pageID(), webFrame->frameID(), SecurityOriginData::fromFrame(frame), m_identifier, IPC::DataReference(value->data())), m_controller->identifier());
</del><ins>+ WebProcess::singleton().parentProcessConnection()->send(Messages::WebUserContentControllerProxy::DidPostMessage(webPage->pageID(), webFrame->info(), m_identifier, IPC::DataReference(value->data())), m_controller->identifier());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<WebUserContentController> m_controller;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "APIArray.h"
</span><span class="cx"> #include "DownloadManager.h"
</span><ins>+#include "FrameInfoData.h"
</ins><span class="cx"> #include "InjectedBundleFileHandle.h"
</span><span class="cx"> #include "InjectedBundleHitTestResult.h"
</span><span class="cx"> #include "InjectedBundleNodeHandle.h"
</span><span class="lines">@@ -194,6 +195,19 @@
</span><span class="cx"> return webFrameLoaderClient->webFrame();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+FrameInfoData WebFrame::info() const
+{
+ FrameInfoData info;
+
+ info.isMainFrame = isMainFrame();
+ // FIXME: This should use the full request.
+ info.request = ResourceRequest(URL(URL(), url()));
+ info.securityOrigin = SecurityOriginData::fromFrame(m_coreFrame);
+ info.frameID = m_frameID;
+
+ return info;
+}
+
</ins><span class="cx"> void WebFrame::invalidate()
</span><span class="cx"> {
</span><span class="cx"> WebProcess::singleton().removeWebFrame(m_frameID);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h (205149 => 205150)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h        2016-08-29 21:51:35 UTC (rev 205149)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h        2016-08-29 22:00:39 UTC (rev 205150)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> class InjectedBundleRangeHandle;
</span><span class="cx"> class InjectedBundleScriptWorld;
</span><span class="cx"> class WebPage;
</span><ins>+struct FrameInfoData;
</ins><span class="cx">
</span><span class="cx"> class WebFrame : public API::ObjectImpl<API::Object::Type::BundleFrame> {
</span><span class="cx"> public:
</span><span class="lines">@@ -77,6 +78,7 @@
</span><span class="cx"> static WebFrame* fromCoreFrame(WebCore::Frame&);
</span><span class="cx"> WebCore::Frame* coreFrame() const { return m_coreFrame; }
</span><span class="cx">
</span><ins>+ FrameInfoData info() const;
</ins><span class="cx"> uint64_t frameID() const { return m_frameID; }
</span><span class="cx">
</span><span class="cx"> uint64_t setUpPolicyListener(WebCore::FramePolicyFunction);
</span></span></pre>
</div>
</div>
</body>
</html>