- Revision
- 283526
- Author
- [email protected]
- Date
- 2021-10-04 16:50:37 -0700 (Mon, 04 Oct 2021)
Log Message
[Build-time perf] Forward-declare more things in ScriptExecutionContext.h
https://bugs.webkit.org/show_bug.cgi?id=231182
Reviewed by Tim Horton.
Forward declare, rather than include, more classes and enums in ScriptExecutionContext.h.
Any inline definition in the style of `RefPtr<Type> type() { return nullptr; }` will cause a compilation
error if the Type is not fully defined, so these definitions should be moved the the .cpp file.
Removing all the #includes and replacing them with forward-declarations causes downstream failures,
so add more forward-declarations and move definitions to the implementation file wherever possible.
* Modules/permissions/Permissions.cpp:
* Modules/permissions/Permissions.h:
* Modules/storage/DummyStorageProvider.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::permissionController):
(WebCore::ScriptExecutionContext::createRTCDataChannelRemoteHandlerConnection):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::permissionController): Deleted.
(WebCore::ScriptExecutionContext::createRTCDataChannelRemoteHandlerConnection): Deleted.
* workers/WorkerLoaderProxy.h:
* workers/WorkerGlobalScope.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (283525 => 283526)
--- trunk/Source/WebCore/ChangeLog 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/ChangeLog 2021-10-04 23:50:37 UTC (rev 283526)
@@ -1,3 +1,32 @@
+2021-10-04 Jer Noble <[email protected]>
+
+ [Build-time perf] Forward-declare more things in ScriptExecutionContext.h
+ https://bugs.webkit.org/show_bug.cgi?id=231182
+
+ Reviewed by Tim Horton.
+
+ Forward declare, rather than include, more classes and enums in ScriptExecutionContext.h.
+
+ Any inline definition in the style of `RefPtr<Type> type() { return nullptr; }` will cause a compilation
+ error if the Type is not fully defined, so these definitions should be moved the the .cpp file.
+
+ Removing all the #includes and replacing them with forward-declarations causes downstream failures,
+ so add more forward-declarations and move definitions to the implementation file wherever possible.
+
+ * Modules/permissions/Permissions.cpp:
+ * Modules/permissions/Permissions.h:
+ * Modules/storage/DummyStorageProvider.h:
+ * dom/Document.cpp:
+ * dom/Document.h:
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::permissionController):
+ (WebCore::ScriptExecutionContext::createRTCDataChannelRemoteHandlerConnection):
+ * dom/ScriptExecutionContext.h:
+ (WebCore::ScriptExecutionContext::permissionController): Deleted.
+ (WebCore::ScriptExecutionContext::createRTCDataChannelRemoteHandlerConnection): Deleted.
+ * workers/WorkerLoaderProxy.h:
+ * workers/WorkerGlobalScope.h:
+
2021-10-04 Simon Fraser <[email protected]>
Use ScrollClamping in more places in scrolling code
Modified: trunk/Source/WebCore/Modules/permissions/Permissions.cpp (283525 => 283526)
--- trunk/Source/WebCore/Modules/permissions/Permissions.cpp 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/Modules/permissions/Permissions.cpp 2021-10-04 23:50:37 UTC (rev 283526)
@@ -58,6 +58,8 @@
return m_navigator.get();
}
+Permissions::~Permissions() = default;
+
void Permissions::query(JSC::Strong<JSC::JSObject> permissionDescriptorValue, DOMPromiseDeferred<IDLInterface<PermissionStatus>>&& promise)
{
// FIXME: support permissions in WorkerNavigator.
Modified: trunk/Source/WebCore/Modules/permissions/Permissions.h (283525 => 283526)
--- trunk/Source/WebCore/Modules/permissions/Permissions.h 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/Modules/permissions/Permissions.h 2021-10-04 23:50:37 UTC (rev 283526)
@@ -46,6 +46,7 @@
WTF_MAKE_ISO_ALLOCATED(Permissions);
public:
static Ref<Permissions> create(Navigator&);
+ ~Permissions();
Navigator* navigator();
void query(JSC::Strong<JSC::JSObject>, DOMPromiseDeferred<IDLInterface<PermissionStatus>>&&);
Modified: trunk/Source/WebCore/Modules/storage/DummyStorageProvider.h (283525 => 283526)
--- trunk/Source/WebCore/Modules/storage/DummyStorageProvider.h 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/Modules/storage/DummyStorageProvider.h 2021-10-04 23:50:37 UTC (rev 283526)
@@ -26,6 +26,7 @@
#pragma once
#include "FileSystemStorageConnection.h"
+#include "StorageConnection.h"
#include "StorageProvider.h"
namespace WebCore {
Modified: trunk/Source/WebCore/dom/Document.cpp (283525 => 283526)
--- trunk/Source/WebCore/dom/Document.cpp 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/dom/Document.cpp 2021-10-04 23:50:37 UTC (rev 283526)
@@ -162,6 +162,7 @@
#include "PaintWorkletGlobalScope.h"
#include "Performance.h"
#include "PerformanceNavigationTiming.h"
+#include "PermissionController.h"
#include "PlatformLocale.h"
#include "PlatformMediaSessionManager.h"
#include "PlatformScreen.h"
Modified: trunk/Source/WebCore/dom/Document.h (283525 => 283526)
--- trunk/Source/WebCore/dom/Document.h 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/dom/Document.h 2021-10-04 23:50:37 UTC (rev 283526)
@@ -216,6 +216,7 @@
class SerializedScriptValue;
class Settings;
class SpeechRecognition;
+class StorageConnection;
class StringCallback;
class StyleSheet;
class StyleSheetContents;
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (283525 => 283526)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2021-10-04 23:50:37 UTC (rev 283526)
@@ -48,7 +48,9 @@
#include "Navigator.h"
#include "Page.h"
#include "Performance.h"
+#include "PermissionController.h"
#include "PublicURLManager.h"
+#include "RTCDataChannelRemoteHandlerConnection.h"
#include "RejectedPromiseTracker.h"
#include "ResourceRequest.h"
#include "SWClientConnection.h"
@@ -375,6 +377,16 @@
m_destructionObservers.remove(&observer);
}
+RefPtr<PermissionController> ScriptExecutionContext::permissionController()
+{
+ return nullptr;
+}
+
+RefPtr<RTCDataChannelRemoteHandlerConnection> ScriptExecutionContext::createRTCDataChannelRemoteHandlerConnection()
+{
+ return nullptr;
+}
+
// FIXME: Should this function be in SecurityContext or SecurityOrigin instead?
bool ScriptExecutionContext::canIncludeErrorDetails(CachedScript* script, const String& sourceURL)
{
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (283525 => 283526)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.h 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h 2021-10-04 23:50:37 UTC (rev 283526)
@@ -30,14 +30,10 @@
#include "ActiveDOMObject.h"
#include "CrossOriginMode.h"
#include "DOMTimer.h"
-#include "PermissionController.h"
-#include "RTCDataChannelRemoteHandlerConnection.h"
-#include "ResourceLoaderOptions.h"
#include "ScriptExecutionContextIdentifier.h"
#include "SecurityContext.h"
-#include "ServiceWorkerTypes.h"
+#include "ServiceWorkerIdentifier.h"
#include "Settings.h"
-#include "StorageConnection.h"
#include <_javascript_Core/ConsoleTypes.h>
#include <_javascript_Core/HandleTypes.h>
#include <wtf/CrossThreadTask.h>
@@ -73,10 +69,13 @@
class FontCache;
class FontLoadRequest;
class MessagePort;
+class PermissionController;
class PublicURLManager;
class RejectedPromiseTracker;
+class RTCDataChannelRemoteHandlerConnection;
class ResourceRequest;
class SocketProvider;
+enum class LoadedFromOpaqueSource : uint8_t;
enum class ReferrerPolicy : uint8_t;
enum class TaskSource : uint8_t;
@@ -117,11 +116,11 @@
virtual void disableWebAssembly(const String& errorMessage) = 0;
virtual IDBClient::IDBConnectionProxy* idbConnectionProxy() = 0;
- virtual RefPtr<PermissionController> permissionController() { return nullptr; }
+ virtual RefPtr<PermissionController> permissionController();
virtual SocketProvider* socketProvider() = 0;
- virtual RefPtr<RTCDataChannelRemoteHandlerConnection> createRTCDataChannelRemoteHandlerConnection() { return nullptr; }
+ virtual RefPtr<RTCDataChannelRemoteHandlerConnection> createRTCDataChannelRemoteHandlerConnection();
virtual String resourceRequestIdentifier() const { return String(); };
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (283525 => 283526)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.h 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h 2021-10-04 23:50:37 UTC (rev 283526)
@@ -52,6 +52,7 @@
class CSSValuePool;
class ContentSecurityPolicyResponseHeaders;
class Crypto;
+class FileSystemStorageConnection;
class FontFaceSet;
class Performance;
class ScheduledAction;
Modified: trunk/Source/WebCore/workers/WorkerLoaderProxy.h (283525 => 283526)
--- trunk/Source/WebCore/workers/WorkerLoaderProxy.h 2021-10-04 23:44:08 UTC (rev 283525)
+++ trunk/Source/WebCore/workers/WorkerLoaderProxy.h 2021-10-04 23:50:37 UTC (rev 283526)
@@ -35,6 +35,7 @@
namespace WebCore {
class CacheStorageConnection;
+class StorageConnection;
// A proxy to talk to the loader context. Normally, the document on the main thread
// provides loading services for the subordinate workers. This interface provides 2-way