Diff
Modified: trunk/Source/WebKit/ChangeLog (242835 => 242836)
--- trunk/Source/WebKit/ChangeLog 2019-03-13 00:15:52 UTC (rev 242835)
+++ trunk/Source/WebKit/ChangeLog 2019-03-13 00:36:02 UTC (rev 242836)
@@ -1,3 +1,22 @@
+2019-03-12 Jiewen Tan <[email protected]>
+
+ Add WebFrameProxy::loadData
+ https://bugs.webkit.org/show_bug.cgi?id=195647
+ <rdar://problem/48826856>
+
+ Reviewed by Youenn Fablet.
+
+ This patch adds WebFrameProxy::loadData which is a simplified version of WebPageProxy::loadData that
+ loads substitute data to an iframe. This is needed by the Load Optimizer.
+
+ * UIProcess/WebFrameProxy.cpp:
+ (WebKit::WebFrameProxy::loadData):
+ * UIProcess/WebFrameProxy.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::loadDataInFrame):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
2019-03-12 Wenson Hsieh <[email protected]>
[iOS] Input view sometimes flickers when blurring and refocusing an element
Modified: trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp (242835 => 242836)
--- trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp 2019-03-13 00:15:52 UTC (rev 242835)
+++ trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp 2019-03-13 00:36:02 UTC (rev 242836)
@@ -86,6 +86,14 @@
m_page->process().send(Messages::WebPage::LoadURLInFrame(url, m_frameID), m_page->pageID());
}
+void WebFrameProxy::loadData(const IPC::DataReference& data, const String& MIMEType, const String& encodingName, const URL& baseURL)
+{
+ if (!m_page)
+ return;
+
+ m_page->process().send(Messages::WebPage::LoadDataInFrame(data, MIMEType, encodingName, baseURL, m_frameID), m_page->pageID());
+}
+
void WebFrameProxy::stopLoading() const
{
if (!m_page)
Modified: trunk/Source/WebKit/UIProcess/WebFrameProxy.h (242835 => 242836)
--- trunk/Source/WebKit/UIProcess/WebFrameProxy.h 2019-03-13 00:15:52 UTC (rev 242835)
+++ trunk/Source/WebKit/UIProcess/WebFrameProxy.h 2019-03-13 00:36:02 UTC (rev 242836)
@@ -81,6 +81,7 @@
FrameLoadState& frameLoadState() { return m_frameLoadState; }
void loadURL(const URL&);
+ void loadData(const IPC::DataReference&, const String& MIMEType, const String& encodingName, const URL& baseURL);
void stopLoading() const;
const URL& url() const { return m_frameLoadState.url(); }
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (242835 => 242836)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-03-13 00:15:52 UTC (rev 242835)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-03-13 00:36:02 UTC (rev 242836)
@@ -1390,6 +1390,18 @@
frame->coreFrame()->loader().load(FrameLoadRequest(*frame->coreFrame(), ResourceRequest(url), ShouldOpenExternalURLsPolicy::ShouldNotAllow));
}
+void WebPage::loadDataInFrame(IPC::DataReference&& data, String&& MIMEType, String&& encodingName, URL&& baseURL, uint64_t frameID)
+{
+ WebFrame* frame = WebProcess::singleton().webFrame(frameID);
+ if (!frame)
+ return;
+
+ auto sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(data.data()), data.size());
+ ResourceResponse response(baseURL, MIMEType, sharedBuffer->size(), encodingName);
+ SubstituteData substituteData(WTFMove(sharedBuffer), baseURL, WTFMove(response), SubstituteData::SessionHistoryVisibility::Hidden);
+ frame->coreFrame()->loader().load(FrameLoadRequest(*frame->coreFrame(), ResourceRequest(baseURL), ShouldOpenExternalURLsPolicy::ShouldNotAllow, WTFMove(substituteData)));
+}
+
#if !PLATFORM(COCOA)
void WebPage::platformDidReceiveLoadParameters(const LoadParameters& loadParameters)
{
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (242835 => 242836)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-03-13 00:15:52 UTC (rev 242835)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-03-13 00:36:02 UTC (rev 242836)
@@ -1289,6 +1289,7 @@
static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
void loadURLInFrame(URL&&, uint64_t frameID);
+ void loadDataInFrame(IPC::DataReference&&, String&& MIMEType, String&& encodingName, URL&& baseURL, uint64_t frameID);
enum class WasRestoredByAPIRequest { No, Yes };
void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest, WebBackForwardListProxy::OverwriteExistingItem);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (242835 => 242836)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2019-03-13 00:15:52 UTC (rev 242835)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2019-03-13 00:36:02 UTC (rev 242836)
@@ -155,6 +155,7 @@
TryRestoreScrollPosition()
LoadURLInFrame(URL url, uint64_t frameID)
+ LoadDataInFrame(IPC::DataReference data, String MIMEType, String encodingName, URL baseURL, uint64_t frameID)
LoadRequest(struct WebKit::LoadParameters loadParameters)
LoadData(struct WebKit::LoadParameters loadParameters)
LoadAlternateHTML(struct WebKit::LoadParameters loadParameters)