Bug 1510247. Fix some unified build issues in widget code. r=spohl
authorJonathan Watt <jwatt@jwatt.org>
Wed, 14 Nov 2018 17:03:36 +0000
changeset 505150 df022f193cb4b6d8f87504223adc2a2f8789be31
parent 505114 e54c1b4fa9c653c03d90600d7dd7d04279c1f889
child 505151 408677f045b29f5aedb53f27d14eed5908b06519
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs1510247
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1510247. Fix some unified build issues in widget code. r=spohl Differential Revision: https://phabricator.services.mozilla.com/D13061
widget/cocoa/GfxInfo.mm
widget/cocoa/RectTextureImage.h
widget/cocoa/ScreenHelperCocoa.mm
widget/cocoa/SwipeTracker.h
widget/cocoa/TextInputHandler.h
widget/cocoa/VibrancyManager.mm
widget/cocoa/ViewRegion.h
widget/cocoa/ViewRegion.mm
widget/cocoa/nsAppShell.mm
widget/cocoa/nsCocoaUtils.mm
widget/cocoa/nsDeviceContextSpecX.h
widget/cocoa/nsMacSharingService.mm
widget/cocoa/nsMenuItemIconX.h
widget/cocoa/nsMenuItemIconX.mm
widget/cocoa/nsMenuItemX.mm
widget/cocoa/nsMenuX.h
widget/cocoa/nsPrintSettingsX.mm
widget/headless/HeadlessWidget.cpp
widget/nsDragServiceProxy.cpp
widget/nsIDeviceContextSpec.h
widget/nsNativeTheme.cpp
widget/nsNativeTheme.h
widget/nsPrintSettingsService.h
widget/nsTransferable.cpp
--- a/widget/cocoa/GfxInfo.mm
+++ b/widget/cocoa/GfxInfo.mm
@@ -7,16 +7,17 @@
 #include <OpenGL/CGLRenderers.h>
 
 #include "mozilla/ArrayUtils.h"
 
 #include "GfxInfo.h"
 #include "nsUnicharUtils.h"
 #include "nsExceptionHandler.h"
 #include "nsCocoaFeatures.h"
+#include "nsCocoaUtils.h"
 #include "nsICrashReporter.h"
 #include "mozilla/Preferences.h"
 #include <algorithm>
 
 #import <Foundation/Foundation.h>
 #import <IOKit/IOKitLib.h>
 #import <Cocoa/Cocoa.h>
 
--- a/widget/cocoa/RectTextureImage.h
+++ b/widget/cocoa/RectTextureImage.h
@@ -1,26 +1,33 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 RectTextureImage_h_
 #define RectTextureImage_h_
 
+#include "GLTypes.h"
+#include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
+#include "Units.h"
 
 class MacIOSurface;
 
 namespace mozilla {
 
 namespace gl {
 class GLContext;
 } // namespace gl
 
+namespace layers {
+class GLManager;
+} // namespace layers
+
 namespace widget {
 
 // Manages a texture which can resize dynamically, binds to the
 // LOCAL_GL_TEXTURE_RECTANGLE_ARB texture target and is automatically backed
 // by a power-of-two size GL texture. The latter two features are used for
 // compatibility with older Mac hardware which we block GL layers on.
 // RectTextureImages are used both for accelerated GL layers drawing and for
 // OMTC BasicLayers drawing.
--- a/widget/cocoa/ScreenHelperCocoa.mm
+++ b/widget/cocoa/ScreenHelperCocoa.mm
@@ -7,16 +7,18 @@
 #include "ScreenHelperCocoa.h"
 
 #import <Cocoa/Cocoa.h>
 
 #include "mozilla/Logging.h"
 #include "nsCocoaUtils.h"
 #include "nsObjCExceptions.h"
 
+using namespace mozilla;
+
 static LazyLogModule sScreenLog("WidgetScreen");
 
 @interface ScreenHelperDelegate : NSObject
 {
   @private
     mozilla::widget::ScreenHelperCocoa* mHelper;
 }
 
--- a/widget/cocoa/SwipeTracker.h
+++ b/widget/cocoa/SwipeTracker.h
@@ -9,17 +9,19 @@
 
 #include "EventForwards.h"
 #include "mozilla/layers/AxisPhysicsMSDModel.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/TimeStamp.h"
 #include "nsRefreshDriver.h"
 #include "Units.h"
 
+class nsChildView;
 class nsIPresShell;
+class nsIWidget;
 
 namespace mozilla {
 
 class PanGestureInput;
 
 /**
  * SwipeTracker turns PanGestureInput events into swipe events
  * (WidgetSimpleGestureEvent) and dispatches them into Gecko.
--- a/widget/cocoa/TextInputHandler.h
+++ b/widget/cocoa/TextInputHandler.h
@@ -11,16 +11,17 @@
 
 #import <Carbon/Carbon.h>
 #import <Cocoa/Cocoa.h>
 #include "mozView.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsITimer.h"
 #include "nsTArray.h"
+#include "mozilla/BasicEvents.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/TextEventDispatcherListener.h"
 #include "WritingModes.h"
 
 class nsChildView;
 
 namespace mozilla {
 namespace widget {
--- a/widget/cocoa/VibrancyManager.mm
+++ b/widget/cocoa/VibrancyManager.mm
@@ -1,16 +1,18 @@
 /* -*- 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/. */
 
 #include "VibrancyManager.h"
+
 #include "nsChildView.h"
+#include "nsCocoaFeatures.h"
 #import <objc/message.h>
 
 using namespace mozilla;
 
 void
 VibrancyManager::UpdateVibrantRegion(VibrancyType aType,
                                      const LayoutDeviceIntRegion& aRegion)
 {
--- a/widget/cocoa/ViewRegion.h
+++ b/widget/cocoa/ViewRegion.h
@@ -5,16 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef ViewRegion_h
 #define ViewRegion_h
 
 #include "Units.h"
 #include "nsTArray.h"
 
+class nsChildView;
+
 @class NSView;
 
 namespace mozilla {
 
 /**
  * Manages a set of NSViews to cover a LayoutDeviceIntRegion.
  */
 class ViewRegion {
@@ -36,17 +38,17 @@ public:
   bool UpdateRegion(const mozilla::LayoutDeviceIntRegion& aRegion,
                     const nsChildView& aCoordinateConverter,
                     NSView* aContainerView,
                     NSView* (^aViewCreationCallback)());
 
   /**
    * Return an NSView from the region, if there is any.
    */
-  NSView* GetAnyView() { return mViews.Length() > 0 ? mViews[0] : nil; }
+  NSView* GetAnyView() { return mViews.Length() > 0 ? mViews[0] : NULL; }
 
 private:
   mozilla::LayoutDeviceIntRegion mRegion;
   nsTArray<NSView*> mViews;
 };
 
 } // namespace mozilla
 
--- a/widget/cocoa/ViewRegion.mm
+++ b/widget/cocoa/ViewRegion.mm
@@ -2,16 +2,18 @@
 /* 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/. */
 
 #include "ViewRegion.h"
 #import <Cocoa/Cocoa.h>
 
+#include "nsChildView.h"
+
 using namespace mozilla;
 
 ViewRegion::~ViewRegion()
 {
   for (size_t i = 0; i < mViews.Length(); i++) {
     [mViews[i] removeFromSuperview];
   }
 }
--- a/widget/cocoa/nsAppShell.mm
+++ b/widget/cocoa/nsAppShell.mm
@@ -40,16 +40,17 @@
 #if !defined(RELEASE_OR_BETA) || defined(DEBUG)
 #include "nsSandboxViolationSink.h"
 #endif
 
 #include <IOKit/pwr_mgt/IOPMLib.h>
 #include "nsIDOMWakeLockListener.h"
 #include "nsIPowerManagerService.h"
 
+using namespace mozilla;
 using namespace mozilla::widget;
 
 #define WAKE_LOCK_LOG(...) MOZ_LOG(gMacWakeLockLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
 static mozilla::LazyLogModule gMacWakeLockLog("MacWakeLock");
 
 // A wake lock listener that disables screen saver when requested by
 // Gecko. For example when we're playing video in a foreground tab we
 // don't want the screen saver to turn on.
--- a/widget/cocoa/nsCocoaUtils.mm
+++ b/widget/cocoa/nsCocoaUtils.mm
@@ -9,16 +9,17 @@
 
 #include "gfx2DGlue.h"
 #include "gfxPlatform.h"
 #include "gfxUtils.h"
 #include "ImageRegion.h"
 #include "nsCocoaUtils.h"
 #include "nsChildView.h"
 #include "nsMenuBarX.h"
+#include "nsCocoaFeatures.h"
 #include "nsCocoaWindow.h"
 #include "nsCOMPtr.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIAppShellService.h"
 #include "nsIOSPermissionRequest.h"
 #include "nsIRunnable.h"
 #include "nsIXULWindow.h"
 #include "nsIBaseWindow.h"
--- a/widget/cocoa/nsDeviceContextSpecX.h
+++ b/widget/cocoa/nsDeviceContextSpecX.h
@@ -3,16 +3,18 @@
  * 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 nsDeviceContextSpecX_h_
 #define nsDeviceContextSpecX_h_
 
 #include "nsIDeviceContextSpec.h"
 
+#include "nsCOMPtr.h"
+
 #include <ApplicationServices/ApplicationServices.h>
 
 class nsDeviceContextSpecX : public nsIDeviceContextSpec
 {
 public:
     NS_DECL_ISUPPORTS
 
     nsDeviceContextSpecX();
--- a/widget/cocoa/nsMacSharingService.mm
+++ b/widget/cocoa/nsMacSharingService.mm
@@ -1,16 +1,18 @@
 /* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
 /* 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/. */
 
 #import <Cocoa/Cocoa.h>
 
 #include "nsMacSharingService.h"
+
+#include "jsapi.h"
 #include "nsCocoaUtils.h"
 #include "mozilla/MacStringHelpers.h"
 
 NS_IMPL_ISUPPORTS(nsMacSharingService, nsIMacSharingService)
 
 // List of sharingProviders that we do not want to expose to
 // the user, because they are duplicates or do not work correctly
 // within the context
--- a/widget/cocoa/nsMenuItemIconX.h
+++ b/widget/cocoa/nsMenuItemIconX.h
@@ -12,16 +12,17 @@
 
 #include "mozilla/RefPtr.h"
 #include "nsCOMPtr.h"
 #include "imgINotificationObserver.h"
 #include "nsIContentPolicy.h"
 
 class nsIURI;
 class nsIContent;
+class nsIPrincipal;
 class imgRequestProxy;
 class nsMenuObjectX;
 
 #import <Cocoa/Cocoa.h>
 
 class nsMenuItemIconX : public imgINotificationObserver
 {
 public:
--- a/widget/cocoa/nsMenuItemIconX.mm
+++ b/widget/cocoa/nsMenuItemIconX.mm
@@ -35,16 +35,18 @@
 #include "nsMenuItemX.h"
 #include "gfxPlatform.h"
 #include "imgIContainer.h"
 #include "nsCocoaUtils.h"
 #include "nsContentUtils.h"
 #include "nsIContentPolicy.h"
 #include "nsComputedDOMStyle.h"
 
+using namespace mozilla;
+
 using mozilla::dom::Element;
 using mozilla::gfx::SourceSurface;
 
 static const uint32_t kIconWidth = 16;
 static const uint32_t kIconHeight = 16;
 
 NS_IMPL_ISUPPORTS(nsMenuItemIconX, imgINotificationObserver)
 
--- a/widget/cocoa/nsMenuItemX.mm
+++ b/widget/cocoa/nsMenuItemX.mm
@@ -16,16 +16,18 @@
 #include "nsGkAtoms.h"
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/ErrorResult.h"
 #include "nsIWidget.h"
 #include "nsIDocument.h"
 
+using namespace mozilla;
+
 using mozilla::dom::Event;
 using mozilla::dom::CallerType;
 
 nsMenuItemX::nsMenuItemX()
 {
   mType           = eRegularMenuItemType;
   mNativeMenuItem = nil;
   mMenuParent     = nullptr;
--- a/widget/cocoa/nsMenuX.h
+++ b/widget/cocoa/nsMenuX.h
@@ -3,16 +3,17 @@
  * 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 nsMenuX_h_
 #define nsMenuX_h_
 
 #import <Cocoa/Cocoa.h>
 
+#include "mozilla/EventForwards.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "nsMenuBaseX.h"
 #include "nsMenuBarX.h"
 #include "nsMenuGroupOwnerX.h"
 #include "nsCOMPtr.h"
 #include "nsChangeObserver.h"
 
--- a/widget/cocoa/nsPrintSettingsX.mm
+++ b/widget/cocoa/nsPrintSettingsX.mm
@@ -5,16 +5,17 @@
 
 #include "nsPrintSettingsX.h"
 #include "nsObjCExceptions.h"
 
 #include "plbase64.h"
 #include "plstr.h"
 
 #include "nsCocoaUtils.h"
+#include "nsXULAppAPI.h"
 
 #include "mozilla/Preferences.h"
 
 using namespace mozilla;
 
 #define MAC_OS_X_PAGE_SETUP_PREFNAME    "print.macosx.pagesetup-2"
 #define COCOA_PAPER_UNITS_PER_INCH      72.0
 
--- a/widget/headless/HeadlessWidget.cpp
+++ b/widget/headless/HeadlessWidget.cpp
@@ -6,18 +6,22 @@
 #include "HeadlessCompositorWidget.h"
 #include "Layers.h"
 #include "BasicLayers.h"
 #include "BasicEvents.h"
 #include "MouseEvents.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/TextEvents.h"
+#include "mozilla/widget/HeadlessWidgetTypes.h"
+#include "mozilla/widget/PlatformWidgetTypes.h"
+#include "nsIScreen.h"
 #include "HeadlessKeyBindings.h"
 
+using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::layers;
 
 using mozilla::LogLevel;
 
 #ifdef MOZ_LOGGING
 
 #include "mozilla/Logging.h"
--- a/widget/nsDragServiceProxy.cpp
+++ b/widget/nsDragServiceProxy.cpp
@@ -8,19 +8,23 @@
 #include "nsIDocument.h"
 #include "nsISupportsPrimitives.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/Unused.h"
 #include "nsContentUtils.h"
 
+using mozilla::CSSIntRegion;
 using mozilla::ipc::Shmem;
 using mozilla::dom::TabChild;
 using mozilla::dom::OptionalShmem;
+using mozilla::gfx::DataSourceSurface;
+using mozilla::gfx::SourceSurface;
+using mozilla::gfx::SurfaceFormat;
 using mozilla::LayoutDeviceIntRect;
 using mozilla::Maybe;
 
 nsDragServiceProxy::nsDragServiceProxy()
 {
 }
 
 nsDragServiceProxy::~nsDragServiceProxy()
@@ -61,22 +65,21 @@ nsDragServiceProxy::InvokeDragSessionImp
                                                   nullptr);
 
   nsCString principalURISpec;
   GetPrincipalURIFromNode(mSourceNode, principalURISpec);
 
   LayoutDeviceIntRect dragRect;
   if (mHasImage || mSelection) {
     nsPresContext* pc;
-    RefPtr<mozilla::gfx::SourceSurface> surface;
+    RefPtr<SourceSurface> surface;
     DrawDrag(mSourceNode, aRegion, mScreenPosition, &dragRect, &surface, &pc);
 
     if (surface) {
-      RefPtr<mozilla::gfx::DataSourceSurface> dataSurface =
-        surface->GetDataSurface();
+      RefPtr<DataSourceSurface> dataSurface = surface->GetDataSurface();
       if (dataSurface) {
         size_t length;
         int32_t stride;
         Maybe<Shmem> maybeShm = nsContentUtils::GetSurfaceData(dataSurface,
                                                                &length,
                                                                &stride,
                                                                child);
         if (maybeShm.isNothing()) {
@@ -96,14 +99,14 @@ nsDragServiceProxy::InvokeDragSessionImp
                                        stride, dataSurface->GetFormat(),
                                        dragRect, principalURISpec);
         StartDragSession();
         return NS_OK;
       }
     }
   }
 
-  mozilla::Unused << child->SendInvokeDragSession(dataTransfers, aActionType,
-                                                  mozilla::void_t(), 0, static_cast<gfx::SurfaceFormat>(0), dragRect,
-                                                  principalURISpec);
+  mozilla::Unused << child->SendInvokeDragSession(
+      dataTransfers, aActionType, mozilla::void_t(), 0,
+      static_cast<SurfaceFormat>(0), dragRect, principalURISpec);
   StartDragSession();
   return NS_OK;
 }
--- a/widget/nsIDeviceContextSpec.h
+++ b/widget/nsIDeviceContextSpec.h
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 nsIDeviceContextSpec_h___
 #define nsIDeviceContextSpec_h___
 
+#include "gfxPoint.h"
 #include "nsISupports.h"
 
 class nsIWidget;
 class nsIPrintSettings;
 
 namespace mozilla {
 namespace gfx{
 class DrawEventRecorder;
--- a/widget/nsNativeTheme.cpp
+++ b/widget/nsNativeTheme.cpp
@@ -17,16 +17,17 @@
 #include "nsStyleConsts.h"
 #include "nsIComponentManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsProgressFrame.h"
 #include "nsMeterFrame.h"
 #include "nsMenuFrame.h"
 #include "nsRangeFrame.h"
 #include "nsCSSRendering.h"
+#include "mozilla/ComputedStyle.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLBodyElement.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/HTMLProgressElement.h"
 #include "mozilla/StaticPrefs.h"
 #include "nsIDocumentInlines.h"
 #include <algorithm>
--- a/widget/nsNativeTheme.h
+++ b/widget/nsNativeTheme.h
@@ -6,16 +6,17 @@
 // This defines a common base class for nsITheme implementations, to reduce
 // code duplication.
 
 #ifndef _NSNATIVETHEME_H_
 #define _NSNATIVETHEME_H_
 
 #include "nsAlgorithm.h"
 #include "nsAtom.h"
+#include "nsColor.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsMargin.h"
 #include "nsGkAtoms.h"
 #include "nsTArray.h"
 #include "nsINamed.h"
 #include "nsITimer.h"
 #include "nsIContent.h"
--- a/widget/nsPrintSettingsService.h
+++ b/widget/nsPrintSettingsService.h
@@ -4,22 +4,21 @@
  * 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 nsPrintSettingsService_h
 #define nsPrintSettingsService_h
 
 #include "mozilla/embedding/PPrinting.h"
 #include "nsCOMPtr.h"
+#include "nsIPrintSettings.h"
 #include "nsIPrintSettingsService.h"
 #include "nsString.h"
 #include "nsFont.h"
 
-class nsIPrintSettings;
-
 /**
  * Class nsPrintSettingsService.  Base class for the platform specific widget
  * subclasses to inherit from.
  */
 class nsPrintSettingsService : public nsIPrintSettingsService
 {
 public:
   NS_DECL_ISUPPORTS
--- a/widget/nsTransferable.cpp
+++ b/widget/nsTransferable.cpp
@@ -29,16 +29,17 @@ Notes to self:
 #include "nsPrimitiveHelpers.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryService.h"
 #include "nsCRT.h"
 #include "nsNetUtil.h"
 #include "nsIOutputStream.h"
 #include "nsIInputStream.h"
 #include "nsILoadContext.h"
+#include "nsXULAppAPI.h"
 #include "mozilla/UniquePtr.h"
 
 using namespace mozilla;
 
 NS_IMPL_ISUPPORTS(nsTransferable, nsITransferable)
 
 DataStruct::DataStruct(DataStruct&& aRHS)
   : mData(aRHS.mData.forget())