Bug 1825324 - Make widget/* buildable outside of a unified build environment r=andi,geckoview-reviewers,m_kato

Depends on D173637

Differential Revision: https://phabricator.services.mozilla.com/D173969
This commit is contained in:
serge-sans-paille 2023-03-31 13:29:44 +00:00
Родитель ab98027047
Коммит 0702cdc836
50 изменённых файлов: 93 добавлений и 56 удалений

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

@ -9,6 +9,8 @@
#include <windows.h>
#include "mozilla/Maybe.h"
#include "nsString.h"
#include <stdint.h>
namespace mozilla {

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

@ -24,8 +24,8 @@ class nsIURI;
class nsIDocShell;
class nsIChannel;
class nsIReferrerInfo;
class OriginAttibutes;
namespace mozilla {
class OriginAttributes;
template <typename, class>
class UniquePtr;
namespace dom {

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

@ -6,6 +6,10 @@
#include "domstubs.idl"
#include "nsIDroppedLinkHandler.idl"
%{C++
#include "mozilla/dom/BindingDeclarations.h"
%}
interface nsIWebBrowserChrome;
webidl ContentFrameMessageManager;

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

@ -21,7 +21,7 @@
#include "mozilla/Telemetry.h"
#ifndef MOZ_STORAGE_SORTWARNING_SQL_DUMP
#include "mozilla/Logging.h"
# include "mozilla/Logging.h"
extern mozilla::LazyLogModule gStorageLog;
#endif

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

@ -36,6 +36,8 @@
#include "mozilla/widget/ScreenManager.h"
#include "mozilla/widget/Screen.h"
#include "jsapi.h"
#include "gfxPlatform.h"
#include "gfxConfig.h"
#include "DriverCrashGuard.h"

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

@ -1137,8 +1137,6 @@ PuppetWidget::NotifyIME(TextEventDispatcher* aTextEventDispatcher,
default:
return NS_ERROR_NOT_IMPLEMENTED;
}
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP_(IMENotificationRequests)

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

@ -238,7 +238,7 @@ void VsyncDispatcher::RemoveMainThreadObserver(VsyncObserver* aObserver) {
void VsyncDispatcher::UpdateVsyncStatus() {
bool wasObservingVsync = false;
bool needVsync = false;
RefPtr<VsyncSource> vsyncSource;
RefPtr<gfx::VsyncSource> vsyncSource;
{
auto state = mState.Lock();

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

@ -28,6 +28,8 @@
#include "nsPrintfCString.h"
#if defined(XP_WIN)
# include "windef.h"
# include "winnetwk.h"
# include "npapi.h"
# include "WinUtils.h"
#endif // #if defined (XP_WIN)

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

@ -33,5 +33,3 @@ LOCAL_INCLUDES += [
"/widget",
"/widget/android",
]
REQUIRES_UNIFIED_BUILD = True

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

@ -201,5 +201,3 @@ if CONFIG["MOZ_NATIVE_DEVICES"]:
DEFINES["MOZ_NATIVE_DEVICES"] = True
# DEFINES['DEBUG_WIDGETS'] = True
REQUIRES_UNIFIED_BUILD = True

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

@ -180,5 +180,3 @@ OS_LIBS += [
]
SPHINX_TREES["/widget/cocoa"] = "docs"
REQUIRES_UNIFIED_BUILD = True

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

@ -72,7 +72,6 @@ static constexpr nsCursor kCustomCursor = eCursorCount;
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
switch (aCursor) {
SEL cursorSelector;
case eCursor_standard:
return [nsMacCursor cursorWithCursor:[NSCursor arrowCursor] type:aCursor];
case eCursor_wait:
@ -89,24 +88,27 @@ static constexpr nsCursor kCustomCursor = eCursorCount;
return [nsMacCursor cursorWithImageNamed:@"move" hotSpot:NSMakePoint(12, 12) type:aCursor];
case eCursor_help:
return [nsMacCursor cursorWithImageNamed:@"help" hotSpot:NSMakePoint(12, 12) type:aCursor];
case eCursor_copy:
cursorSelector = @selector(dragCopyCursor);
case eCursor_copy: {
SEL cursorSelector = @selector(dragCopyCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
case eCursor_alias:
cursorSelector = @selector(dragLinkCursor);
}
case eCursor_alias: {
SEL cursorSelector = @selector(dragLinkCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
case eCursor_context_menu:
cursorSelector = @selector(contextualMenuCursor);
}
case eCursor_context_menu: {
SEL cursorSelector = @selector(contextualMenuCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
}
case eCursor_cell:
return [nsMacCursor cursorWithImageNamed:@"cell" hotSpot:NSMakePoint(12, 12) type:aCursor];
case eCursor_grab:
@ -122,12 +124,13 @@ static constexpr nsCursor kCustomCursor = eCursorCount;
case eCursor_all_scroll:
return [nsMacCursor cursorWithCursor:[NSCursor openHandCursor] type:aCursor];
case eCursor_not_allowed:
case eCursor_no_drop:
cursorSelector = @selector(operationNotAllowedCursor);
case eCursor_no_drop: {
SEL cursorSelector = @selector(operationNotAllowedCursor);
return [nsMacCursor cursorWithCursor:[NSCursor respondsToSelector:cursorSelector]
? [NSCursor performSelector:cursorSelector]
: [NSCursor arrowCursor]
type:aCursor];
}
// Resize Cursors:
// North
case eCursor_n_resize:

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

@ -8,6 +8,7 @@
#include "nsCocoaUtils.h"
#include "nsIBaseWindow.h"
#include "gfxPlatform.h"
NS_IMPL_ISUPPORTS(nsMacUserActivityUpdater, nsIMacUserActivityUpdater)

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

@ -13,12 +13,12 @@
#include "nsISupports.h"
#include "nsMenuParentX.h"
#include "nsMenuGroupOwnerX.h"
#include "nsChangeObserver.h"
#include "nsTArray.h"
#include "nsString.h"
class nsMenuBarX;
class nsMenuGroupOwnerX;
class nsMenuX;
class nsIWidget;
class nsIContent;

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

@ -13,10 +13,10 @@
#include "nsStubMutationObserver.h"
#include "nsHashKeys.h"
#include "nsIObserver.h"
#include "nsMenuBarX.h"
#include "nsTHashMap.h"
#include "nsString.h"
class nsMenuBarX;
class nsMenuItemX;
class nsChangeObserver;
class nsIWidget;

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

@ -7,6 +7,7 @@
#include <objc/runtime.h>
#include "mozilla/MacStringHelpers.h"
#include "mozilla/dom/Document.h"
#include "nsArrayUtils.h"
#include "nsCocoaUtils.h"
#include "nsDirectoryServiceDefs.h"

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

@ -17,6 +17,7 @@
#include "mozilla/WritingModes.h"
#include "mozilla/widget/HeadlessWidgetTypes.h"
#include "mozilla/widget/PlatformWidgetTypes.h"
#include "mozilla/widget/Screen.h"
#include "nsIScreen.h"
#include "HeadlessKeyBindings.h"

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

@ -46,5 +46,3 @@ else:
include("/ipc/chromium/chromium-config.mozbuild")
FINAL_LIBRARY = "xul"
REQUIRES_UNIFIED_BUILD = True

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

@ -388,5 +388,3 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
if CONFIG["MOZ_WAYLAND"]:
CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
REQUIRES_UNIFIED_BUILD = True

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

@ -9,6 +9,7 @@
#include <cmath>
#include <cstdint>
#include "imgIContainer.h"
#include "ErrorList.h"
#include "Units.h"
#include "mozilla/AlreadyAddRefed.h"
@ -46,7 +47,6 @@
// forward declarations
class nsIBidiKeyboard;
class nsIRollupListener;
class imgIContainer;
class nsIContent;
class ViewWrapper;
class nsIRunnable;

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

@ -34,7 +34,7 @@ static void GetDisplayNameForPrinter(const cups_dest_t& aDest,
const char* displayName = CupsShim().cupsGetOption(
"printer-info", aDest.num_options, aDest.options);
if (displayName) {
CopyUTF8toUTF16(MakeStringSpan(displayName), aName);
CopyUTF8toUTF16(mozilla::MakeStringSpan(displayName), aName);
}
#endif
}

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

@ -25,5 +25,3 @@ LOCAL_INCLUDES += [
]
DisableStlWrapping()
REQUIRES_UNIFIED_BUILD = True

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

@ -11,7 +11,10 @@
#include "mozilla/TextEventDispatcher.h"
#include "mozilla/WritingModes.h"
#include "windef.h"
#include "winnetwk.h"
#include "npapi.h"
#include "nsCOMPtr.h"
#include "nsIWidget.h"
#include "nsRect.h"

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

@ -6,12 +6,14 @@
*/
#include "InkCollector.h"
#include "nsDebug.h"
#include "nsISupportsUtils.h"
// Msinkaut_i.c and Msinkaut.h should both be included
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms695519.aspx
#include <msinkaut_i.c>
StaticAutoPtr<InkCollector> InkCollector::sInkCollector;
mozilla::StaticAutoPtr<InkCollector> InkCollector::sInkCollector;
InkCollector::~InkCollector() {
Shutdown();

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

@ -8,6 +8,7 @@
#ifndef InkCollector_h__
#define InkCollector_h__
#include <objbase.h>
#include <msinkaut.h>
#include "mozilla/StaticPtr.h"

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

@ -14,6 +14,7 @@
#include "nsCRT.h"
#include "nsNetCID.h"
#include "nsCExternalHandlerService.h"
#include "nsComponentManagerUtils.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Preferences.h"
#include "JumpListBuilder.h"

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

@ -1398,7 +1398,6 @@ void NativeKey::InitIsSkippableForKeyOrChar(const MSG& aLastKeyMSG) {
// by the auto-repeat feature.
return;
}
return;
case WM_APPCOMMAND:
MOZ_ASSERT_UNREACHABLE(
"WM_APPCOMMAND should be handled in "

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

@ -7,6 +7,8 @@
#include "GeckoProfiler.h"
#include "nsThreadUtils.h"
#include "mozilla/Span.h"
#include "mozilla/gfx/Point.h"
#include "WinUtils.h"
#include <algorithm>
#include <type_traits>
@ -163,7 +165,7 @@ class SharedImage {
already_AddRefed<gfx::DrawTarget> CreateDrawTarget() {
return gfx::Factory::CreateDrawTargetForData(
gfx::BackendType::CAIRO, mPixelData, IntSize(mWidth, mHeight),
gfx::BackendType::CAIRO, mPixelData, gfx::IntSize(mWidth, mHeight),
GetStride(), gfx::SurfaceFormat::B8G8R8A8);
}
@ -287,8 +289,8 @@ class PresentableSharedImage {
mDeviceContext, &srcPos, 0 /*colorKey*/, &bf, ULW_ALPHA);
}
IntRect sharedImageRect{0, 0, mSharedImage.GetWidth(),
mSharedImage.GetHeight()};
gfx::IntRect sharedImageRect{0, 0, mSharedImage.GetWidth(),
mSharedImage.GetHeight()};
bool result = true;
@ -298,9 +300,9 @@ class PresentableSharedImage {
}
for (auto& ipcDirtyRect : aDirtyRects) {
IntRect dirtyRect{ipcDirtyRect.x, ipcDirtyRect.y, ipcDirtyRect.width,
ipcDirtyRect.height};
IntRect bltRect = dirtyRect.Intersect(sharedImageRect);
gfx::IntRect dirtyRect{ipcDirtyRect.x, ipcDirtyRect.y, ipcDirtyRect.width,
ipcDirtyRect.height};
gfx::IntRect bltRect = dirtyRect.Intersect(sharedImageRect);
if (!::BitBlt(windowDC, bltRect.x /*dstX*/, bltRect.y /*dstY*/,
bltRect.width, bltRect.height, mDeviceContext,

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

@ -9,6 +9,7 @@
#include "nsIWidget.h"
#include "mozilla/widget/PCompositorWidgetParent.h"
#include "mozilla/Maybe.h"
#include "mozilla/gfx/2D.h"
#include "prthread.h"
#include <windows.h>

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

@ -24,6 +24,8 @@
#include "nsDocShell.h"
#include "nsWindowGfx.h"
#include "shellapi.h"
namespace mozilla::widget {
using mozilla::LinkedListElement;

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

@ -7,6 +7,7 @@
#define widget_windows_SystemStatusBar_h
#include "nsISystemStatusBar.h"
#include "mozilla/LinkedList.h"
namespace mozilla::widget {
class StatusBarEntry;

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

@ -185,7 +185,6 @@ TaskbarTabPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) {
return wParam == SC_CLOSE
? ::DefWindowProcW(mProxyWindow, WM_SYSCOMMAND, wParam, lParam)
: ::SendMessageW(mWnd, WM_SYSCOMMAND, wParam, lParam);
return 0;
}
return TaskbarPreview::WndProc(nMsg, wParam, lParam);
}

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

@ -14,6 +14,7 @@
#include "mozilla/Logging.h"
#include "mozilla/StaticPtr.h"
#include "nsHashtablesFwd.h"
#include "nsdefs.h"
namespace mozilla::widget {

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

@ -8,7 +8,9 @@
*/
#include "nscore.h"
#include "nsWindowDefs.h"
#include "WinPointerEvents.h"
#include "WinUtils.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/WindowsVersion.h"

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

@ -7,7 +7,8 @@
#define WinPointerEvents_h__
#include "mozilla/MouseEvents.h"
#include "nsWindow.h"
#include "touchinjection_sdk80.h"
#include <windef.h>
// Define PointerEvent related macros and structures when building code on
// Windows version before Win8.

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

@ -82,10 +82,6 @@ NS_IMPL_ISUPPORTS(AsyncDeleteAllFaviconsFromDisk, nsIRunnable)
const char FaviconHelper::kJumpListCacheDir[] = "jumpListCache";
const char FaviconHelper::kShortcutCacheDir[] = "shortcutCache";
// Prefix for path used by NT calls.
const wchar_t kNTPrefix[] = L"\\??\\";
const size_t kNTPrefixLen = ArrayLength(kNTPrefix) - 1;
struct CoTaskMemFreePolicy {
void operator()(void* aPtr) { ::CoTaskMemFree(aPtr); }
};

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

@ -14,9 +14,13 @@
#include "nsIWeakReferenceUtils.h"
#include "mozilla/Monitor.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/ThreadSafeWeakPtr.h"
#include "mozilla/widget/WindowOcclusionState.h"
#include "mozilla/widget/WinEventObserver.h"
#include "Units.h"
#include "nsThreadUtils.h"
class nsBaseWidget;
struct IVirtualDesktopManager;

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

@ -7,6 +7,8 @@
#include <windows.h>
#include <fcntl.h>
#include <cstdio>
#include <io.h>
namespace mozilla {

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

@ -202,5 +202,3 @@ if CONFIG["CC_TYPE"] == "clang-cl":
]
SPHINX_TREES["/widget/windows"] = "docs"
REQUIRES_UNIFIED_BUILD = True

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

@ -30,6 +30,7 @@
#include "mozilla/widget/ScreenManager.h"
#include "mozilla/Atomics.h"
#include "mozilla/WindowsProcessMitigations.h"
#include "mozilla/WindowsVersion.h"
#ifdef MOZ_BACKGROUNDTASKS
# include "mozilla/BackgroundTasks.h"

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

@ -21,6 +21,8 @@
#include "mozilla/Logging.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/StaticPrefs_clipboard.h"
#include "mozilla/StaticPrefs_widget.h"
#include "mozilla/WindowsVersion.h"
#include "SpecialSystemDirectory.h"
#include "nsArrayUtils.h"
@ -44,6 +46,7 @@
#include "nsIObserverService.h"
#include "nsMimeTypes.h"
#include "imgITools.h"
#include "imgIContainer.h"
using mozilla::LogLevel;
@ -298,7 +301,8 @@ nsresult nsClipboard::SetupNativeDataObject(
}
}
if (!StaticPrefs::clipboard_copyPrivateDataToClipboardCloudOrHistory()) {
if (!mozilla::StaticPrefs::
clipboard_copyPrivateDataToClipboardCloudOrHistory()) {
// Let Clipboard know that data is sensitive and must not be copied to
// the Cloud Clipboard, Clipboard History and similar.
// https://docs.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats#cloud-clipboard-and-clipboard-history-formats
@ -483,7 +487,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(int32_t aWhichClipboard) {
}
#ifdef ACCESSIBILITY
a11y::Compatibility::SuppressA11yForClipboardCopy();
mozilla::a11y::Compatibility::SuppressA11yForClipboardCopy();
#endif
RefPtr<IDataObject> dataObj;
@ -494,7 +498,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(int32_t aWhichClipboard) {
RepeatedlyTryOleSetClipboard(dataObj);
const bool doFlush = [&] {
switch (StaticPrefs::widget_windows_sync_clipboard_flush()) {
switch (mozilla::StaticPrefs::widget_windows_sync_clipboard_flush()) {
case 0:
return false;
case 1:
@ -508,7 +512,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData(int32_t aWhichClipboard) {
// lesser of the two performance/memory evils here and force immediate
// rendering.
return mightNeedToFlush == MightNeedToFlush::Yes &&
NeedsWindows11SuggestedActionsWorkaround();
mozilla::NeedsWindows11SuggestedActionsWorkaround();
}
}();
if (doFlush) {
@ -1401,7 +1405,8 @@ nsresult nsClipboard::SaveStorageOrStream(IDataObject* aDataObject, UINT aIndex,
return NS_ERROR_FAILURE;
}
auto releaseMediumGuard = MakeScopeExit([&] { ReleaseStgMedium(&stm); });
auto releaseMediumGuard =
mozilla::MakeScopeExit([&] { ReleaseStgMedium(&stm); });
// We do this check because, even though we *asked* for IStorage or IStream,
// it seems that IDataObject providers can just hand us back whatever they

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

@ -10,6 +10,7 @@
#include "nsToolkit.h"
#include "nsWidgetsCID.h"
#include "nsIDragService.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/dom/DataTransfer.h"
/*

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

@ -6,6 +6,7 @@
#include "nsPrintDialogWin.h"
#include "nsArray.h"
#include "nsComponentManagerUtils.h"
#include "nsCOMPtr.h"
#include "nsIBaseWindow.h"
#include "nsIBrowserChild.h"
@ -18,6 +19,7 @@
#include "nsPrintDialogUtil.h"
#include "nsIPrintSettings.h"
#include "nsIWebBrowserChrome.h"
#include "nsServiceManagerUtils.h"
#include "nsPIDOMWindow.h"
#include "nsQueryObject.h"

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

@ -11,6 +11,8 @@
#include "nsCOMPtr.h"
#include "nsIWindowWatcher.h"
#include <windef.h>
class nsIPrintSettings;
class nsIDialogParamBlock;

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

@ -13,8 +13,8 @@
#include "nsIServiceManager.h"
#include "nsWindowsHelpers.h"
#include "ipc/IPCMessageUtils.h"
const char kPrinterListContractID[] = "@mozilla.org/gfx/printerlist;1";
#include "chrome/common/ipc_channel.h"
#include "mozilla/embedding/PPrintingTypes.h"
using namespace mozilla::embedding;

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

@ -32,7 +32,9 @@
using mozilla::LogLevel;
#ifdef DEBUG
static mozilla::LazyLogModule gWin32SoundLog("nsSound");
#endif
// Hackaround for bug 1644240
// When we call PlaySound for the first time in the process, winmm.dll creates

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

@ -8,12 +8,16 @@
*/
#include "nsWindowDbg.h"
#include "nsToolkit.h"
#include "WinPointerEvents.h"
#include "nsWindowLoggedMessages.h"
#include "mozilla/Logging.h"
#include "mozilla/Maybe.h"
#include <winuser.h>
#include <dbt.h>
#include <imm.h>
#include <tpcshrd.h>
#include <unordered_set>
using namespace mozilla;

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

@ -25,6 +25,7 @@
#include "gfxEnv.h"
#include "gfxImageSurface.h"
#include "gfxUtils.h"
#include "gfxConfig.h"
#include "gfxWindowsSurface.h"
#include "gfxWindowsPlatform.h"
#include "gfxDWriteFonts.h"
@ -40,6 +41,8 @@
#include "nsIWidgetListener.h"
#include "mozilla/Unused.h"
#include "nsDebug.h"
#include "WindowRenderer.h"
#include "mozilla/layers/WebRenderLayerManager.h"
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/layers/CompositorBridgeParent.h"
@ -72,9 +75,6 @@ extern mozilla::LazyLogModule gWindowsLog;
*
**************************************************************/
static UniquePtr<uint8_t[]> sSharedSurfaceData;
static IntSize sSharedSurfaceSize;
struct IconMetrics {
int32_t xMetric;
int32_t yMetric;

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

@ -3,8 +3,10 @@
* 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 <windef.h>
#include <winuser.h>
#include "mozilla/StaticPrefs_storage.h"
#include "mozilla/StaticPrefs_widget.h"
#include "nsWindowLoggedMessages.h"
#include "nsWindow.h"
#include "WinUtils.h"

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

@ -10,6 +10,7 @@
#include <type_traits>
#include "nscore.h"
#include "nsIOutputStream.h"
#include "nsISupports.h"
#include "nsError.h"
#include "nsDebug.h"