Title: [219051] trunk/Source
Revision
219051
Author
rn...@webkit.org
Date
2017-07-01 14:26:31 -0700 (Sat, 01 Jul 2017)

Log Message

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.

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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219050 => 219051)


--- trunk/Source/WebCore/ChangeLog	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/ChangeLog	2017-07-01 21:26:31 UTC (rev 219051)
@@ -1,3 +1,66 @@
+2017-07-01  Ryosuke Niwa  <rn...@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  <m...@apple.com>
 
         [macOS] Remove code only needed when building for OS X Yosemite

Modified: trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp (219050 => 219051)


--- trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (219050 => 219051)


--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (219050 => 219051)


--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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 @@
 
     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 @@
             });
 #endif
             return { };
-        } else
-            ResourceLoadObserver::shared().logWebSocketLoading(document.frame(), m_url);
+        }
+        ResourceLoadObserver::shared().logWebSocketLoading(frame.get(), m_url);
     }
 
     String protocolString;

Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (219050 => 219051)


--- trunk/Source/WebCore/bindings/js/ScriptController.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/dom/Document.cpp (219050 => 219051)


--- trunk/Source/WebCore/dom/Document.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -121,6 +121,7 @@
 #include "NameNodeList.h"
 #include "NamedFlowCollection.h"
 #include "NavigationDisabler.h"
+#include "NavigationScheduler.h"
 #include "NestingLevelIncrementer.h"
 #include "NoEventDispatchAssertion.h"
 #include "NodeIterator.h"

Modified: trunk/Source/WebCore/dom/EventDispatcher.cpp (219050 => 219051)


--- trunk/Source/WebCore/dom/EventDispatcher.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/dom/EventDispatcher.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/editing/Editor.cpp (219050 => 219051)


--- trunk/Source/WebCore/editing/Editor.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/editing/Editor.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm (219050 => 219051)


--- trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/editing/ios/EditorIOS.mm (219050 => 219051)


--- trunk/Source/WebCore/editing/ios/EditorIOS.mm	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/editing/ios/EditorIOS.mm	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (219050 => 219051)


--- trunk/Source/WebCore/editing/mac/EditorMac.mm	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/history/CachedPage.cpp (219050 => 219051)


--- trunk/Source/WebCore/history/CachedPage.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/history/CachedPage.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (219050 => 219051)


--- trunk/Source/WebCore/html/HTMLObjectElement.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp (219050 => 219051)


--- trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -38,6 +38,7 @@
 #include "HTMLUnknownElement.h"
 #include "JSCustomElementInterface.h"
 #include "LinkLoader.h"
+#include "NavigationScheduler.h"
 #include "ScriptElement.h"
 
 namespace WebCore {

Modified: trunk/Source/WebCore/html/parser/XSSAuditor.cpp (219050 => 219051)


--- trunk/Source/WebCore/html/parser/XSSAuditor.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/html/parser/XSSAuditor.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp (219050 => 219051)


--- trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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>

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (219050 => 219051)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-07-01 21:26:31 UTC (rev 219051)
@@ -77,6 +77,7 @@
 class PseudoElement;
 class RenderLayer;
 class RenderObject;
+class ResourceLoader;
 class ResourceRequest;
 class ResourceResponse;
 class SecurityOrigin;

Modified: trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -163,7 +163,7 @@
 
 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)

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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 @@
     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;

Modified: trunk/Source/WebCore/loader/ImageLoader.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/ImageLoader.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/ImageLoader.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/loader/LinkLoader.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/LinkLoader.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/LinkLoader.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/SubframeLoader.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/loader/appcache/DOMApplicationCache.cpp (219050 => 219051)


--- trunk/Source/WebCore/loader/appcache/DOMApplicationCache.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/loader/appcache/DOMApplicationCache.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -31,6 +31,7 @@
 #include "DocumentLoader.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (219050 => 219051)


--- trunk/Source/WebCore/mathml/MathMLElement.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -32,6 +32,7 @@
 #if ENABLE(MATHML)
 
 #include "EventHandler.h"
+#include "FrameLoader.h"
 #include "HTMLAnchorElement.h"
 #include "HTMLParserIdioms.h"
 #include "MathMLNames.h"

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (219050 => 219051)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/page/Frame.cpp (219050 => 219051)


--- trunk/Source/WebCore/page/Frame.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/Frame.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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 @@
     , 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 @@
         suspendActiveDOMObjectsAndAnimations();
 }
 
+void Frame::init()
+{
+    m_loader->init();
+}
+
 Ref<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
 {
     ASSERT(page);
@@ -273,7 +279,7 @@
     m_documentIsBeingReplaced = true;
 
     if (isMainFrame())
-        m_loader.client().dispatchDidChangeMainDocument();
+        m_loader->client().dispatchDidChangeMainDocument();
 
     if (m_doc && m_doc->pageCacheState() != Document::InPageCache)
         m_doc->prepareForDestruction();

Modified: trunk/Source/WebCore/page/Frame.h (219050 => 219051)


--- trunk/Source/WebCore/page/Frame.h	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/Frame.h	2017-07-01 21:26:31 UTC (rev 219051)
@@ -28,16 +28,15 @@
 #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,6 +67,8 @@
 class EventHandler;
 class FloatSize;
 class FrameDestructionObserver;
+class FrameLoader;
+class FrameLoaderClient;
 class FrameSelection;
 class FrameView;
 class HTMLFrameOwnerElement;
@@ -74,9 +75,13 @@
 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;
@@ -83,6 +88,7 @@
 class RenderWidget;
 class ScriptController;
 class Settings;
+class URL;
 class VisiblePosition;
 class Widget;
 
@@ -115,14 +121,14 @@
 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 @@
     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 @@
     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

Modified: trunk/Source/WebCore/page/History.cpp (219050 => 219051)


--- trunk/Source/WebCore/page/History.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/History.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/page/Location.cpp (219050 => 219051)


--- trunk/Source/WebCore/page/Location.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/Location.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -34,6 +34,7 @@
 #include "ExceptionCode.h"
 #include "Frame.h"
 #include "FrameLoader.h"
+#include "NavigationScheduler.h"
 #include "URL.h"
 #include "SecurityOrigin.h"
 

Modified: trunk/Source/WebCore/page/PerformanceLogging.cpp (219050 => 219051)


--- trunk/Source/WebCore/page/PerformanceLogging.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/PerformanceLogging.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/page/PerformanceNavigation.cpp (219050 => 219051)


--- trunk/Source/WebCore/page/PerformanceNavigation.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/PerformanceNavigation.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -35,6 +35,7 @@
 
 #include "DocumentLoader.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "FrameLoaderTypes.h"
 
 namespace WebCore {

Modified: trunk/Source/WebCore/page/UserContentProvider.cpp (219050 => 219051)


--- trunk/Source/WebCore/page/UserContentProvider.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/UserContentProvider.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -28,6 +28,7 @@
 
 #include "Document.h"
 #include "DocumentLoader.h"
+#include "FrameLoader.h"
 #include "MainFrame.h"
 #include "Page.h"
 

Modified: trunk/Source/WebCore/page/ios/FrameIOS.mm (219050 => 219051)


--- trunk/Source/WebCore/page/ios/FrameIOS.mm	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/page/ios/FrameIOS.mm	2017-07-01 21:26:31 UTC (rev 219051)
@@ -79,7 +79,7 @@
 // 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);

Modified: trunk/Source/WebCore/plugins/PluginInfoProvider.cpp (219050 => 219051)


--- trunk/Source/WebCore/plugins/PluginInfoProvider.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/plugins/PluginInfoProvider.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "PluginInfoProvider.h"
 
+#include "FrameLoader.h"
 #include "MainFrame.h"
 #include "Page.h"
 #include "SubframeLoader.h"

Modified: trunk/Source/WebCore/replay/ReplayInputCreationMethods.cpp (219050 => 219051)


--- trunk/Source/WebCore/replay/ReplayInputCreationMethods.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/replay/ReplayInputCreationMethods.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -29,6 +29,7 @@
 #if ENABLE(WEB_REPLAY)
 
 #include "Document.h"
+#include "FrameLoader.h"
 #include "MainFrame.h"
 #include "Page.h"
 #include "SecurityOrigin.h"

Modified: trunk/Source/WebCore/replay/UserInputBridge.cpp (219050 => 219051)


--- trunk/Source/WebCore/replay/UserInputBridge.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/replay/UserInputBridge.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp (219050 => 219051)


--- trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (219050 => 219051)


--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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"

Modified: trunk/Source/WebKit/mac/ChangeLog (219050 => 219051)


--- trunk/Source/WebKit/mac/ChangeLog	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-07-01 21:26:31 UTC (rev 219051)
@@ -1,3 +1,12 @@
+2017-07-01  Ryosuke Niwa  <rn...@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  <m...@apple.com>
 
         [macOS] Remove code only needed when building for OS X Yosemite

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebPluginInfoProvider.mm (219050 => 219051)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebPluginInfoProvider.mm	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebPluginInfoProvider.mm	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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>

Modified: trunk/Source/WebKit/win/ChangeLog (219050 => 219051)


--- trunk/Source/WebKit/win/ChangeLog	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit/win/ChangeLog	2017-07-01 21:26:31 UTC (rev 219051)
@@ -1,3 +1,13 @@
+2017-07-01  Ryosuke Niwa  <rn...@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  <daba...@apple.com>
 
         API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo

Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp (219050 => 219051)


--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -989,7 +989,7 @@
     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()

Modified: trunk/Source/WebKit2/ChangeLog (219050 => 219051)


--- trunk/Source/WebKit2/ChangeLog	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit2/ChangeLog	2017-07-01 21:26:31 UTC (rev 219051)
@@ -1,3 +1,13 @@
+2017-07-01  Ryosuke Niwa  <rn...@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  <m...@apple.com>
 
         [macOS] Remove code only needed when building for OS X Yosemite

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp (219050 => 219051)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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>

Modified: trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp (219050 => 219051)


--- trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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>

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp (219050 => 219051)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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>

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (219050 => 219051)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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>

Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp (219050 => 219051)


--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp	2017-07-01 21:12:04 UTC (rev 219050)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp	2017-07-01 21:26:31 UTC (rev 219051)
@@ -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>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to