Diff
Modified: trunk/Source/WebKit2/ChangeLog (205149 => 205150)
--- 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)
@@ -1,5 +1,36 @@
2016-08-29 Anders Carlsson <ander...@apple.com>
+ 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 <ander...@apple.com>
+
Stop using WebProcessProxy::fromConnection in WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=161322
Copied: trunk/Source/WebKit2/Shared/FrameInfoData.cpp (from rev 205137, trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.cpp) (0 => 205150)
--- trunk/Source/WebKit2/Shared/FrameInfoData.cpp (rev 0)
+++ trunk/Source/WebKit2/Shared/FrameInfoData.cpp 2016-08-29 22:00:39 UTC (rev 205150)
@@ -0,0 +1,55 @@
+/*
+ * 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;
+}
+
+}
Copied: trunk/Source/WebKit2/Shared/FrameInfoData.h (from rev 205137, trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.messages.in) (0 => 205150)
--- trunk/Source/WebKit2/Shared/FrameInfoData.h (rev 0)
+++ trunk/Source/WebKit2/Shared/FrameInfoData.h 2016-08-29 22:00:39 UTC (rev 205150)
@@ -0,0 +1,48 @@
+/*
+ * 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 };
+};
+
+}
Modified: trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.cpp (205149 => 205150)
--- 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)
@@ -27,19 +27,37 @@
#include "APIFrameInfo.h"
#include "APIFrameHandle.h"
+#include "FrameInfoData.h"
#include "WebFrameProxy.h"
namespace API {
-// 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()))
+Ref<FrameInfo> FrameInfo::create(const WebKit::FrameInfoData& frameInfoData)
{
+ return adoptRef(*new FrameInfo(frameInfoData));
}
+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))
+{
+}
+
FrameInfo::~FrameInfo()
{
}
Modified: trunk/Source/WebKit2/UIProcess/API/APIFrameInfo.h (205149 => 205150)
--- 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)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef APIFrameInfo_h
-#define APIFrameInfo_h
+#pragma once
#include "APIObject.h"
#include <WebCore/ResourceRequest.h>
@@ -35,6 +34,7 @@
namespace WebKit {
class WebFrameProxy;
+struct FrameInfoData;
}
namespace API {
@@ -44,14 +44,10 @@
class FrameInfo final : public ObjectImpl<Object::Type::FrameInfo> {
public:
- static Ref<FrameInfo> create(const WebKit::WebFrameProxy& frame, const WebCore::SecurityOrigin& securityOrigin)
- {
- return adoptRef(*new FrameInfo(frame, securityOrigin));
- }
+ static Ref<FrameInfo> create(const WebKit::FrameInfoData&);
+ static Ref<FrameInfo> create(const WebKit::WebFrameProxy&, const WebCore::SecurityOrigin&);
virtual ~FrameInfo();
- FrameInfo(const WebKit::WebFrameProxy&, const WebCore::SecurityOrigin&);
-
bool isMainFrame() const { return m_isMainFrame; }
const WebCore::ResourceRequest& request() const { return m_request; }
SecurityOrigin& securityOrigin() { return m_securityOrigin.get(); }
@@ -58,6 +54,8 @@
API::FrameHandle& handle() { return m_handle.get(); }
private:
+ FrameInfo(const WebKit::FrameInfoData&);
+
bool m_isMainFrame;
WebCore::ResourceRequest m_request;
Ref<SecurityOrigin> m_securityOrigin;
@@ -65,5 +63,3 @@
};
} // namespace API
-
-#endif // APIFrameInfo_h
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm (205149 => 205150)
--- 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)
@@ -100,10 +100,10 @@
{
}
- virtual void didPostMessage(WebKit::WebPageProxy& page, WebKit::WebFrameProxy& frame, const WebCore::SecurityOriginData& securityOriginData, WebCore::SerializedScriptValue& serializedScriptValue)
+ void didPostMessage(WebKit::WebPageProxy& page, const WebKit::FrameInfoData& frameInfoData, WebCore::SerializedScriptValue& serializedScriptValue) override
{
@autoreleasepool {
- RetainPtr<WKFrameInfo> frameInfo = wrapper(API::FrameInfo::create(frame, securityOriginData.securityOrigin()));
+ RetainPtr<WKFrameInfo> frameInfo = wrapper(API::FrameInfo::create(frameInfoData));
id body = API::SerializedScriptValue::deserialize(serializedScriptValue, 0);
auto message = adoptNS([[WKScriptMessage alloc] _initWithBody:body webView:fromWebPageProxy(page) frameInfo:frameInfo.get() name:m_name.get()]);
Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebScriptMessageHandler.h (205149 => 205150)
--- 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)
@@ -44,6 +44,7 @@
class WebPageProxy;
class WebFrameProxy;
+struct FrameInfoData;
class WebScriptMessageHandler : public RefCounted<WebScriptMessageHandler> {
public:
@@ -50,7 +51,7 @@
class Client {
public:
virtual ~Client() { }
- virtual void didPostMessage(WebPageProxy&, WebFrameProxy&, const WebCore::SecurityOriginData&, WebCore::SerializedScriptValue&) = 0;
+ virtual void didPostMessage(WebPageProxy&, const FrameInfoData&, WebCore::SerializedScriptValue&) = 0;
};
static Ref<WebScriptMessageHandler> create(std::unique_ptr<Client>, const String& name, API::UserContentWorld&);
Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp (205149 => 205150)
--- 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)
@@ -321,17 +321,12 @@
removeUserContentWorldUses(world, numberRemoved);
}
-void WebUserContentControllerProxy::didPostMessage(IPC::Connection& connection, uint64_t pageID, uint64_t frameID, const WebCore::SecurityOriginData& securityOrigin, uint64_t messageHandlerID, const IPC::DataReference& dataReference)
+void WebUserContentControllerProxy::didPostMessage(IPC::Connection& connection, uint64_t pageID, const FrameInfoData& frameInfoData, uint64_t messageHandlerID, const IPC::DataReference& dataReference)
{
WebPageProxy* page = WebProcessProxy::webPage(pageID);
if (!page)
return;
- WebProcessProxy* webProcess = WebProcessProxy::fromConnection(&connection);
- WebFrameProxy* frame = webProcess->webFrame(frameID);
- if (!frame)
- return;
-
if (!HashMap<uint64_t, RefPtr<WebScriptMessageHandler>>::isValidKey(messageHandlerID))
return;
@@ -339,7 +334,7 @@
if (!handler)
return;
- handler->client().didPostMessage(*page, *frame, securityOrigin, WebCore::SerializedScriptValue::adopt(dataReference.vector()));
+ handler->client().didPostMessage(*page, frameInfoData, WebCore::SerializedScriptValue::adopt(dataReference.vector()));
}
#if ENABLE(CONTENT_EXTENSIONS)
Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h (205149 => 205150)
--- 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)
@@ -56,6 +56,7 @@
class WebProcessProxy;
class WebScriptMessageHandler;
+struct FrameInfoData;
class WebUserContentControllerProxy : public API::ObjectImpl<API::Object::Type::UserContentController>, private IPC::MessageReceiver {
public:
@@ -100,7 +101,7 @@
// IPC::MessageReceiver.
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
- void didPostMessage(IPC::Connection&, uint64_t pageID, uint64_t frameID, const WebCore::SecurityOriginData&, uint64_t messageHandlerID, const IPC::DataReference&);
+ void didPostMessage(IPC::Connection&, uint64_t pageID, const FrameInfoData&, uint64_t messageHandlerID, const IPC::DataReference&);
void addUserContentWorldUse(API::UserContentWorld&);
void removeUserContentWorldUses(API::UserContentWorld&, unsigned numberOfUsesToRemove);
Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.messages.in (205149 => 205150)
--- 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)
@@ -24,5 +24,5 @@
*/
messages -> WebUserContentControllerProxy {
- DidPostMessage(uint64_t pageID, uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t messageHandlerID, IPC::DataReference message) WantsConnection
+DidPostMessage(uint64_t pageID, struct WebKit::FrameInfoData frameInfoData, uint64_t messageHandlerID, IPC::DataReference message) WantsConnection
}
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (205149 => 205150)
--- 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)
@@ -150,6 +150,8 @@
1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */; };
1A0F29E3120B44420053D1B9 /* VisitedLinkStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F29E1120B44420053D1B9 /* VisitedLinkStore.cpp */; };
1A0F29E4120B44420053D1B9 /* VisitedLinkStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0F29E2120B44420053D1B9 /* VisitedLinkStore.h */; };
+ 1A14F8E11D74C834006CBEC6 /* FrameInfoData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A14F8DF1D74C834006CBEC6 /* FrameInfoData.cpp */; };
+ 1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A14F8E01D74C834006CBEC6 /* FrameInfoData.h */; };
1A158419189044F50017616C /* WKProcessPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A158417189044F50017616C /* WKProcessPool.mm */; };
1A15841A189044F50017616C /* WKProcessPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A158418189044F50017616C /* WKProcessPool.h */; settings = {ATTRIBUTES = (Public, ); }; };
1A17977F137EE82C00F97D45 /* PluginCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A17977D137EE82C00F97D45 /* PluginCreationParameters.cpp */; };
@@ -2114,6 +2116,8 @@
1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkTable.h; sourceTree = "<group>"; };
1A0F29E1120B44420053D1B9 /* VisitedLinkStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkStore.cpp; sourceTree = "<group>"; };
1A0F29E2120B44420053D1B9 /* VisitedLinkStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkStore.h; sourceTree = "<group>"; };
+ 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>"; };
1A158417189044F50017616C /* WKProcessPool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKProcessPool.mm; sourceTree = "<group>"; };
1A158418189044F50017616C /* WKProcessPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessPool.h; sourceTree = "<group>"; };
1A17635416B1D5D000D88FD6 /* StorageNamespaceImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceImpl.cpp; sourceTree = "<group>"; };
@@ -4512,6 +4516,8 @@
BCE81D8A1319F7EF00241910 /* FontInfo.cpp */,
BCE81D8B1319F7EF00241910 /* FontInfo.h */,
762B7481120BBA0100819339 /* FontSmoothingLevel.h */,
+ 1A14F8DF1D74C834006CBEC6 /* FrameInfoData.cpp */,
+ 1A14F8E01D74C834006CBEC6 /* FrameInfoData.h */,
1AC75A1A1B3368270056745B /* HangDetectionDisabler.h */,
F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */,
BCCF6B2312C93E7A008F9C35 /* ImageOptions.h */,
@@ -8158,6 +8164,7 @@
371A19421824D29300F32A5E /* WKNSDictionary.h in Headers */,
372CAF0B1833FD910040AC27 /* WKNSError.h in Headers */,
378E1A4A18208CD60031007A /* WKNSString.h in Headers */,
+ 1A14F8E21D74C834006CBEC6 /* FrameInfoData.h in Headers */,
378E1A4E18208D700031007A /* WKNSURL.h in Headers */,
37FC194B18510D6A008CFA47 /* WKNSURLAuthenticationChallenge.h in Headers */,
37183D57182F4E700080C811 /* WKNSURLExtras.h in Headers */,
@@ -9103,6 +9110,7 @@
E47D1E981B0649FB002676A8 /* NetworkCacheData.cpp in Sources */,
E42E06141AA75B7000B11699 /* NetworkCacheDataCocoa.mm in Sources */,
E489D28D1A0A2DB80078C06A /* NetworkCacheDecoder.cpp in Sources */,
+ 1A14F8E11D74C834006CBEC6 /* FrameInfoData.cpp in Sources */,
E489D28F1A0A2DB80078C06A /* NetworkCacheEncoder.cpp in Sources */,
E413F59F1AC1AF9D00345360 /* NetworkCacheEntry.cpp in Sources */,
E4697CCD1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp in Sources */,
Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp (205149 => 205150)
--- 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)
@@ -27,6 +27,7 @@
#include "WebUserContentController.h"
#include "DataReference.h"
+#include "FrameInfoData.h"
#include "InjectedBundleScriptWorld.h"
#include "WebCompiledContentExtension.h"
#include "WebFrame.h"
@@ -241,7 +242,7 @@
if (!webPage)
return;
- WebProcess::singleton().parentProcessConnection()->send(Messages::WebUserContentControllerProxy::DidPostMessage(webPage->pageID(), webFrame->frameID(), SecurityOriginData::fromFrame(frame), m_identifier, IPC::DataReference(value->data())), m_controller->identifier());
+ WebProcess::singleton().parentProcessConnection()->send(Messages::WebUserContentControllerProxy::DidPostMessage(webPage->pageID(), webFrame->info(), m_identifier, IPC::DataReference(value->data())), m_controller->identifier());
}
RefPtr<WebUserContentController> m_controller;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (205149 => 205150)
--- 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)
@@ -28,6 +28,7 @@
#include "APIArray.h"
#include "DownloadManager.h"
+#include "FrameInfoData.h"
#include "InjectedBundleFileHandle.h"
#include "InjectedBundleHitTestResult.h"
#include "InjectedBundleNodeHandle.h"
@@ -194,6 +195,19 @@
return webFrameLoaderClient->webFrame();
}
+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;
+}
+
void WebFrame::invalidate()
{
WebProcess::singleton().removeWebFrame(m_frameID);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h (205149 => 205150)
--- 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)
@@ -62,6 +62,7 @@
class InjectedBundleRangeHandle;
class InjectedBundleScriptWorld;
class WebPage;
+struct FrameInfoData;
class WebFrame : public API::ObjectImpl<API::Object::Type::BundleFrame> {
public:
@@ -77,6 +78,7 @@
static WebFrame* fromCoreFrame(WebCore::Frame&);
WebCore::Frame* coreFrame() const { return m_coreFrame; }
+ FrameInfoData info() const;
uint64_t frameID() const { return m_frameID; }
uint64_t setUpPolicyListener(WebCore::FramePolicyFunction);