Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jul 2017 21:26:31 +0000 (21:26 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jul 2017 21:26:31 +0000 (21:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174004

Reviewed by Simon Fraser.

Source/WebCore:

Made FrameLoader and NavigationScheduler UniqueRef in Frame so that we can forward declare them,
and forward declared IntPoint and IntRect to avoid including FrameLoader.h, IntRect.h,
and NavigationScheduler.h in Frame.h

* Modules/mediastream/MediaStream.cpp:
* Modules/webaudio/AudioContext.cpp:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Avoid calling loader().mixedContentChecker().canRunInsecureContent(~)
on a nullptr even though this used to work because we weren't de-referencing it.
* bindings/js/ScriptController.cpp:
* dom/Document.cpp:
* dom/EventDispatcher.cpp:
* editing/Editor.cpp:
* editing/cocoa/EditorCocoa.mm:
* editing/ios/EditorIOS.mm:
* editing/mac/EditorMac.mm:
* history/CachedPage.cpp:
* html/HTMLObjectElement.cpp:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::DocumentLoader::~DocumentLoader): Check !isLoading() before accessing frameLoader to avoid
accessing m_frame->loader() inside ~FrameLoader.
* html/parser/XSSAuditor.cpp:
* html/parser/XSSAuditorDelegate.cpp:
* inspector/InspectorInstrumentation.h:
* loader/CrossOriginPreflightChecker.cpp:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setOpener): Avoid accessing this FrameLoader via m_opener->loader() when it's
this FrameLoader inside ~FrameLoader since UniqueRef<FrameLoader> is clears itself before calling
the destructor of FrameLoader.
* loader/ImageLoader.cpp:
* loader/LinkLoader.cpp:
* loader/SubframeLoader.cpp:
* loader/appcache/ApplicationCacheGroup.cpp:
* loader/appcache/DOMApplicationCache.cpp:
* mathml/MathMLElement.cpp:
* page/DOMWindow.cpp:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::init): Moved here from Frame.h
(WebCore::Frame::setDocument):
* page/Frame.h:
(WebCore::Frame::loader):
(WebCore::Frame::navigationScheduler):
* page/History.cpp:
* page/Location.cpp:
* page/PerformanceLogging.cpp:
* page/PerformanceNavigation.cpp:
* page/UserContentProvider.cpp:
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument):
* plugins/PluginInfoProvider.cpp:
* replay/ReplayInputCreationMethods.cpp:
* replay/UserInputBridge.cpp:
* xml/XSLTProcessorLibxslt.cpp:
* xml/parser/XMLDocumentParserLibxml2.cpp:

Source/WebKit/mac:

* WebCoreSupport/WebPluginInfoProvider.mm:

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::transitionToCommittedForNewPage):

Source/WebKit2:

* WebProcess/Plugins/WebPluginInfoProvider.cpp:
* WebProcess/WebPage/WebInspector.cpp:

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

50 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/cocoa/EditorCocoa.mm
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/history/CachedPage.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/parser/HTMLDocumentParser.cpp
Source/WebCore/html/parser/XSSAuditor.cpp
Source/WebCore/html/parser/XSSAuditorDelegate.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/loader/CrossOriginPreflightChecker.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/LinkLoader.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/appcache/DOMApplicationCache.cpp
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/History.cpp
Source/WebCore/page/Location.cpp
Source/WebCore/page/PerformanceLogging.cpp
Source/WebCore/page/PerformanceNavigation.cpp
Source/WebCore/page/UserContentProvider.cpp
Source/WebCore/page/ios/FrameIOS.mm
Source/WebCore/plugins/PluginInfoProvider.cpp
Source/WebCore/replay/ReplayInputCreationMethods.cpp
Source/WebCore/replay/UserInputBridge.cpp
Source/WebCore/xml/XSLTProcessorLibxslt.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebPluginInfoProvider.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp
Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp
Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp

index b31fb05..24e55fc 100644 (file)
@@ -1,3 +1,66 @@
+2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
+        https://bugs.webkit.org/show_bug.cgi?id=174004
+
+        Reviewed by Simon Fraser.
+
+        Made FrameLoader and NavigationScheduler UniqueRef in Frame so that we can forward declare them,
+        and forward declared IntPoint and IntRect to avoid including FrameLoader.h, IntRect.h,
+        and NavigationScheduler.h in Frame.h
+
+        * Modules/mediastream/MediaStream.cpp:
+        * Modules/webaudio/AudioContext.cpp:
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::connect): Avoid calling loader().mixedContentChecker().canRunInsecureContent(~)
+        on a nullptr even though this used to work because we weren't de-referencing it.
+        * bindings/js/ScriptController.cpp:
+        * dom/Document.cpp:
+        * dom/EventDispatcher.cpp:
+        * editing/Editor.cpp:
+        * editing/cocoa/EditorCocoa.mm:
+        * editing/ios/EditorIOS.mm:
+        * editing/mac/EditorMac.mm:
+        * history/CachedPage.cpp:
+        * html/HTMLObjectElement.cpp:
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::DocumentLoader::~DocumentLoader): Check !isLoading() before accessing frameLoader to avoid
+        accessing m_frame->loader() inside ~FrameLoader.
+        * html/parser/XSSAuditor.cpp:
+        * html/parser/XSSAuditorDelegate.cpp:
+        * inspector/InspectorInstrumentation.h:
+        * loader/CrossOriginPreflightChecker.cpp:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::setOpener): Avoid accessing this FrameLoader via m_opener->loader() when it's
+        this FrameLoader inside ~FrameLoader since UniqueRef<FrameLoader> is clears itself before calling
+        the destructor of FrameLoader.
+        * loader/ImageLoader.cpp:
+        * loader/LinkLoader.cpp:
+        * loader/SubframeLoader.cpp:
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        * loader/appcache/DOMApplicationCache.cpp:
+        * mathml/MathMLElement.cpp:
+        * page/DOMWindow.cpp:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        (WebCore::Frame::init): Moved here from Frame.h
+        (WebCore::Frame::setDocument):
+        * page/Frame.h:
+        (WebCore::Frame::loader):
+        (WebCore::Frame::navigationScheduler):
+        * page/History.cpp:
+        * page/Location.cpp:
+        * page/PerformanceLogging.cpp:
+        * page/PerformanceNavigation.cpp:
+        * page/UserContentProvider.cpp:
+        * page/ios/FrameIOS.mm:
+        (WebCore::Frame::initWithSimpleHTMLDocument):
+        * plugins/PluginInfoProvider.cpp:
+        * replay/ReplayInputCreationMethods.cpp:
+        * replay/UserInputBridge.cpp:
+        * xml/XSLTProcessorLibxslt.cpp:
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+
 2017-07-01  Dan Bernstein  <mitz@apple.com>
 
         [macOS] Remove code only needed when building for OS X Yosemite
index 99534f1..9521e2b 100644 (file)
@@ -34,6 +34,7 @@
 #include "Event.h"
 #include "EventNames.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "Logging.h"
 #include "MediaStreamRegistry.h"
 #include "MediaStreamTrackEvent.h"
index 8de2f23..eb5af94 100644 (file)
@@ -50,6 +50,7 @@
 #include "ExceptionCode.h"
 #include "FFTFrame.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "GainNode.h"
 #include "GenericEventQueue.h"
 #include "HRTFDatabaseLoader.h"
index 629b698..d942841 100644 (file)
@@ -45,6 +45,7 @@
 #include "EventNames.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "Logging.h"
 #include "MessageEvent.h"
 #include "ResourceLoadObserver.h"
@@ -296,7 +297,8 @@ ExceptionOr<void> WebSocket::connect(const String& url, const Vector<String>& pr
 
     if (is<Document>(context)) {
         Document& document = downcast<Document>(context);
-        if (!document.frame()->loader().mixedContentChecker().canRunInsecureContent(document.securityOrigin(), m_url)) {
+        RefPtr<Frame> frame = document.frame();
+        if (!frame || !frame->loader().mixedContentChecker().canRunInsecureContent(document.securityOrigin(), m_url)) {
             // Balanced by the call to ActiveDOMObject::unsetPendingActivity() in WebSocket::stop().
             ActiveDOMObject::setPendingActivity(this);
 
@@ -320,8 +322,8 @@ ExceptionOr<void> WebSocket::connect(const String& url, const Vector<String>& pr
             });
 #endif
             return { };
-        } else
-            ResourceLoadObserver::shared().logWebSocketLoading(document.frame(), m_url);
+        }
+        ResourceLoadObserver::shared().logWebSocketLoading(frame.get(), m_url);
     }
 
     String protocolString;
index 6088f9f..a077a13 100644 (file)
@@ -28,6 +28,7 @@
 #include "DocumentLoader.h"
 #include "Event.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "GCController.h"
 #include "HTMLPlugInElement.h"
index b9c937b..eefbe35 100644 (file)
 #include "NameNodeList.h"
 #include "NamedFlowCollection.h"
 #include "NavigationDisabler.h"
+#include "NavigationScheduler.h"
 #include "NestingLevelIncrementer.h"
 #include "NoEventDispatchAssertion.h"
 #include "NodeIterator.h"
index 0c3facc..d40d162 100644 (file)
@@ -30,6 +30,7 @@
 #include "EventContext.h"
 #include "EventPath.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "FrameView.h"
 #include "HTMLInputElement.h"
 #include "InputEvent.h"
index dc5f6e2..9c9b1d8 100644 (file)
@@ -48,6 +48,7 @@
 #include "EventNames.h"
 #include "FocusController.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
index 682a50d..a59ccc1 100644 (file)
@@ -38,6 +38,7 @@
 #import "EditorClient.h"
 #import "FontCascade.h"
 #import "Frame.h"
+#import "FrameLoader.h"
 #import "FrameSelection.h"
 #import "HTMLConverter.h"
 #import "HTMLImageElement.h"
index 0633601..91e297e 100644 (file)
@@ -39,6 +39,7 @@
 #import "EditorClient.h"
 #import "FontCascade.h"
 #import "Frame.h"
+#import "FrameLoader.h"
 #import "FrameLoaderClient.h"
 #import "HTMLAnchorElement.h"
 #import "HTMLConverter.h"
index bef31d8..4a26300 100644 (file)
@@ -39,6 +39,7 @@
 #import "File.h"
 #import "FontCascade.h"
 #import "Frame.h"
+#import "FrameLoader.h"
 #import "FrameLoaderClient.h"
 #import "FrameView.h"
 #import "HTMLAnchorElement.h"
index 34d8ad0..daebcaf 100644 (file)
@@ -29,6 +29,7 @@
 #include "Document.h"
 #include "Element.h"
 #include "FocusController.h"
+#include "FrameLoader.h"
 #include "FrameView.h"
 #include "HistoryController.h"
 #include "HistoryItem.h"
index a4de4ef..1ada5eb 100644 (file)
@@ -30,6 +30,7 @@
 #include "ElementIterator.h"
 #include "FormDataList.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "HTMLDocument.h"
 #include "HTMLFormElement.h"
 #include "HTMLImageLoader.h"
index dfe0835..d38dd93 100644 (file)
@@ -38,6 +38,7 @@
 #include "HTMLUnknownElement.h"
 #include "JSCustomElementInterface.h"
 #include "LinkLoader.h"
+#include "NavigationScheduler.h"
 #include "ScriptElement.h"
 
 namespace WebCore {
index 8b6dfea..ef45303 100644 (file)
@@ -33,6 +33,7 @@
 #include "DocumentLoader.h"
 #include "FormData.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "HTMLDocumentParser.h"
 #include "HTMLNames.h"
 #include "HTMLParamElement.h"
index 2cbe9bb..127ca2e 100644 (file)
@@ -34,6 +34,7 @@
 #include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "HTMLParserIdioms.h"
+#include "NavigationScheduler.h"
 #include "PingLoader.h"
 #include <inspector/InspectorValues.h>
 #include <wtf/text/StringBuilder.h>
index 9e7cc23..67ae35f 100644 (file)
@@ -77,6 +77,7 @@ class Node;
 class PseudoElement;
 class RenderLayer;
 class RenderObject;
+class ResourceLoader;
 class ResourceRequest;
 class ResourceResponse;
 class SecurityOrigin;
index 75c19c1..6cfd427 100644 (file)
@@ -38,6 +38,7 @@
 #include "CrossOriginAccessControl.h"
 #include "CrossOriginPreflightResultCache.h"
 #include "DocumentThreadableLoader.h"
+#include "FrameLoader.h"
 #include "InspectorInstrumentation.h"
 #include "NetworkLoadMetrics.h"
 #include "RuntimeEnabledFeatures.h"
index 20b5fd4..6a838d0 100644 (file)
@@ -163,7 +163,7 @@ SubresourceLoader* DocumentLoader::mainResourceLoader() const
 
 DocumentLoader::~DocumentLoader()
 {
-    ASSERT(!m_frame || frameLoader()->activeDocumentLoader() != this || !isLoading());
+    ASSERT(!m_frame || !isLoading() || frameLoader()->activeDocumentLoader() != this);
     ASSERT_WITH_MESSAGE(!m_waitingForContentPolicy, "The content policy callback should never outlive its DocumentLoader.");
     ASSERT_WITH_MESSAGE(!m_waitingForNavigationPolicy, "The navigation policy callback should never outlive its DocumentLoader.");
     if (m_iconLoadDecisionCallback)
index 078084f..3d4f303 100644 (file)
@@ -87,6 +87,7 @@
 #include "MemoryCache.h"
 #include "MemoryRelease.h"
 #include "NavigationDisabler.h"
+#include "NavigationScheduler.h"
 #include "Page.h"
 #include "PageCache.h"
 #include "PageTransitionEvent.h"
@@ -988,8 +989,11 @@ void FrameLoader::setOpener(Frame* opener)
     if (m_opener && !opener)
         m_client.didDisownOpener();
 
-    if (m_opener)
-        m_opener->loader().m_openedFrames.remove(&m_frame);
+    if (m_opener) {
+        // When setOpener is called in ~FrameLoader, opener's m_frameLoader is already cleared.
+        auto& openerFrameLoader = m_opener == &m_frame ? *this : m_opener->loader();
+        openerFrameLoader.m_openedFrames.remove(&m_frame);
+    }
     if (opener)
         opener->loader().m_openedFrames.add(&m_frame);
     m_opener = opener;
index 015c0e4..27c0b73 100644 (file)
@@ -32,6 +32,7 @@
 #include "EventNames.h"
 #include "EventSender.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "HTMLParserIdioms.h"
index 36fe97b..7542bb7 100644 (file)
@@ -41,6 +41,7 @@
 #include "CrossOriginAccessControl.h"
 #include "Document.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
 #include "LinkHeader.h"
index 2346252..f004a88 100644 (file)
@@ -46,6 +46,7 @@
 #include "HTMLObjectElement.h"
 #include "MIMETypeRegistry.h"
 #include "MainFrame.h"
+#include "NavigationScheduler.h"
 #include "Page.h"
 #include "PluginData.h"
 #include "PluginDocument.h"
index e32688f..ea5cddb 100644 (file)
@@ -41,6 +41,7 @@
 #include "HTTPHeaderNames.h"
 #include "InspectorInstrumentation.h"
 #include "ManifestParser.h"
+#include "NavigationScheduler.h"
 #include "NetworkLoadMetrics.h"
 #include "Page.h"
 #include "ProgressTracker.h"
index ed8fad8..c542407 100644 (file)
@@ -31,6 +31,7 @@
 #include "DocumentLoader.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 
 namespace WebCore {
 
index 128b415..b401047 100644 (file)
@@ -32,6 +32,7 @@
 #if ENABLE(MATHML)
 
 #include "EventHandler.h"
+#include "FrameLoader.h"
 #include "HTMLAnchorElement.h"
 #include "HTMLParserIdioms.h"
 #include "MathMLNames.h"
index b893445..fc708f7 100644 (file)
@@ -73,6 +73,7 @@
 #include "MediaQueryList.h"
 #include "MediaQueryMatcher.h"
 #include "MessageEvent.h"
+#include "NavigationScheduler.h"
 #include "Navigator.h"
 #include "Page.h"
 #include "PageConsoleClient.h"
index 96ac904..c1324a4 100644 (file)
@@ -71,6 +71,7 @@
 #include "MainFrame.h"
 #include "MathMLNames.h"
 #include "MediaFeatureNames.h"
+#include "NavigationScheduler.h"
 #include "Navigator.h"
 #include "NodeList.h"
 #include "NodeTraversal.h"
@@ -154,8 +155,8 @@ Frame::Frame(Page& page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient&
     , m_page(&page)
     , m_settings(&page.settings())
     , m_treeNode(*this, parentFromOwnerElement(ownerElement))
-    , m_loader(*this, frameLoaderClient)
-    , m_navigationScheduler(*this)
+    , m_loader(makeUniqueRef<FrameLoader>(*this, frameLoaderClient))
+    , m_navigationScheduler(makeUniqueRef<NavigationScheduler>(*this))
     , m_ownerElement(ownerElement)
     , m_script(makeUniqueRef<ScriptController>(*this))
     , m_editor(makeUniqueRef<Editor>(*this))
@@ -197,6 +198,11 @@ Frame::Frame(Page& page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient&
         suspendActiveDOMObjectsAndAnimations();
 }
 
+void Frame::init()
+{
+    m_loader->init();
+}
+
 Ref<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
 {
     ASSERT(page);
@@ -273,7 +279,7 @@ void Frame::setDocument(RefPtr<Document>&& newDocument)
     m_documentIsBeingReplaced = true;
 
     if (isMainFrame())
-        m_loader.client().dispatchDidChangeMainDocument();
+        m_loader->client().dispatchDidChangeMainDocument();
 
     if (m_doc && m_doc->pageCacheState() != Document::InPageCache)
         m_doc->prepareForDestruction();
index 65999c3..a477c60 100644 (file)
 #pragma once
 
 #include "AdjustViewSizeOrNot.h"
-#include "FrameLoader.h"
 #include "FrameTree.h"
-#include "IntRect.h"
-#include "NavigationScheduler.h"
 #include "ScrollTypes.h"
 #include "UserScriptTypes.h"
+#include <wtf/HashSet.h>
 #include <wtf/ThreadSafeRefCounted.h>
 #include <wtf/UniqueRef.h>
 
 #if PLATFORM(IOS)
+#include "Timer.h"
 #include "ViewportArguments.h"
 #include "VisibleSelection.h"
 #endif
@@ -68,21 +67,28 @@ class Element;
 class EventHandler;
 class FloatSize;
 class FrameDestructionObserver;
+class FrameLoader;
+class FrameLoaderClient;
 class FrameSelection;
 class FrameView;
 class HTMLFrameOwnerElement;
 class HTMLTableCellElement;
 class HitTestResult;
 class ImageBuffer;
+class IntPoint;
 class IntRect;
+class IntSize;
 class MainFrame;
+class NavigationScheduler;
 class Node;
+class Page;
 class Range;
 class RenderLayer;
 class RenderView;
 class RenderWidget;
 class ScriptController;
 class Settings;
+class URL;
 class VisiblePosition;
 class Widget;
 
@@ -115,14 +121,14 @@ class Frame : public ThreadSafeRefCounted<Frame> {
 public:
     WEBCORE_EXPORT static Ref<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
 
-    void init();
+    WEBCORE_EXPORT void init();
 #if PLATFORM(IOS)
     // Creates <html><body style="..."></body></html> doing minimal amount of work.
     WEBCORE_EXPORT void initWithSimpleHTMLDocument(const String& style, const URL&);
 #endif
     WEBCORE_EXPORT void setView(RefPtr<FrameView>&&);
-    WEBCORE_EXPORT void createView(const IntSize&, const Color&, bool,
-        const IntSize& fixedLayoutSize = IntSize(), const IntRect& fixedVisibleContentRect = IntRect(),
+    WEBCORE_EXPORT void createView(const IntSize&, const Color& backgroundColor, bool transparent,
+        const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect,
         bool useFixedLayout = false, ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
         ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
 
@@ -286,8 +292,8 @@ private:
     Page* m_page;
     const RefPtr<Settings> m_settings;
     mutable FrameTree m_treeNode;
-    mutable FrameLoader m_loader;
-    mutable NavigationScheduler m_navigationScheduler;
+    mutable UniqueRef<FrameLoader> m_loader;
+    mutable UniqueRef<NavigationScheduler> m_navigationScheduler;
 
     HTMLFrameOwnerElement* m_ownerElement;
     RefPtr<FrameView> m_view;
@@ -332,19 +338,14 @@ protected:
     UniqueRef<EventHandler> m_eventHandler;
 };
 
-inline void Frame::init()
-{
-    m_loader.init();
-}
-
 inline FrameLoader& Frame::loader() const
 {
-    return m_loader;
+    return m_loader.get();
 }
 
 inline NavigationScheduler& Frame::navigationScheduler() const
 {
-    return m_navigationScheduler;
+    return m_navigationScheduler.get();
 }
 
 inline FrameView* Frame::view() const
index f7cf85c..53a1b10 100644 (file)
@@ -36,6 +36,7 @@
 #include "HistoryItem.h"
 #include "Logging.h"
 #include "MainFrame.h"
+#include "NavigationScheduler.h"
 #include "Page.h"
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
index 1ee6fb6..554b99f 100644 (file)
@@ -34,6 +34,7 @@
 #include "ExceptionCode.h"
 #include "Frame.h"
 #include "FrameLoader.h"
+#include "NavigationScheduler.h"
 #include "URL.h"
 #include "SecurityOrigin.h"
 
index 34af678..24f0396 100644 (file)
@@ -29,6 +29,7 @@
 #include "CommonVM.h"
 #include "DOMWindow.h"
 #include "Document.h"
+#include "FrameLoader.h"
 #include "FrameLoaderClient.h"
 #include "JSDOMWindow.h"
 #include "Logging.h"
index 6c60e32..9122901 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "DocumentLoader.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "FrameLoaderTypes.h"
 
 namespace WebCore {
index 2759346..d5524d9 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "FrameLoader.h"
 #include "MainFrame.h"
 #include "Page.h"
 
index 9ce0d38..e9d3659 100644 (file)
@@ -79,7 +79,7 @@ namespace WebCore {
 // Create <html><body (style="...")></body></html> doing minimal amount of work.
 void Frame::initWithSimpleHTMLDocument(const String& style, const URL& url)
 {
-    m_loader.initForSynthesizedDocument(url);
+    m_loader->initForSynthesizedDocument(url);
 
     RefPtr<HTMLDocument> document = HTMLDocument::createSynthesizedDocument(this, url);
     document->setCompatibilityMode(DocumentCompatibilityMode::LimitedQuirksMode);
index 5ac7349..dd13d6f 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "PluginInfoProvider.h"
 
+#include "FrameLoader.h"
 #include "MainFrame.h"
 #include "Page.h"
 #include "SubframeLoader.h"
index f0065c7..8e7526d 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(WEB_REPLAY)
 
 #include "Document.h"
+#include "FrameLoader.h"
 #include "MainFrame.h"
 #include "Page.h"
 #include "SecurityOrigin.h"
index 772efc0..ff7e843 100644 (file)
@@ -32,6 +32,7 @@
 #include "FocusController.h"
 #include "Frame.h"
 #include "FrameLoadRequest.h"
+#include "FrameLoader.h"
 #include "MainFrame.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
index 0de1671..273aa1b 100644 (file)
@@ -29,6 +29,7 @@
 #include "CachedResourceLoader.h"
 #include "Document.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "Page.h"
 #include "PageConsoleClient.h"
 #include "ResourceError.h"
index 5c9b14b..bf827ea 100644 (file)
@@ -35,6 +35,7 @@
 #include "DocumentFragment.h"
 #include "DocumentType.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "HTMLEntityParser.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLTemplateElement.h"
index 04a2192..c46589f 100644 (file)
@@ -1,3 +1,12 @@
+2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
+        https://bugs.webkit.org/show_bug.cgi?id=174004
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/WebPluginInfoProvider.mm:
+
 2017-07-01  Dan Bernstein  <mitz@apple.com>
 
         [macOS] Remove code only needed when building for OS X Yosemite
index 60ff06f..f417413 100644 (file)
@@ -27,6 +27,7 @@
 
 #import "WebPluginDatabase.h"
 #import "WebPluginPackage.h"
+#import <WebCore/FrameLoader.h>
 #import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
 #import <WebCore/SubframeLoader.h>
index 8032cf6..6fa5131 100644 (file)
@@ -1,3 +1,13 @@
+2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
+        https://bugs.webkit.org/show_bug.cgi?id=174004
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::transitionToCommittedForNewPage):
+
 2017-06-30  Daniel Bates  <dabates@apple.com>
 
         API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo
index 6ac9065..6ee6e19 100644 (file)
@@ -989,7 +989,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
     Color backgroundColor = transparent ? Color::transparent : Color::white;
     FloatRect logicalFrame(pixelRect);
     logicalFrame.scale(1.0f / view->deviceScaleFactor());
-    core(m_webFrame)->createView(enclosingIntRect(logicalFrame).size(), backgroundColor, transparent);
+    core(m_webFrame)->createView(enclosingIntRect(logicalFrame).size(), backgroundColor, transparent, /* fixedLayoutSize */ { }, /* fixedVisibleContentRect */ { });
 }
 
 void WebFrameLoaderClient::didSaveToPageCache()
index 27d843e..fe5f9e0 100644 (file)
@@ -1,3 +1,13 @@
+2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
+        https://bugs.webkit.org/show_bug.cgi?id=174004
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
+        * WebProcess/WebPage/WebInspector.cpp:
+
 2017-07-01  Dan Bernstein  <mitz@apple.com>
 
         [macOS] Remove code only needed when building for OS X Yosemite
index e7767d5..afa5ec1 100644 (file)
@@ -45,6 +45,7 @@
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameDestructionObserver.h>
+#include <WebCore/FrameLoader.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/MainFrame.h>
 #include <glib/gi18n-lib.h>
index 78b91f9..6faab47 100644 (file)
@@ -32,6 +32,7 @@
 #include "WebProcessProxyMessages.h"
 #include <WebCore/Document.h>
 #include <WebCore/DocumentLoader.h>
+#include <WebCore/FrameLoader.h>
 #include <WebCore/MainFrame.h>
 #include <WebCore/Page.h>
 #include <WebCore/SecurityOrigin.h>
index acb3625..828d268 100644 (file)
@@ -31,6 +31,7 @@
 #include "SessionTracker.h"
 #include "WebFrame.h"
 #include "WebPage.h"
+#include <WebCore/FrameLoader.h>
 #include <WebCore/NetworkStorageSession.h>
 #include <WebCore/SessionID.h>
 #include <WebCore/Settings.h>
index 226879c..1ae60af 100644 (file)
@@ -35,6 +35,7 @@
 #include <WebCore/Chrome.h>
 #include <WebCore/Document.h>
 #include <WebCore/FrameLoadRequest.h>
+#include <WebCore/FrameLoader.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/InspectorController.h>
 #include <WebCore/InspectorFrontendClient.h>
index 612c1a9..e0fd05d 100644 (file)
@@ -33,6 +33,7 @@
 #include "WebProcess.h"
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/Frame.h>
+#include <WebCore/FrameLoader.h>
 #include <WebCore/IntRect.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/PlatformContextCairo.h>