Title: [260751] trunk/Source
Revision
260751
Author
[email protected]
Date
2020-04-27 05:55:44 -0700 (Mon, 27 Apr 2020)

Log Message

Make loadURLIntoChildFrame private and non-exported
https://bugs.webkit.org/show_bug.cgi?id=211051

Patch by Rob Buis <[email protected]> on 2020-04-27
Reviewed by Darin Adler.

Source/WebCore:

Make loadURLIntoChildFrame private and non-exported to reduce the amount of public API functions
that start loads. In order to do this loadURLIntoChildFrame is being called from SubframeLoader
and SubframeLoader is made an inner class of FrameLoader. Because this simplifies createFrame (and
makes createFrame behave strictly like its name) url and referrer do not have to be passed.

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::createFrame):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/SubframeLoader.cpp:
(WebCore::FrameLoader::SubframeLoader::SubframeLoader):
(WebCore::FrameLoader::SubframeLoader::clear):
(WebCore::FrameLoader::SubframeLoader::requestFrame):
(WebCore::FrameLoader::SubframeLoader::resourceWillUsePlugin):
(WebCore::FrameLoader::SubframeLoader::pluginIsLoadable):
(WebCore::FrameLoader::SubframeLoader::requestPlugin):
(WebCore::FrameLoader::SubframeLoader::requestObject):
(WebCore::FrameLoader::SubframeLoader::createJavaAppletWidget):
(WebCore::FrameLoader::SubframeLoader::loadOrRedirectSubframe):
(WebCore::FrameLoader::SubframeLoader::loadSubframe):
(WebCore::FrameLoader::SubframeLoader::shouldUsePlugin):
(WebCore::FrameLoader::SubframeLoader::loadPlugin):
(WebCore::FrameLoader::SubframeLoader::completeURL const):
(WebCore::FrameLoader::SubframeLoader::shouldConvertInvalidURLsToBlank const):
(WebCore::SubframeLoader::SubframeLoader): Deleted.
(WebCore::SubframeLoader::clear): Deleted.
(WebCore::SubframeLoader::requestFrame): Deleted.
(WebCore::SubframeLoader::resourceWillUsePlugin): Deleted.
(WebCore::SubframeLoader::pluginIsLoadable): Deleted.
(WebCore::SubframeLoader::requestPlugin): Deleted.
(WebCore::SubframeLoader::requestObject): Deleted.
(WebCore::SubframeLoader::createJavaAppletWidget): Deleted.
(WebCore::SubframeLoader::loadOrRedirectSubframe): Deleted.
(WebCore::SubframeLoader::loadSubframe): Deleted.
(WebCore::SubframeLoader::shouldUsePlugin): Deleted.
(WebCore::SubframeLoader::loadPlugin): Deleted.
(WebCore::SubframeLoader::completeURL const): Deleted.
(WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank const): Deleted.
* loader/SubframeLoader.h:
(WebCore::SubframeLoader::containsPlugins const): Deleted.

Source/WebKit:

Adapt createFrame to strictly create a subframe and
not load anything.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createFrame):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

Adapt createFrame to strictly create a subframe and
not load anything.

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createFrame):

Source/WebKitLegacy/win:

Adapt createFrame to strictly create a subframe and
not load anything.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::createFrame):
* WebCoreSupport/WebFrameLoaderClient.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (260750 => 260751)


--- trunk/Source/WebCore/ChangeLog	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/ChangeLog	2020-04-27 12:55:44 UTC (rev 260751)
@@ -1,3 +1,54 @@
+2020-04-27  Rob Buis  <[email protected]>
+
+        Make loadURLIntoChildFrame private and non-exported
+        https://bugs.webkit.org/show_bug.cgi?id=211051
+
+        Reviewed by Darin Adler.
+
+        Make loadURLIntoChildFrame private and non-exported to reduce the amount of public API functions
+        that start loads. In order to do this loadURLIntoChildFrame is being called from SubframeLoader
+        and SubframeLoader is made an inner class of FrameLoader. Because this simplifies createFrame (and
+        makes createFrame behave strictly like its name) url and referrer do not have to be passed.
+
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::parametersForPlugin):
+        * loader/EmptyClients.cpp:
+        (WebCore::EmptyFrameLoaderClient::createFrame):
+        * loader/EmptyFrameLoaderClient.h:
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderClient.h:
+        * loader/SubframeLoader.cpp:
+        (WebCore::FrameLoader::SubframeLoader::SubframeLoader):
+        (WebCore::FrameLoader::SubframeLoader::clear):
+        (WebCore::FrameLoader::SubframeLoader::requestFrame):
+        (WebCore::FrameLoader::SubframeLoader::resourceWillUsePlugin):
+        (WebCore::FrameLoader::SubframeLoader::pluginIsLoadable):
+        (WebCore::FrameLoader::SubframeLoader::requestPlugin):
+        (WebCore::FrameLoader::SubframeLoader::requestObject):
+        (WebCore::FrameLoader::SubframeLoader::createJavaAppletWidget):
+        (WebCore::FrameLoader::SubframeLoader::loadOrRedirectSubframe):
+        (WebCore::FrameLoader::SubframeLoader::loadSubframe):
+        (WebCore::FrameLoader::SubframeLoader::shouldUsePlugin):
+        (WebCore::FrameLoader::SubframeLoader::loadPlugin):
+        (WebCore::FrameLoader::SubframeLoader::completeURL const):
+        (WebCore::FrameLoader::SubframeLoader::shouldConvertInvalidURLsToBlank const):
+        (WebCore::SubframeLoader::SubframeLoader): Deleted.
+        (WebCore::SubframeLoader::clear): Deleted.
+        (WebCore::SubframeLoader::requestFrame): Deleted.
+        (WebCore::SubframeLoader::resourceWillUsePlugin): Deleted.
+        (WebCore::SubframeLoader::pluginIsLoadable): Deleted.
+        (WebCore::SubframeLoader::requestPlugin): Deleted.
+        (WebCore::SubframeLoader::requestObject): Deleted.
+        (WebCore::SubframeLoader::createJavaAppletWidget): Deleted.
+        (WebCore::SubframeLoader::loadOrRedirectSubframe): Deleted.
+        (WebCore::SubframeLoader::loadSubframe): Deleted.
+        (WebCore::SubframeLoader::shouldUsePlugin): Deleted.
+        (WebCore::SubframeLoader::loadPlugin): Deleted.
+        (WebCore::SubframeLoader::completeURL const): Deleted.
+        (WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank const): Deleted.
+        * loader/SubframeLoader.h:
+        (WebCore::SubframeLoader::containsPlugins const): Deleted.
+
 2020-04-27  Alberto Garcia  <[email protected]>
 
         [GTK] [2.28.0] The Yelp build crashes if DISPLAY is not set

Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (260750 => 260751)


--- trunk/Source/WebCore/html/HTMLObjectElement.cpp	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp	2020-04-27 12:55:44 UTC (rev 260751)
@@ -206,7 +206,7 @@
     // if we know that resource points to a plug-in.
 
     if (url.isEmpty() && !urlParameter.isEmpty()) {
-        SubframeLoader& loader = document().frame()->loader().subframeLoader();
+        auto& loader = document().frame()->loader().subframeLoader();
         if (loader.resourceWillUsePlugin(urlParameter, serviceType))
             url = ""
     }

Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (260750 => 260751)


--- trunk/Source/WebCore/loader/EmptyClients.cpp	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp	2020-04-27 12:55:44 UTC (rev 260751)
@@ -521,7 +521,7 @@
     return DocumentLoader::create(request, substituteData);
 }
 
-RefPtr<Frame> EmptyFrameLoaderClient::createFrame(const URL&, const String&, HTMLFrameOwnerElement&, const String&)
+RefPtr<Frame> EmptyFrameLoaderClient::createFrame(const String&, HTMLFrameOwnerElement&)
 {
     return nullptr;
 }

Modified: trunk/Source/WebCore/loader/EmptyFrameLoaderClient.h (260750 => 260751)


--- trunk/Source/WebCore/loader/EmptyFrameLoaderClient.h	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/loader/EmptyFrameLoaderClient.h	2020-04-27 12:55:44 UTC (rev 260751)
@@ -175,7 +175,7 @@
     void didDisplayInsecureContent() final { }
     void didRunInsecureContent(SecurityOrigin&, const URL&) final { }
     void didDetectXSS(const URL&, bool) final { }
-    RefPtr<Frame> createFrame(const URL&, const String&, HTMLFrameOwnerElement&, const String&) final;
+    RefPtr<Frame> createFrame(const String&, HTMLFrameOwnerElement&) final;
     RefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement&, const URL&, const Vector<String>&, const Vector<String>&, const String&, bool) final;
     RefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement&, const URL&, const Vector<String>&, const Vector<String>&) final;
 

Modified: trunk/Source/WebCore/loader/FrameLoader.h (260750 => 260751)


--- trunk/Source/WebCore/loader/FrameLoader.h	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/loader/FrameLoader.h	2020-04-27 12:55:44 UTC (rev 260751)
@@ -84,7 +84,6 @@
 class ResourceResponse;
 class SerializedScriptValue;
 class SharedBuffer;
-class SubframeLoader;
 class SubstituteData;
 
 enum class NewLoadInProgress : bool;
@@ -115,6 +114,8 @@
     PolicyChecker& policyChecker() const { return *m_policyChecker; }
     HistoryController& history() const { return *m_history; }
     ResourceLoadNotifier& notifier() const { return m_notifier; }
+
+    class SubframeLoader;
     SubframeLoader& subframeLoader() const { return *m_subframeLoader; }
     MixedContentChecker& mixedContentChecker() const { return m_mixedContentChecker; }
 
@@ -121,7 +122,6 @@
     void setupForReplace();
 
     // FIXME: These are all functions which start loads. We have too many.
-    WEBCORE_EXPORT void loadURLIntoChildFrame(const URL&, const String& referer, Frame*);
     WEBCORE_EXPORT void loadFrameRequest(FrameLoadRequest&&, Event*, RefPtr<FormState>&&, Optional<AdClickAttribution>&& = WTF::nullopt); // Called by submitForm, calls loadPostRequest and loadURL.
 
     WEBCORE_EXPORT void load(FrameLoadRequest&&);
@@ -425,6 +425,8 @@
     enum class LoadContinuingState : uint8_t { NotContinuing, ContinuingWithRequest, ContinuingWithHistoryItem };
     bool shouldTreatCurrentLoadAsContinuingLoad() const { return m_currentLoadContinuingState != LoadContinuingState::NotContinuing; }
 
+    void loadURLIntoChildFrame(const URL&, const String& referer, Frame*);
+
     Frame& m_frame;
     UniqueRef<FrameLoaderClient> m_client;
 

Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (260750 => 260751)


--- trunk/Source/WebCore/loader/FrameLoaderClient.h	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h	2020-04-27 12:55:44 UTC (rev 260751)
@@ -286,7 +286,7 @@
     virtual bool canCachePage() const = 0;
     virtual void convertMainResourceLoadToDownload(DocumentLoader*, const ResourceRequest&, const ResourceResponse&) = 0;
 
-    virtual RefPtr<Frame> createFrame(const URL&, const String& name, HTMLFrameOwnerElement&, const String& referrer) = 0;
+    virtual RefPtr<Frame> createFrame(const String& name, HTMLFrameOwnerElement&) = 0;
     virtual RefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement&, const URL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0;
     virtual void redirectDataToPlugin(Widget&) = 0;
 

Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (260750 => 260751)


--- trunk/Source/WebCore/loader/SubframeLoader.cpp	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp	2020-04-27 12:55:44 UTC (rev 260751)
@@ -62,18 +62,17 @@
     
 using namespace HTMLNames;
 
-SubframeLoader::SubframeLoader(Frame& frame)
-    : m_containsPlugins(false)
-    , m_frame(frame)
+FrameLoader::SubframeLoader::SubframeLoader(Frame& frame)
+    : m_frame(frame)
 {
 }
 
-void SubframeLoader::clear()
+void FrameLoader::SubframeLoader::clear()
 {
     m_containsPlugins = false;
 }
 
-bool SubframeLoader::requestFrame(HTMLFrameOwnerElement& ownerElement, const String& urlString, const AtomString& frameName, LockHistory lockHistory, LockBackForwardList lockBackForwardList)
+bool FrameLoader::SubframeLoader::requestFrame(HTMLFrameOwnerElement& ownerElement, const String& urlString, const AtomString& frameName, LockHistory lockHistory, LockBackForwardList lockBackForwardList)
 {
     // Support for <frame src=""
     URL scriptURL;
@@ -112,7 +111,7 @@
     return true;
 }
     
-bool SubframeLoader::resourceWillUsePlugin(const String& url, const String& mimeType)
+bool FrameLoader::SubframeLoader::resourceWillUsePlugin(const String& url, const String& mimeType)
 {
     URL completedURL;
     if (!url.isEmpty())
@@ -122,7 +121,7 @@
     return shouldUsePlugin(completedURL, mimeType, false, useFallback);
 }
 
-bool SubframeLoader::pluginIsLoadable(const URL& url, const String& mimeType)
+bool FrameLoader::SubframeLoader::pluginIsLoadable(const URL& url, const String& mimeType)
 {
     auto* document = m_frame.document();
 
@@ -149,7 +148,7 @@
     return true;
 }
 
-bool SubframeLoader::requestPlugin(HTMLPlugInImageElement& ownerElement, const URL& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
+bool FrameLoader::SubframeLoader::requestPlugin(HTMLPlugInImageElement& ownerElement, const URL& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
 {
     // Application plug-ins are plug-ins implemented by the user agent, for example Qt plug-ins,
     // as opposed to third-party code such as Flash. The user agent decides whether or not they are
@@ -218,7 +217,7 @@
     page->sawPlugin(description);
 }
 
-bool SubframeLoader::requestObject(HTMLPlugInImageElement& ownerElement, const String& url, const AtomString& frameName, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
+bool FrameLoader::SubframeLoader::requestObject(HTMLPlugInImageElement& ownerElement, const String& url, const AtomString& frameName, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
 {
     if (url.isEmpty() && mimeType.isEmpty())
         return false;
@@ -246,7 +245,7 @@
     return loadOrRedirectSubframe(ownerElement, completedURL, frameName, LockHistory::Yes, LockBackForwardList::Yes);
 }
 
-RefPtr<Widget> SubframeLoader::createJavaAppletWidget(const IntSize& size, HTMLAppletElement& element, const Vector<String>& paramNames, const Vector<String>& paramValues)
+RefPtr<Widget> FrameLoader::SubframeLoader::createJavaAppletWidget(const IntSize& size, HTMLAppletElement& element, const Vector<String>& paramNames, const Vector<String>& paramValues)
 {
     String baseURLString;
     String codeBaseURLString;
@@ -296,7 +295,7 @@
     return widget;
 }
 
-Frame* SubframeLoader::loadOrRedirectSubframe(HTMLFrameOwnerElement& ownerElement, const URL& requestURL, const AtomString& frameName, LockHistory lockHistory, LockBackForwardList lockBackForwardList)
+Frame* FrameLoader::SubframeLoader::loadOrRedirectSubframe(HTMLFrameOwnerElement& ownerElement, const URL& requestURL, const AtomString& frameName, LockHistory lockHistory, LockBackForwardList lockBackForwardList)
 {
     auto& initiatingDocument = ownerElement.document();
 
@@ -316,7 +315,7 @@
     return ownerElement.contentFrame();
 }
 
-RefPtr<Frame> SubframeLoader::loadSubframe(HTMLFrameOwnerElement& ownerElement, const URL& url, const String& name, const String& referrer)
+RefPtr<Frame> FrameLoader::SubframeLoader::loadSubframe(HTMLFrameOwnerElement& ownerElement, const URL& url, const String& name, const String& referrer)
 {
     Ref<Frame> protect(m_frame);
     auto document = makeRef(ownerElement.document());
@@ -332,19 +331,25 @@
     if (!m_frame.page() || m_frame.page()->subframeCount() >= Page::maxNumberOfFrames)
         return nullptr;
 
+    // Prevent initial empty document load from triggering load events.
+    document->incrementLoadEventDelayCount();
+
+    auto frame = m_frame.loader().client().createFrame(name, ownerElement);
+    if (!frame)  {
+        m_frame.loader().checkCallImplicitClose();
+        return nullptr;
+    }
     ReferrerPolicy policy = ownerElement.referrerPolicy();
     if (policy == ReferrerPolicy::EmptyString)
         policy = document->referrerPolicy();
     String referrerToUse = SecurityPolicy::generateReferrerHeader(policy, url, referrer);
 
-    // Prevent initial empty document load from triggering load events.
-    document->incrementLoadEventDelayCount();
+    m_frame.loader().loadURLIntoChildFrame(url, referrerToUse, frame.get());
 
-    auto frame = m_frame.loader().client().createFrame(url, name, ownerElement, referrerToUse);
-
     document->decrementLoadEventDelayCount();
 
-    if (!frame)  {
+    // The frame's onload handler may have removed it from the document.
+    if (!frame || !frame->tree().parent()) {
         m_frame.loader().checkCallImplicitClose();
         return nullptr;
     }
@@ -382,7 +387,7 @@
     return frame;
 }
 
-bool SubframeLoader::shouldUsePlugin(const URL& url, const String& mimeType, bool hasFallback, bool& useFallback)
+bool FrameLoader::SubframeLoader::shouldUsePlugin(const URL& url, const String& mimeType, bool hasFallback, bool& useFallback)
 {
     if (m_frame.loader().client().shouldAlwaysUsePluginDocument(mimeType)) {
         useFallback = false;
@@ -397,7 +402,7 @@
     return objectType == ObjectContentType::None || objectType == ObjectContentType::PlugIn;
 }
 
-bool SubframeLoader::loadPlugin(HTMLPlugInImageElement& pluginElement, const URL& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
+bool FrameLoader::SubframeLoader::loadPlugin(HTMLPlugInImageElement& pluginElement, const URL& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
 {
     if (useFallback)
         return false;
@@ -440,13 +445,13 @@
     return true;
 }
 
-URL SubframeLoader::completeURL(const String& url) const
+URL FrameLoader::SubframeLoader::completeURL(const String& url) const
 {
     ASSERT(m_frame.document());
     return m_frame.document()->completeURL(url);
 }
 
-bool SubframeLoader::shouldConvertInvalidURLsToBlank() const
+bool FrameLoader::SubframeLoader::shouldConvertInvalidURLsToBlank() const
 {
     return m_frame.settings().shouldConvertInvalidURLsToBlank();
 }

Modified: trunk/Source/WebCore/loader/SubframeLoader.h (260750 => 260751)


--- trunk/Source/WebCore/loader/SubframeLoader.h	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebCore/loader/SubframeLoader.h	2020-04-27 12:55:44 UTC (rev 260751)
@@ -30,7 +30,7 @@
 
 #pragma once
 
-#include "FrameLoaderTypes.h"
+#include "FrameLoader.h"
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/text/WTFString.h>
@@ -48,7 +48,7 @@
 class Widget;
 
 // This is a slight misnomer. It handles the higher level logic of loading both subframes and plugins.
-class SubframeLoader {
+class FrameLoader::SubframeLoader {
     WTF_MAKE_NONCOPYABLE(SubframeLoader); WTF_MAKE_FAST_ALLOCATED;
 public:
     explicit SubframeLoader(Frame&);
@@ -78,7 +78,7 @@
 
     bool shouldConvertInvalidURLsToBlank() const;
 
-    bool m_containsPlugins;
+    bool m_containsPlugins { false };
     Frame& m_frame;
 };
 

Modified: trunk/Source/WebKit/ChangeLog (260750 => 260751)


--- trunk/Source/WebKit/ChangeLog	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKit/ChangeLog	2020-04-27 12:55:44 UTC (rev 260751)
@@ -1,3 +1,17 @@
+2020-04-27  Rob Buis  <[email protected]>
+
+        Make loadURLIntoChildFrame private and non-exported
+        https://bugs.webkit.org/show_bug.cgi?id=211051
+
+        Reviewed by Darin Adler.
+
+        Adapt createFrame to strictly create a subframe and
+        not load anything.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createFrame):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+
 2020-04-27  Ross Kirsling  <[email protected]>
 
         [JSC] CallData/ConstructData should include CallType/ConstructType

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (260750 => 260751)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-04-27 12:55:44 UTC (rev 260751)
@@ -1571,8 +1571,7 @@
     m_frame->convertMainResourceLoadToDownload(documentLoader, request, response);
 }
 
-RefPtr<Frame> WebFrameLoaderClient::createFrame(const URL& url, const String& name, HTMLFrameOwnerElement& ownerElement,
-    const String& referrer)
+RefPtr<Frame> WebFrameLoaderClient::createFrame(const String& name, HTMLFrameOwnerElement& ownerElement)
 {
     auto* webPage = m_frame->page();
 
@@ -1585,15 +1584,6 @@
     if (!coreSubframe->page())
         return nullptr;
 
-    m_frame->coreFrame()->loader().loadURLIntoChildFrame(url, referrer, coreSubframe);
-
-    // The frame's onload handler may have removed it from the document.
-    if (!subframe->coreFrame())
-        return nullptr;
-    ASSERT(subframe->coreFrame() == coreSubframe);
-    if (!coreSubframe->tree().parent())
-        return nullptr;
-
     return coreSubframe;
 }
 

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (260750 => 260751)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h	2020-04-27 12:55:44 UTC (rev 260751)
@@ -214,7 +214,7 @@
     bool canCachePage() const final;
     void convertMainResourceLoadToDownload(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&) final;
 
-    RefPtr<WebCore::Frame> createFrame(const URL&, const String& name, WebCore::HTMLFrameOwnerElement&, const String& referrer) final;
+    RefPtr<WebCore::Frame> createFrame(const String& name, WebCore::HTMLFrameOwnerElement&) final;
 
     RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const URL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) final;
     void redirectDataToPlugin(WebCore::Widget&) final;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (260750 => 260751)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-04-27 12:55:44 UTC (rev 260751)
@@ -1,3 +1,17 @@
+2020-04-27  Rob Buis  <[email protected]>
+
+        Make loadURLIntoChildFrame private and non-exported
+        https://bugs.webkit.org/show_bug.cgi?id=211051
+
+        Reviewed by Darin Adler.
+
+        Adapt createFrame to strictly create a subframe and
+        not load anything.
+
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::createFrame):
+
 2020-04-27  Ross Kirsling  <[email protected]>
 
         [JSC] CallData/ConstructData should include CallType/ConstructType

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h (260750 => 260751)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h	2020-04-27 12:55:44 UTC (rev 260751)
@@ -205,8 +205,7 @@
 
     void setTitle(const WebCore::StringWithDirection&, const URL&) final;
 
-    RefPtr<WebCore::Frame> createFrame(const URL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement&,
-        const WTF::String& referrer) final;
+    RefPtr<WebCore::Frame> createFrame(const WTF::String& name, WebCore::HTMLFrameOwnerElement&) final;
     RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const URL&,
     const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool) final;
     void redirectDataToPlugin(WebCore::Widget&) final;

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (260750 => 260751)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm	2020-04-27 12:55:44 UTC (rev 260751)
@@ -1618,8 +1618,7 @@
     return true;
 }
 
-RefPtr<WebCore::Frame> WebFrameLoaderClient::createFrame(const URL& url, const String& name, WebCore::HTMLFrameOwnerElement& ownerElement,
-    const String& referrer)
+RefPtr<WebCore::Frame> WebFrameLoaderClient::createFrame(const String& name, WebCore::HTMLFrameOwnerElement& ownerElement)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
@@ -1639,12 +1638,6 @@
     if (!result->page())
         return nullptr;
  
-    core(m_webFrame.get())->loader().loadURLIntoChildFrame(url, referrer, result.get());
-
-    // The frame's onload handler may have removed it from the document.
-    if (!result->tree().parent())
-        return nullptr;
-
     return result;
 
     END_BLOCK_OBJC_EXCEPTIONS;

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (260750 => 260751)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2020-04-27 12:55:44 UTC (rev 260751)
@@ -1,3 +1,17 @@
+2020-04-27  Rob Buis  <[email protected]>
+
+        Make loadURLIntoChildFrame private and non-exported
+        https://bugs.webkit.org/show_bug.cgi?id=211051
+
+        Reviewed by Darin Adler.
+
+        Adapt createFrame to strictly create a subframe and
+        not load anything.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::createFrame):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
 2020-04-27  Ross Kirsling  <[email protected]>
 
         [JSC] CallData/ConstructData should include CallType/ConstructType

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp (260750 => 260751)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp	2020-04-27 12:55:44 UTC (rev 260751)
@@ -985,8 +985,7 @@
     return true;
 }
 
-RefPtr<Frame> WebFrameLoaderClient::createFrame(const URL& url, const String& name, HTMLFrameOwnerElement& ownerElement,
-    const String& referrer)
+RefPtr<Frame> WebFrameLoaderClient::createFrame(const String& name, HTMLFrameOwnerElement& ownerElement)
 {
     Frame* coreFrame = core(m_webFrame);
     ASSERT(coreFrame);
@@ -999,12 +998,6 @@
     coreFrame->tree().appendChild(*childFrame);
     childFrame->init();
 
-    coreFrame->loader().loadURLIntoChildFrame(url, referrer, childFrame.get());
-
-    // The frame's onload handler may have removed it from the document.
-    if (!childFrame->tree().parent())
-        return nullptr;
-
     return childFrame;
 }
 

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h (260750 => 260751)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h	2020-04-27 11:52:10 UTC (rev 260750)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h	2020-04-27 12:55:44 UTC (rev 260751)
@@ -177,8 +177,7 @@
 
     bool canCachePage() const override;
 
-    RefPtr<WebCore::Frame> createFrame(const URL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement&,
-        const WTF::String& referrer) override;
+    RefPtr<WebCore::Frame> createFrame(const WTF::String& name, WebCore::HTMLFrameOwnerElement&) override;
     RefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement&, const URL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually) override;
     void redirectDataToPlugin(WebCore::Widget&) override;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to