Bug 1399787 - Part 1. Fix namespacing and include issues hidden by unified compilation. draft
authorcku <cku@mozilla.com>
Fri, 06 Oct 2017 22:01:22 +0800
changeset 709044 9106ae82cf4f7b72c39485d3cb634ae39cae0e40
parent 709018 e30c06a1074c2455f47e0bafb9bb84ec1a09d682
child 709045 a565fda4b6ca421eac92b45ab30812cf51ccd24b
push id92525
push usercku@mozilla.com
push dateThu, 07 Dec 2017 14:36:53 +0000
bugs1399787
milestone59.0a1
Bug 1399787 - Part 1. Fix namespacing and include issues hidden by unified compilation. We will create several new files in the following patches for IPC and a new subprocess. Several already existed files will be shifted into new build units, we will meet several compile errors because of it. This patch fixes those compile error in advance. MozReview-Commit-ID: 5hd0sNYfBu0
gfx/thebes/gfxFontSrcPrincipal.cpp
widget/nsBaseClipboard.h
widget/windows/InkCollector.h
widget/windows/ScreenHelperWin.cpp
widget/windows/nsColorPicker.cpp
widget/windows/nsDataObj.cpp
widget/windows/nsDeviceContextSpecWin.cpp
widget/windows/nsSound.cpp
--- a/gfx/thebes/gfxFontSrcPrincipal.cpp
+++ b/gfx/thebes/gfxFontSrcPrincipal.cpp
@@ -2,16 +2,19 @@
  * 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 "gfxFontSrcPrincipal.h"
 
 #include "nsProxyRelease.h"
 #include "nsURIHashKey.h"
+#include "mozilla/BasePrincipal.h"
+
+using mozilla::BasePrincipal;
 
 gfxFontSrcPrincipal::gfxFontSrcPrincipal(nsIPrincipal* aPrincipal)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aPrincipal);
 
   mPrincipal = aPrincipal;
 
--- a/widget/nsBaseClipboard.h
+++ b/widget/nsBaseClipboard.h
@@ -35,13 +35,12 @@ protected:
 
   NS_IMETHOD SetNativeClipboardData ( int32_t aWhichClipboard ) = 0;
   NS_IMETHOD GetNativeClipboardData ( nsITransferable * aTransferable, int32_t aWhichClipboard ) = 0;
 
   bool                mEmptyingForSetData;
   bool                mIgnoreEmptyNotification;
   nsCOMPtr<nsIClipboardOwner> mClipboardOwner;
   nsCOMPtr<nsITransferable>   mTransferable;
-
 };
 
 #endif // nsBaseClipboard_h__
 
--- a/widget/windows/InkCollector.h
+++ b/widget/windows/InkCollector.h
@@ -59,17 +59,17 @@ public:
   HWND GetTarget();
   void SetTarget(HWND aTargetWindow);
   void ClearTarget();
 
   uint16_t GetPointerId(); // 0 shows that there is no existing pen.
   void SetPointerId(uint16_t aPointerId);
   void ClearPointerId();
 
-  static StaticAutoPtr<InkCollector> sInkCollector;
+  static mozilla::StaticAutoPtr<InkCollector> sInkCollector;
 
 protected:
   void Initialize();
   void OnInitialize();
   void Enable(bool aNewState);
 
 private:
   RefPtr<IUnknown>          mMarshaller;
--- a/widget/windows/ScreenHelperWin.cpp
+++ b/widget/windows/ScreenHelperWin.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ScreenHelperWin.h"
 
 #include "mozilla/Logging.h"
 #include "nsTArray.h"
 #include "WinUtils.h"
 
-static LazyLogModule sScreenLog("WidgetScreen");
+static mozilla::LazyLogModule sScreenLog("WidgetScreen");
 
 namespace mozilla {
 namespace widget {
 
 BOOL CALLBACK
 CollectMonitors(HMONITOR aMon, HDC hDCScreen, LPRECT, LPARAM ioParam)
 {
   auto screens = reinterpret_cast<nsTArray<RefPtr<Screen>>*>(ioParam);
--- a/widget/windows/nsColorPicker.cpp
+++ b/widget/windows/nsColorPicker.cpp
@@ -7,16 +7,17 @@
 #include "nsColorPicker.h"
 
 #include <shlwapi.h>
 
 #include "mozilla/AutoRestore.h"
 #include "nsIWidget.h"
 #include "nsString.h"
 #include "WidgetUtils.h"
+#include "nsPIDOMWindow.h"
 
 using namespace mozilla::widget;
 
 namespace
 {
 // Manages NS_NATIVE_TMP_WINDOW child windows. NS_NATIVE_TMP_WINDOWs are
 // temporary child windows of mParentWidget created to address RTL issues
 // in picker dialogs. We are responsible for destroying these.
--- a/widget/windows/nsDataObj.cpp
+++ b/widget/windows/nsDataObj.cpp
@@ -29,16 +29,17 @@
 #include "nscore.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsITimer.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Preferences.h"
 #include "nsIContentPolicy.h"
 #include "nsContentUtils.h"
 #include "nsIPrincipal.h"
+#include "nsNativeCharsetUtils.h"
 
 #include "WinUtils.h"
 #include "mozilla/LazyIdleThread.h"
 #include <algorithm>
 
 
 using namespace mozilla;
 using namespace mozilla::widget;
--- a/widget/windows/nsDeviceContextSpecWin.cpp
+++ b/widget/windows/nsDeviceContextSpecWin.cpp
@@ -33,16 +33,19 @@
 #include "nsWindowsHelpers.h"
 
 #include "mozilla/gfx/Logging.h"
 
 #ifdef MOZ_ENABLE_SKIA_PDF
 #include "mozilla/gfx/PrintTargetSkPDF.h"
 #include "nsIUUIDGenerator.h"
 #include "mozilla/widget/PDFViaEMFPrintHelper.h"
+#include "nsDirectoryServiceDefs.h"
+#include "nsPrintfCString.h"
+#include "nsThreadUtils.h"
 #endif
 
 static mozilla::LazyLogModule kWidgetPrintingLogMod("printing-widget");
 #define PR_PL(_p1)  MOZ_LOG(kWidgetPrintingLogMod, mozilla::LogLevel::Debug, _p1)
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
--- a/widget/windows/nsSound.cpp
+++ b/widget/windows/nsSound.cpp
@@ -23,16 +23,17 @@
 #include "nsIObserverService.h"
 
 #include "mozilla/Logging.h"
 #include "prtime.h"
 
 #include "nsNativeCharsetUtils.h"
 #include "nsThreadUtils.h"
 #include "mozilla/ClearOnShutdown.h"
+#include "gfxPlatform.h"
 
 using mozilla::LogLevel;
 
 static mozilla::LazyLogModule gWin32SoundLog("nsSound");
 
 class nsSoundPlayer: public mozilla::Runnable {
 public:
   explicit nsSoundPlayer(const nsAString& aSoundName)
@@ -87,17 +88,17 @@ nsSoundPlayer::~nsSoundPlayer()
 
 mozilla::StaticRefPtr<nsISound> nsSound::sInstance;
 
 /* static */ already_AddRefed<nsISound>
 nsSound::GetInstance()
 {
   if (!sInstance) {
     if (gfxPlatform::IsHeadless()) {
-      sInstance = new widget::HeadlessSound();
+      sInstance = new mozilla::widget::HeadlessSound();
     } else {
       RefPtr<nsSound> sound = new nsSound();
       nsresult rv = sound->CreatePlayerThread();
       if(NS_WARN_IF(NS_FAILED(rv))) {
         return nullptr;
       }
       sInstance = sound.forget();
     }