Bug 1651714 - Reduce expensive includes for TabMessageUtils.h. r=smaug

With these changes, on my Linux analysis with ClangBuildAnalyzer, the
top two expensive headers, DOMTypes.h and TabMessageUtils.h are no longer
among the 30 most expensive headers.

Differential Revision: https://phabricator.services.mozilla.com/D82935
This commit is contained in:
Simon Giesecke 2020-07-15 13:24:20 +00:00
Родитель b2c2617436
Коммит fea9dab7f2
23 изменённых файлов: 77 добавлений и 35 удалений

Просмотреть файл

@ -28,7 +28,7 @@ using CSSRect from "Units.h";
using CSSSize from "Units.h";
using ScreenIntSize from "Units.h";
using mozilla::LayoutDeviceIntPoint from "Units.h";
using nsSizeMode from "mozilla/dom/TabMessageUtils.h";
using nsSizeMode from "nsIWidgetListener.h";
using ScrollbarPreference from "mozilla/ScrollbarPreferences.h";
using hal::ScreenOrientation from "mozilla/HalScreenConfiguration.h";
using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";

16
dom/ipc/NativeThreadId.h Normal file
Просмотреть файл

@ -0,0 +1,16 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_NativeThreadId_h
#define mozilla_dom_NativeThreadId_h
#include "nsExceptionHandler.h"
namespace mozilla::dom {
typedef CrashReporter::ThreadId NativeThreadId;
}
#endif

Просмотреть файл

@ -31,6 +31,7 @@ include PTabContext;
include PBackgroundSharedTypes;
include "mozilla/AntiTrackingIPCUtils.h";
include "mozilla/dom/TabMessageUtils.h";
include "mozilla/GfxMessageUtils.h";
include "mozilla/layers/LayersMessageUtils.h";
include "mozilla/ipc/TransportSecurityInfoUtils.h";
@ -70,7 +71,7 @@ using struct nsRect from "nsRect.h";
using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
using class mozilla::WidgetPluginEvent from "ipc/nsGUIEventIPC.h";
using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h";
using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageTypes.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h";
using mozilla::CSSToScreenScale from "Units.h";
@ -88,7 +89,7 @@ using class mozilla::NativeEventData from "ipc/nsGUIEventIPC.h";
using mozilla::FontRange from "ipc/nsGUIEventIPC.h";
using mozilla::a11y::IAccessibleHolder from "mozilla/a11y/IPCTypes.h";
using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
using mozilla::dom::EffectsInfo from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::EffectsInfo from "mozilla/dom/EffectsInfo.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
using mozilla::ScrollAxis from "mozilla/PresShellForwards.h";
using mozilla::ScrollFlags from "mozilla/PresShellForwards.h";
@ -96,7 +97,7 @@ using struct InputFormData from "mozilla/dom/SessionStoreMessageUtils.h";
using struct CollectedInputDataValue from "mozilla/dom/SessionStoreMessageUtils.h";
using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h";
using CallerType from "mozilla/dom/BindingDeclarations.h";
using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageTypes.h";
namespace mozilla {
namespace dom {

Просмотреть файл

@ -11,16 +11,18 @@ include protocol PDocAccessible;
include DOMTypes;
include "mozilla/dom/TabMessageUtils.h";
using mozilla::layers::LayersObserverEpoch from "mozilla/layers/LayersTypes.h";
using mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
using mozilla::a11y::IDispatchHolder from "mozilla/a11y/IPCTypes.h";
using mozilla::dom::EffectsInfo from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::EffectsInfo from "mozilla/dom/EffectsInfo.h";
using mozilla::ScrollAxis from "mozilla/PresShellForwards.h";
using mozilla::ScrollFlags from "mozilla/PresShellForwards.h";
using struct nsRect from "nsRect.h";
using CallerType from "mozilla/dom/BindingDeclarations.h";
using nsIntRect from "nsRect.h";
using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageTypes.h";
namespace mozilla {
namespace dom {

Просмотреть файл

@ -79,7 +79,7 @@ using base::ProcessId from "base/process.h";
using struct IPC::Permission from "mozilla/net/NeckoMessageUtils.h";
using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
using mozilla::a11y::IHandlerControlHolder from "mozilla/a11y/IPCTypes.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";

29
dom/ipc/TabMessageTypes.h Normal file
Просмотреть файл

@ -0,0 +1,29 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_TabMessageTypes_h
#define mozilla_dom_TabMessageTypes_h
#include "mozilla/RefPtr.h"
namespace mozilla::dom {
class Event;
struct RemoteDOMEvent {
// Make sure to set the owner after deserializing.
RefPtr<Event> mEvent;
};
enum class EmbedderElementEventType {
NoEvent,
LoadEvent,
ErrorEvent,
EndGuard_,
};
} // namespace mozilla::dom
#endif // TABMESSAGE_TYPES_H

Просмотреть файл

@ -10,38 +10,21 @@
#include "ipc/IPCMessageUtils.h"
#include "mozilla/RefPtr.h"
#include "mozilla/dom/Event.h"
#include "nsExceptionHandler.h"
#include "nsIRemoteTab.h"
#include "nsPIDOMWindow.h"
#include "nsCOMPtr.h"
#include "mozilla/dom/EffectsInfo.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "ipc/IPCMessageUtils.h"
#include "TabMessageTypes.h"
#include "X11UndefineNone.h"
namespace mozilla {
namespace dom {
class Event;
struct RemoteDOMEvent {
// Make sure to set the owner after deserializing.
RefPtr<Event> mEvent;
};
namespace mozilla::dom {
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
mozilla::dom::RemoteDOMEvent* aResult);
typedef CrashReporter::ThreadId NativeThreadId;
enum class EmbedderElementEventType {
NoEvent,
LoadEvent,
ErrorEvent,
EndGuard_,
};
} // namespace dom
} // namespace mozilla
} // namespace mozilla::dom
namespace IPC {

Просмотреть файл

@ -54,6 +54,7 @@ EXPORTS.mozilla.dom += [
'InProcessParent.h',
'MaybeDiscarded.h',
'MemoryReportRequest.h',
'NativeThreadId.h',
'PermissionMessageUtils.h',
'ProcessActor.h',
'PropertyBagUtils.h',
@ -65,6 +66,7 @@ EXPORTS.mozilla.dom += [
'RemoteWebProgressRequest.h',
'SharedMessageBody.h',
'TabContext.h',
'TabMessageTypes.h',
'TabMessageUtils.h',
'URLClassifierChild.h',
'URLClassifierParent.h',

Просмотреть файл

@ -7,7 +7,7 @@ include protocol PGMPContent;
include protocol PGMPTimer;
include protocol PGMPStorage;
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
namespace mozilla {
namespace gmp {

Просмотреть файл

@ -11,7 +11,7 @@ include protocol PProfiler;
include protocol PRemoteDecoderManager;
include protocol PVideoBridge;
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using moveonly mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
using moveonly mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
using moveonly mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";

Просмотреть файл

@ -11,7 +11,7 @@ include protocol PFunctionBroker;
using NPError from "npapi.h";
using NPNVariable from "npapi.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using class mac_plugin_interposing::NSCursorInfo from "mozilla/plugins/PluginMessageUtils.h";
using struct nsID from "nsID.h";
using struct mozilla::plugins::NPAudioDeviceChangeDetailsIPC from "mozilla/plugins/PluginMessageUtils.h";

Просмотреть файл

@ -25,6 +25,7 @@
#include "nsAppDirectoryServiceDefs.h"
#include "nsContentUtils.h"
#include "nsCRT.h"
#include "nsEffectiveTLDService.h"
#include "nsIConsoleService.h"
#include "nsIIdleService.h"

Просмотреть файл

@ -23,7 +23,7 @@ include protocol PSandboxTesting;
#endif
using base::ProcessId from "base/process.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";

Просмотреть файл

@ -5,7 +5,7 @@
using mozilla::TimeStamp from "mozilla/TimeStamp.h";
using mozilla::gfx::VRControllerType from "VRMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
include "VRMessageUtils.h";
include GraphicsMessages;

Просмотреть файл

@ -18,6 +18,7 @@
#include "nsICookieService.h"
#include "nsIEffectiveTLDService.h"
#include "nsIRedirectHistoryEntry.h"
#include "nsNetUtil.h"
#include "nsScriptSecurityManager.h"
constexpr auto CONSOLE_SCHEMEFUL_CATEGORY = "cookieSchemeful"_ns;

Просмотреть файл

@ -13,6 +13,7 @@
#include "nsICookie.h"
class nsIChannel;
class nsIConsoleReportCollector;
class nsICookieJarSettings;
class nsIEffectiveTLDService;
class nsIPrincipal;

Просмотреть файл

@ -26,7 +26,7 @@ include NeckoChannelParams;
include PrefsTypes;
include PSMIPCTypes;
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";

Просмотреть файл

@ -11,6 +11,7 @@
#include "AltSvcTransactionParent.h"
#include "mozilla/net/HttpTransactionParent.h"
#include "nsHttpConnectionInfo.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsISpeculativeConnect.h"
#include "nsIOService.h"
#include "nsQueryObject.h"

Просмотреть файл

@ -17,6 +17,7 @@
#include "mozilla/StaticPrefs_network.h"
#include "nsInputStreamPump.h"
#include "nsHttpHandler.h"
#include "nsNetUtil.h"
#include "nsProxyInfo.h"
#include "nsProxyRelease.h"
#include "nsQueryObject.h"

Просмотреть файл

@ -11,6 +11,7 @@
#include "nsHttpHandler.h"
#include "nsCOMPtr.h"
#include "nsIOService.h"
#include "nsNetUtil.h"
#include "nsQueryObject.h"
#include "nsThreadUtils.h"
#include "NullHttpChannel.h"

Просмотреть файл

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
namespace mozilla {

Просмотреть файл

@ -16,6 +16,7 @@
#include "mozilla/net/NeckoChannelParams.h"
#include "mozilla/PermissionManager.h"
#include "mozIThirdPartyUtil.h"
#include "nsGlobalWindowInner.h"
#include "nsIChannel.h"
#include "nsIPermission.h"
#include "nsIURI.h"

Просмотреть файл

@ -4,10 +4,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
include "mozilla/dom/TabMessageUtils.h";
include HeadlessWidgetTypes;
using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h";
using nsSizeMode from "mozilla/dom/TabMessageUtils.h";
using nsSizeMode from "nsIWidgetListener.h";
using nsTransparencyMode from "mozilla/widget/WidgetMessageUtils.h";
namespace mozilla {