Skip to content

Commit

Permalink
Bug 1265953, part 2 - Convert much of the rest of the widget code fro…
Browse files Browse the repository at this point in the history
…m nsAutoPtr to UniquePtr. r=mstange
  • Loading branch information
jwatt committed Apr 19, 2016
1 parent 05e8c46 commit 29f18ff
Show file tree
Hide file tree
Showing 36 changed files with 28 additions and 39 deletions.
1 change: 0 additions & 1 deletion widget/GfxInfoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "GfxDriverInfo.h"
#include "nsCOMPtr.h"
#include "nsCOMArray.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsUnicharUtils.h"
#include "nsVersionComparator.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/TextEventDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef mozilla_textcompositionsynthesizer_h_
#define mozilla_textcompositionsynthesizer_h_

#include "nsAutoPtr.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "mozilla/Attributes.h"
#include "mozilla/EventForwards.h"
Expand Down
1 change: 0 additions & 1 deletion widget/TextRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <stdint.h>

#include "nsAutoPtr.h"
#include "nsColor.h"
#include "nsITextInputProcessor.h"
#include "nsStyleConsts.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/TouchEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "mozilla/dom/Touch.h"
#include "mozilla/MouseEvents.h"
#include "nsAutoPtr.h"
#include "mozilla/RefPtr.h"
#include "nsIDOMSimpleGestureEvent.h"
#include "nsTArray.h"

Expand Down
7 changes: 4 additions & 3 deletions widget/gonk/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
* limitations under the License.
*/

#include "nsWindow.h"

#include "mozilla/DebugOnly.h"

#include <fcntl.h>

#include "android/log.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/Preferences.h"
#include "mozilla/RefPtr.h"
#include "mozilla/Services.h"
#include "mozilla/FileUtils.h"
#include "mozilla/ClearOnShutdown.h"
Expand All @@ -28,11 +31,9 @@
#include "GLContextProvider.h"
#include "GLContext.h"
#include "GLContextEGL.h"
#include "nsAutoPtr.h"
#include "nsAppShell.h"
#include "nsScreenManagerGonk.h"
#include "nsTArray.h"
#include "nsWindow.h"
#include "nsIWidgetListener.h"
#include "ClientLayerManager.h"
#include "BasicLayers.h"
Expand Down Expand Up @@ -267,7 +268,7 @@ nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId,
}

if (!mSynthesizedTouchInput) {
mSynthesizedTouchInput = new MultiTouchInput();
mSynthesizedTouchInput = MakeUnique<MultiTouchInput>();
}

ScreenIntPoint pointerScreenPoint = ViewAs<ScreenPixel>(aPoint,
Expand Down
3 changes: 2 additions & 1 deletion widget/gonk/nsWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define nsWindow_h

#include "InputData.h"
#include "mozilla/UniquePtr.h"
#include "nsBaseWidget.h"
#include "nsRegion.h"
#include "nsIIdleServiceInternal.h"
Expand Down Expand Up @@ -150,7 +151,7 @@ class nsWindow : public nsBaseWidget
private:
// This is used by SynthesizeNativeTouchPoint to maintain state between
// multiple synthesized points
nsAutoPtr<mozilla::MultiTouchInput> mSynthesizedTouchInput;
mozilla::UniquePtr<mozilla::MultiTouchInput> mSynthesizedTouchInput;

RefPtr<nsScreenGonk> mScreen;

Expand Down
1 change: 0 additions & 1 deletion widget/gtk/IMContextWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <gtk/gtk.h>

#include "nsString.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "nsIWidget.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsDragService.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef nsDragService_h__
#define nsDragService_h__

#include "nsAutoPtr.h"
#include "mozilla/RefPtr.h"
#include "nsBaseDragService.h"
#include "nsIObserver.h"
#include "nsAutoRef.h"
Expand Down
1 change: 0 additions & 1 deletion widget/gtk/nsImageToPixbuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "imgIContainer.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "nsAutoPtr.h"

using mozilla::gfx::DataSourceSurface;
using mozilla::gfx::SurfaceFormat;
Expand Down
3 changes: 2 additions & 1 deletion widget/gtk/nsScreenManagerGtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsScreenManagerGtk.h"

#include "mozilla/RefPtr.h"
#include "nsScreenGtk.h"
#include "nsIComponentManager.h"
#include "nsRect.h"
#include "nsAutoPtr.h"
#include "nsGtkUtils.h"

#define SCREEN_MANAGER_LIBRARY_LOAD_FAILED ((PRLibrary*)1)
Expand Down
1 change: 0 additions & 1 deletion widget/gtk/nsSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "nsNetUtil.h"
#include "nsIChannel.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
Expand Down
1 change: 0 additions & 1 deletion widget/gtk/nsWidgetFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

#include "nsIComponentRegistrar.h"
#include "nsComponentManagerUtils.h"
#include "nsAutoPtr.h"
#include "mozilla/gfx/2D.h"
#include <gtk/gtk.h>

Expand Down
5 changes: 3 additions & 2 deletions widget/gtk/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
* 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 "nsWindow.h"

#include "mozilla/ArrayUtils.h"
#include "mozilla/EventForwards.h"
#include "mozilla/MiscEvents.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/RefPtr.h"
#include "mozilla/TextEventDispatcher.h"
#include "mozilla/TextEvents.h"
#include "mozilla/TimeStamp.h"
Expand Down Expand Up @@ -100,7 +103,6 @@ using namespace mozilla::widget;
#include "nsGfxCIID.h"
#include "nsImageToPixbuf.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsAutoPtr.h"
#include "ClientLayerManager.h"

#include "gfxPlatformGtk.h"
Expand All @@ -121,7 +123,6 @@ using namespace mozilla::widget;
#include "nsIDOMWheelEvent.h"

#include "NativeKeyBindings.h"
#include "nsWindow.h"

#include <dlfcn.h>

Expand Down
1 change: 0 additions & 1 deletion widget/nsPrimitiveHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "nsPrimitiveHelpers.h"

#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/nsPrintOptionsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "mozilla/embedding/PPrinting.h"
#include "mozilla/layout/RemotePrintJobChild.h"
#include "mozilla/RefPtr.h"
#include "nsPrintingProxy.h"
#include "nsReadableUtils.h"
#include "nsPrintSettingsImpl.h"
Expand All @@ -24,7 +25,6 @@
#include "nsIStringEnumerator.h"
#include "nsISupportsPrimitives.h"
#include "stdlib.h"
#include "nsAutoPtr.h"
#include "mozilla/Preferences.h"
#include "nsPrintfCString.h"
#include "nsIWebBrowserPrint.h"
Expand Down
1 change: 0 additions & 1 deletion widget/nsShmImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "mozilla/gfx/2D.h"
#include "nsIWidget.h"
#include "nsAutoPtr.h"
#include "Units.h"

#include <X11/Xlib.h>
Expand Down
1 change: 0 additions & 1 deletion widget/nsTransferable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Notes to self:
#include "nsIWeakReferenceUtils.h"
#include "nsIFile.h"
#include "nsILoadContext.h"
#include "nsAutoPtr.h"

NS_IMPL_ISUPPORTS(nsTransferable, nsITransferable)

Expand Down
1 change: 0 additions & 1 deletion widget/qt/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include "imgIContainer.h"
#include "nsGfxCIID.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsAutoPtr.h"

#include "gfxQtPlatform.h"

Expand Down
1 change: 0 additions & 1 deletion widget/qt/nsWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include <QPointF>

#include "nsAutoPtr.h"
#include "nsBaseWidget.h"
#include "mozilla/EventForwards.h"

Expand Down
2 changes: 1 addition & 1 deletion widget/windows/AudioSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
#include <audiopolicy.h>
#include <mmdeviceapi.h>

#include "mozilla/RefPtr.h"
#include "nsIStringBundle.h"
#include "nsIUUIDGenerator.h"
#include "nsIXULAppInfo.h"

//#include "AudioSession.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsServiceManagerUtils.h"
#include "nsString.h"
#include "nsThreadUtils.h"
Expand Down
1 change: 0 additions & 1 deletion widget/windows/AudioSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* 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 "nsAutoPtr.h"
#include "nsString.h"

namespace mozilla {
Expand Down
1 change: 0 additions & 1 deletion widget/windows/JumpListBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "nsError.h"
#include "nsCOMPtr.h"
#include "nsServiceManagerUtils.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsArrayUtils.h"
#include "nsIMutableArray.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/windows/JumpListItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#include <shobjidl.h>
#undef LogSeverity // SetupAPI.h #defines this as DWORD

#include "mozilla/RefPtr.h"
#include "nsIJumpListItem.h" // defines nsIJumpListItem
#include "nsIMIMEInfo.h" // defines nsILocalHandlerApp
#include "nsTArray.h"
#include "nsIMutableArray.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsIURI.h"
#include "nsICryptoHash.h"
#include "nsString.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/windows/KeyboardLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef KeyboardLayout_h__
#define KeyboardLayout_h__

#include "mozilla/RefPtr.h"
#include "nscore.h"
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsWindowBase.h"
#include "nsWindowDefs.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/windows/TSFTextStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef TSFTextStore_h_
#define TSFTextStore_h_

#include "nsAutoPtr.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsCOMPtr.h"
#include "nsIWidget.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/windows/TaskbarPreview.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include <shobjidl.h>
#undef LogSeverity // SetupAPI.h #defines this as DWORD

#include "mozilla/RefPtr.h"
#include <nsITaskbarPreview.h>
#include <nsITaskbarPreviewController.h>
#include <nsAutoPtr.h>
#include <nsString.h>
#include <nsWeakPtr.h>
#include <nsIDocShell.h>
Expand Down
2 changes: 1 addition & 1 deletion widget/windows/TaskbarPreviewButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <shobjidl.h>
#undef LogSeverity // SetupAPI.h #defines this as DWORD

#include "mozilla/RefPtr.h"
#include <nsITaskbarPreviewButton.h>
#include <nsAutoPtr.h>
#include <nsString.h>
#include <nsWeakReference.h>

Expand Down
2 changes: 1 addition & 1 deletion widget/windows/WidgetTraceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <stdio.h>
#include <windows.h>

#include "mozilla/RefPtr.h"
#include "mozilla/WidgetTraceEvent.h"
#include "nsAppShellCID.h"
#include "nsComponentManagerUtils.h"
Expand All @@ -20,7 +21,6 @@
#include "nsISupportsImpl.h"
#include "nsIWidget.h"
#include "nsIXULWindow.h"
#include "nsAutoPtr.h"
#include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h"
#include "nsWindowDefs.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/windows/WinTaskbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include "TaskbarPreview.h"
#include <nsITaskbarPreviewController.h>

#include "mozilla/RefPtr.h"
#include <nsError.h>
#include <nsCOMPtr.h>
#include <nsIWidget.h>
#include <nsIBaseWindow.h>
#include <nsIObserverService.h>
#include <nsServiceManagerUtils.h>
#include <nsAutoPtr.h>
#include "nsIXULAppInfo.h"
#include "nsIJumpListBuilder.h"
#include "nsUXThemeData.h"
Expand Down
1 change: 0 additions & 1 deletion widget/windows/WinUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#undef GetBinaryType
#undef RemoveDirectory

#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsRegion.h"
#include "nsRect.h"
Expand Down
2 changes: 1 addition & 1 deletion widget/windows/nsDataObjCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <oleidl.h>

#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsDataObj.h"
#include "mozilla/Attributes.h"

Expand Down
2 changes: 1 addition & 1 deletion widget/windows/nsDeviceContextSpecWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/ArrayUtils.h"
#include "mozilla/RefPtr.h"

#include "nsDeviceContextSpecWin.h"
#include "prmem.h"
Expand All @@ -12,7 +13,6 @@

#include <tchar.h>

#include "nsAutoPtr.h"
#include "nsIWidget.h"

#include "nsTArray.h"
Expand Down
3 changes: 1 addition & 2 deletions widget/windows/nsDragService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// shellapi.h is needed to build with WIN32_LEAN_AND_MEAN
#include <shellapi.h>

#include "mozilla/RefPtr.h"
#include "nsDragService.h"
#include "nsITransferable.h"
#include "nsDataObj.h"
Expand All @@ -23,8 +24,6 @@
#include "nsIDocument.h"
#include "nsDataObjCollection.h"

#include "nsAutoPtr.h"

#include "nsString.h"
#include "nsEscape.h"
#include "nsISupportsPrimitives.h"
Expand Down
Loading

0 comments on commit 29f18ff

Please sign in to comment.