Skip to content

Commit

Permalink
Remove unnecessary headers including other headers
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=259751
rdar://113293081

Reviewed by Chris Dumez.

This should reduce build times.

* Source/WebCore/platform/SleepDisablerIdentifier.h:
(): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::didCreateSleepDisabler):
(WebKit::WebPageProxy::didDestroySleepDisabler):
(WebKit::WebPageProxy::hasSleepDisabler const):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxyInternals.h:
* Source/WebKit/UIProcess/mac/WKQuickLookPreviewController.mm:
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
* Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
* Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp:
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
* Source/WebKit/WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
* Source/WebKit/WebProcess/WebPage/WebContextMenu.cpp:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:

Canonical link: https://commits.webkit.org/266529@main
  • Loading branch information
achristensen07 committed Aug 3, 2023
1 parent 14fa620 commit 0fdea01
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/platform/SleepDisablerIdentifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace WebCore {

enum SleepDisablerIdentifierType { };
struct SleepDisablerIdentifierType { };
using SleepDisablerIdentifier = ObjectIdentifier<SleepDisablerIdentifierType>;

} // namespace WebCore
10 changes: 5 additions & 5 deletions Source/WebKit/UIProcess/WebPageProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ void WebPageProxy::close()

// Make sure we do this before we clear the UIClient so that we can ask the UIClient
// to release the wake locks.
m_sleepDisablers.clear();
internals().sleepDisablers.clear();

reportPageLoadResult(ResourceError { ResourceError::Type::Cancellation });

Expand Down Expand Up @@ -9128,7 +9128,7 @@ void WebPageProxy::resetStateAfterProcessExited(ProcessTerminationReason termina
m_userScriptsNotified = false;
m_hasActiveAnimatedScroll = false;
m_registeredForFullSpeedUpdates = false;
m_sleepDisablers.clear();
internals().sleepDisablers.clear();

internals().editorState = EditorState();
internals().cachedFontAttributesAtSelectionStart.reset();
Expand Down Expand Up @@ -12825,17 +12825,17 @@ void WebPageProxy::didCreateSleepDisabler(SleepDisablerIdentifier identifier, co
{
MESSAGE_CHECK(m_process, !reason.isNull());
auto sleepDisabler = makeUnique<WebCore::SleepDisabler>(reason, display ? PAL::SleepDisabler::Type::Display : PAL::SleepDisabler::Type::System, webPageID());
m_sleepDisablers.add(identifier, WTFMove(sleepDisabler));
internals().sleepDisablers.add(identifier, WTFMove(sleepDisabler));
}

void WebPageProxy::didDestroySleepDisabler(SleepDisablerIdentifier identifier)
{
m_sleepDisablers.remove(identifier);
internals().sleepDisablers.remove(identifier);
}

bool WebPageProxy::hasSleepDisabler() const
{
return !m_sleepDisablers.isEmpty();
return !internals().sleepDisablers.isEmpty();
}

#if USE(SYSTEM_PREVIEW)
Expand Down
5 changes: 3 additions & 2 deletions Source/WebKit/UIProcess/WebPageProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "APIObject.h"
#include "MessageReceiver.h"
#include "MessageSender.h"
#include <WebCore/SleepDisablerIdentifier.h>
#include <wtf/CheckedRef.h>
#include <wtf/OptionSet.h>
#include <wtf/ProcessID.h>
#include <wtf/UniqueRef.h>

Expand Down Expand Up @@ -243,6 +243,7 @@ struct RecentSearch;
struct RunJavaScriptParameters;
struct SerializedAttachmentData;
struct ShareDataWithParsedURL;
struct SleepDisablerIdentifierType;
struct SpeechRecognitionError;
struct SystemPreviewInfo;
struct TextAlternativeWithRange;
Expand Down Expand Up @@ -282,6 +283,7 @@ using PlaybackTargetClientContextIdentifier = ObjectIdentifier<PlaybackTargetCli
using PointerID = uint32_t;
using ResourceLoaderIdentifier = AtomicObjectIdentifier<ResourceLoader>;
using ScrollingNodeID = uint64_t;
using SleepDisablerIdentifier = ObjectIdentifier<SleepDisablerIdentifierType>;
using UserMediaRequestIdentifier = ObjectIdentifier<UserMediaRequestIdentifierType>;

}
Expand Down Expand Up @@ -3310,7 +3312,6 @@ class WebPageProxy final : public API::ObjectImpl<API::Object::Type::Page>, publ
#endif

RefPtr<WebPageProxy> m_pageToCloneSessionStorageFrom;
HashMap<WebCore::SleepDisablerIdentifier, std::unique_ptr<WebCore::SleepDisabler>> m_sleepDisablers;
};

} // namespace WebKit
1 change: 1 addition & 0 deletions Source/WebKit/UIProcess/WebPageProxyInternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ struct WebPageProxy::Internals final : WebPopupMenuProxy::Client
WebPageProxyMessageReceiverRegistration messageReceiverRegistration;

WeakHashSet<WebPageProxy> m_openedPages;
HashMap<WebCore::SleepDisablerIdentifier, std::unique_ptr<WebCore::SleepDisabler>> sleepDisablers;

#if ENABLE(APPLE_PAY)
std::unique_ptr<WebPaymentCoordinatorProxy> paymentCoordinator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#import "WebPageProxy.h"
#import <wtf/RetainPtr.h>
#import <wtf/URL.h>
#import <pal/mac/QuickLookUISoftLink.h>

@interface WKQuickLookPreviewController () <QLPreviewPanelDelegate, QLPreviewPanelDataSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
#include "APIArray.h"
#include "APIDictionary.h"
#include "APIFrameHandle.h"
#include "APIInjectedBundlePageContextMenuClient.h"
#include "APINumber.h"
#include "APIString.h"
#include "APIURL.h"
#include "APIURLRequest.h"
#include "InjectedBundleNodeHandle.h"
#include "InjectedBundlePageContextMenuClient.h"
#include "InjectedBundlePageEditorClient.h"
#include "InjectedBundlePageFormClient.h"
#include "InjectedBundlePageLoaderClient.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "config.h"
#include "WebKitWebEditor.h"

#include "APIInjectedBundleEditorClient.h"
#include "WebKitWebEditorPrivate.h"
#include "WebKitWebPagePrivate.h"
#include <wtf/glib/WTFGType.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@
#include "config.h"
#include "WebKitWebPage.h"

#include "APIInjectedBundleEditorClient.h"
#include "APIInjectedBundleFormClient.h"
#include "APIInjectedBundlePageContextMenuClient.h"
#include "APIInjectedBundlePageLoaderClient.h"
#include "APIInjectedBundlePageResourceLoadClient.h"
#include "APIInjectedBundlePageUIClient.h"
#include "APIString.h"
#include "InjectedBundle.h"
#include "InjectedBundlePageContextMenuClient.h"
#include "MessageSenderInlines.h"
#include "WebContextMenuItem.h"
#include "WebKitContextMenuPrivate.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#import "WKWebProcessPlugInBrowserContextControllerInternal.h"

#import "APIData.h"
#import "APIInjectedBundleEditorClient.h"
#import "APIInjectedBundleFormClient.h"
#import "RemoteObjectRegistry.h"
#import "RemoteObjectRegistryMessages.h"
#import "WKBrowsingContextHandleInternal.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "WebChromeClient.h"

#include "APIArray.h"
#include "APIInjectedBundleFormClient.h"
#include "APIInjectedBundlePageUIClient.h"
#include "APISecurityOrigin.h"
#include "DrawingArea.h"
#include "FindController.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "config.h"
#include "WebEditorClient.h"

#include "APIInjectedBundleEditorClient.h"
#include "APIInjectedBundleFormClient.h"
#include "EditorState.h"
#include "MessageSenderInlines.h"
#include "SharedBufferReference.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "config.h"
#include "WebLocalFrameLoaderClient.h"

#include "APIInjectedBundleFormClient.h"
#include "APIInjectedBundlePageLoaderClient.h"
#include "APIInjectedBundlePageResourceLoadClient.h"
#include "AuthenticationManager.h"
#include "DataReference.h"
#include "DrawingArea.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "config.h"
#include "WebProgressTrackerClient.h"

#include "APIInjectedBundlePageLoaderClient.h"
#include "MessageSenderInlines.h"
#include "WebPage.h"
#include "WebPageProxyMessages.h"
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/WebProcess/WebPage/WebContextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
*/

#include "config.h"
#include "WebContextMenu.h"

#if ENABLE(CONTEXT_MENUS)

#include "WebContextMenu.h"

#include "APIInjectedBundlePageContextMenuClient.h"
#include "ContextMenuContextData.h"
#include "MessageSenderInlines.h"
#include "UserData.h"
Expand Down
6 changes: 6 additions & 0 deletions Source/WebKit/WebProcess/WebPage/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@

#include "APIArray.h"
#include "APIGeometry.h"
#include "APIInjectedBundleEditorClient.h"
#include "APIInjectedBundleFormClient.h"
#include "APIInjectedBundlePageContextMenuClient.h"
#include "APIInjectedBundlePageLoaderClient.h"
#include "APIInjectedBundlePageResourceLoadClient.h"
#include "APIInjectedBundlePageUIClient.h"
#include "DataReference.h"
#include "DragControllerAction.h"
#include "DrawingArea.h"
Expand Down
22 changes: 14 additions & 8 deletions Source/WebKit/WebProcess/WebPage/WebPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@

#pragma once

#include "APIInjectedBundleEditorClient.h"
#include "APIInjectedBundleFormClient.h"
#include "APIInjectedBundlePageContextMenuClient.h"
#include "APIInjectedBundlePageLoaderClient.h"
#include "APIInjectedBundlePageResourceLoadClient.h"
#include "APIInjectedBundlePageUIClient.h"
#include "APIObject.h"
#include "CallbackID.h"
#include "Connection.h"
Expand All @@ -43,7 +37,6 @@
#include "EventDispatcher.h"
#include "GeolocationIdentifier.h"
#include "IdentifierTypes.h"
#include "InjectedBundlePageContextMenuClient.h"
#include "InjectedBundlePageFullScreenClient.h"
#include "LayerTreeContext.h"
#include "MediaPlaybackState.h"
Expand Down Expand Up @@ -175,13 +168,26 @@ OBJC_CLASS WKAccessibilityWebPageObject;

#define ENABLE_VIEWPORT_RESIZING PLATFORM(IOS_FAMILY)

struct WKBundlePageFullScreenClientBase;

namespace WTF {
enum class Critical : bool;
}

namespace API {
class Array;
}
namespace InjectedBundle {
class EditorClient;
#if ENABLE(CONTEXT_MENUS)
class PageContextMenuClient;
#endif
class EditorClient;
class FormClient;
class PageLoaderClient;
class ResourceLoadClient;
class PageUIClient;
} // namespace InjectedBundle
} // namespace API

namespace IPC {
class Connection;
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#import "FontInfo.h"
#import "FrameInfoData.h"
#import "InjectedBundleHitTestResult.h"
#import "InjectedBundlePageContextMenuClient.h"
#import "LaunchServicesDatabaseManager.h"
#import "PDFPlugin.h"
#import "PageBanner.h"
Expand Down

0 comments on commit 0fdea01

Please sign in to comment.