зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1265953, part 1 - Convert most of the cocoa widget code from nsAutoPtr to UniquePtr. r=mstange
This commit is contained in:
Родитель
1be1083028
Коммит
3e920b7fa1
|
@ -650,10 +650,10 @@ protected:
|
|||
CGContextRef mTitlebarCGContext;
|
||||
|
||||
// Compositor thread only
|
||||
nsAutoPtr<RectTextureImage> mResizerImage;
|
||||
nsAutoPtr<RectTextureImage> mCornerMaskImage;
|
||||
nsAutoPtr<RectTextureImage> mTitlebarImage;
|
||||
nsAutoPtr<RectTextureImage> mBasicCompositorImage;
|
||||
mozilla::UniquePtr<RectTextureImage> mResizerImage;
|
||||
mozilla::UniquePtr<RectTextureImage> mCornerMaskImage;
|
||||
mozilla::UniquePtr<RectTextureImage> mTitlebarImage;
|
||||
mozilla::UniquePtr<RectTextureImage> mBasicCompositorImage;
|
||||
|
||||
// The area of mTitlebarCGContext that has changed and needs to be
|
||||
// uploaded to to mTitlebarImage. Main thread only.
|
||||
|
|
|
@ -2072,7 +2072,7 @@ nsChildView::MaybeDrawResizeIndicator(GLManager* aManager)
|
|||
}
|
||||
|
||||
if (!mResizerImage) {
|
||||
mResizerImage = new RectTextureImage(aManager->gl());
|
||||
mResizerImage = MakeUnique<RectTextureImage>(aManager->gl());
|
||||
}
|
||||
|
||||
LayoutDeviceIntSize size = mResizeIndicatorRect.Size();
|
||||
|
@ -2286,7 +2286,7 @@ nsChildView::MaybeDrawTitlebar(GLManager* aManager)
|
|||
mUpdatedTitlebarRegion.SetEmpty();
|
||||
|
||||
if (!mTitlebarImage) {
|
||||
mTitlebarImage = new RectTextureImage(aManager->gl());
|
||||
mTitlebarImage = MakeUnique<RectTextureImage>(aManager->gl());
|
||||
}
|
||||
|
||||
mTitlebarImage->UpdateFromCGContext(mTitlebarRect.Size(),
|
||||
|
@ -2310,7 +2310,7 @@ nsChildView::MaybeDrawRoundedCorners(GLManager* aManager,
|
|||
MutexAutoLock lock(mEffectsLock);
|
||||
|
||||
if (!mCornerMaskImage) {
|
||||
mCornerMaskImage = new RectTextureImage(aManager->gl());
|
||||
mCornerMaskImage = MakeUnique<RectTextureImage>(aManager->gl());
|
||||
}
|
||||
|
||||
LayoutDeviceIntSize size(mDevPixelCornerRadius, mDevPixelCornerRadius);
|
||||
|
@ -2631,7 +2631,7 @@ nsChildView::StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
|
|||
LayoutDeviceIntSize renderSize = mBounds.Size();
|
||||
|
||||
if (!mBasicCompositorImage) {
|
||||
mBasicCompositorImage = new RectTextureImage(mGLPresenter->gl());
|
||||
mBasicCompositorImage = MakeUnique<RectTextureImage>(mGLPresenter->gl());
|
||||
}
|
||||
|
||||
RefPtr<gfx::DrawTarget> drawTarget =
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsBaseWidget.h"
|
||||
#include "nsPIWidgetCocoa.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCocoaUtils.h"
|
||||
|
||||
class nsCocoaWindow;
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
|
||||
#include "nsDeviceContextSpecX.h"
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCRT.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIPrintOptions.h"
|
||||
|
|
|
@ -120,7 +120,7 @@ protected:
|
|||
int tag, NativeMenuItemTarget* target);
|
||||
nsresult CreateApplicationMenu(nsMenuX* inMenu);
|
||||
|
||||
nsTArray< nsAutoPtr<nsMenuX> > mMenuArray;
|
||||
nsTArray<mozilla::UniquePtr<nsMenuX>> mMenuArray;
|
||||
nsIWidget* mParentWindow; // [weak]
|
||||
GeckoNSMenu* mNativeMenu; // root menu, representing entire menu bar
|
||||
};
|
||||
|
|
|
@ -306,7 +306,7 @@ void nsMenuBarX::ForceUpdateNativeMenuAt(const nsAString& indexString)
|
|||
uint32_t length = mMenuArray.Length();
|
||||
// first find a menu in the menu bar
|
||||
for (unsigned int i = 0; i < length; i++) {
|
||||
nsMenuX* menu = mMenuArray[i];
|
||||
nsMenuX* menu = mMenuArray[i].get();
|
||||
if (!nsMenuUtilsX::NodeIsHiddenOrCollapsed(menu->Content())) {
|
||||
visible++;
|
||||
if (visible == (targetIndex + 1)) {
|
||||
|
@ -366,7 +366,7 @@ nsMenuX* nsMenuBarX::GetMenuAt(uint32_t aIndex)
|
|||
NS_ERROR("Requesting menu at invalid index!");
|
||||
return NULL;
|
||||
}
|
||||
return mMenuArray[aIndex];
|
||||
return mMenuArray[aIndex].get();
|
||||
}
|
||||
|
||||
nsMenuX* nsMenuBarX::GetXULHelpMenu()
|
||||
|
|
|
@ -12,10 +12,8 @@
|
|||
#include "nsIMutationObserver.h"
|
||||
#include "nsHashKeys.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
|
||||
class nsMenuItemX;
|
||||
class nsChangeObserver;
|
||||
class nsIWidget;
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#ifndef nsMenuItemIconX_h_
|
||||
#define nsMenuItemIconX_h_
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "imgINotificationObserver.h"
|
||||
|
||||
class nsIURI;
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
#ifndef nsMenuItemX_h_
|
||||
#define nsMenuItemX_h_
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsMenuBaseX.h"
|
||||
#include "nsMenuGroupOwnerX.h"
|
||||
#include "nsChangeObserver.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIScreenManager.h"
|
||||
#include "nsScreenCocoa.h"
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
#ifndef nsSystemStatusBarCocoa_h_
|
||||
#define nsSystemStatusBarCocoa_h_
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsISystemStatusBar.h"
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
class nsStandaloneNativeMenu;
|
||||
@class NSStatusItem;
|
||||
|
|
Загрузка…
Ссылка в новой задаче