Bug 1118076 - Remove MOZ_THIS_IN_INITIALIZER_LIST. r=Waldo

This commit is contained in:
Chris Peterson 2015-01-06 21:39:46 -08:00
parent 44dc24880a
commit 90751d5a6c
65 changed files with 93 additions and 151 deletions

View File

@ -2110,7 +2110,7 @@ private:
uint32_t mLength;
};
public:
StringBuilder() : mLast(MOZ_THIS_IN_INITIALIZER_LIST()), mLength(0)
StringBuilder() : mLast(this), mLength(0)
{
MOZ_COUNT_CTOR(StringBuilder);
}

View File

@ -293,7 +293,7 @@ ImportLoader::ImportLoader(nsIURI* aURI, nsIDocument* aImportParent)
, mReady(false)
, mStopped(false)
, mBlockingScripts(false)
, mUpdater(MOZ_THIS_IN_INITIALIZER_LIST())
, mUpdater(this)
{
}

View File

@ -317,7 +317,7 @@ public:
mNextSibling(nullptr),
mPreviousSibling(nullptr),
mFirstChild(nullptr),
mSubtreeRoot(MOZ_THIS_IN_INITIALIZER_LIST()),
mSubtreeRoot(this),
mSlots(nullptr)
{
}

View File

@ -136,7 +136,6 @@ private:
TypedArray_base(const TypedArray_base&) = delete;
};
template<typename T,
JSObject* UnwrapArray(JSObject*),
T* GetData(JSObject*, const JS::AutoCheckCannotGC&),
@ -301,16 +300,14 @@ class MOZ_STACK_CLASS RootedTypedArray : public ArrayType,
public:
explicit RootedTypedArray(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
ArrayType(),
TypedArrayRooter<ArrayType>(cx,
MOZ_THIS_IN_INITIALIZER_LIST()
TypedArrayRooter<ArrayType>(cx, this
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
{
}
RootedTypedArray(JSContext* cx, JSObject* obj MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
ArrayType(obj),
TypedArrayRooter<ArrayType>(cx,
MOZ_THIS_IN_INITIALIZER_LIST()
TypedArrayRooter<ArrayType>(cx, this
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
{
}

View File

@ -36,7 +36,7 @@ DOMCameraDetectedFace::DOMCameraDetectedFace(nsISupports* aParent,
: mParent(aParent)
, mId(aFace.id)
, mScore(aFace.score)
, mBounds(new DOMRect(MOZ_THIS_IN_INITIALIZER_LIST()))
, mBounds(new DOMRect(this))
{
mBounds->SetRect(aFace.bound.left,
aFace.bound.top,

View File

@ -28,7 +28,7 @@ public:
explicit HTMLAnchorElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
, Link(this)
{
}

View File

@ -19,7 +19,7 @@ namespace dom {
HTMLAreaElement::HTMLAreaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
, Link(this)
{
}

View File

@ -88,7 +88,7 @@ bool HTMLFormElement::gPasswordManagerInitialized = false;
HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mControls(new HTMLFormControlsCollection(MOZ_THIS_IN_INITIALIZER_LIST())),
mControls(new HTMLFormControlsCollection(this)),
mSelectedRadioButtons(2),
mRequiredRadioButtonCounts(2),
mValueMissingRadioGroups(2),

View File

@ -37,7 +37,7 @@ namespace dom {
HTMLLinkElement::HTMLLinkElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
, Link(this)
{
}

View File

@ -104,7 +104,7 @@ SafeOptionListMutation::~SafeOptionListMutation()
HTMLSelectElement::HTMLSelectElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElementWithState(aNodeInfo),
mOptions(new HTMLOptionsCollection(MOZ_THIS_IN_INITIALIZER_LIST())),
mOptions(new HTMLOptionsCollection(this)),
mAutocompleteAttrState(nsContentUtils::eAutocompleteAttrState_Unknown),
mIsDoneAddingChildren(!aFromParser),
mDisabledChanged(false),

View File

@ -61,7 +61,7 @@ HTMLTextAreaElement::HTMLTextAreaElement(already_AddRefed<mozilla::dom::NodeInfo
mDisabledChanged(false),
mCanShowInvalidUI(true),
mCanShowValidUI(true),
mState(MOZ_THIS_IN_INITIALIZER_LIST())
mState(this)
{
AddMutationObserver(this);

View File

@ -132,7 +132,7 @@ AudioStream::AudioStream()
, mChannels(0)
, mOutChannels(0)
, mWritten(0)
, mAudioClock(MOZ_THIS_IN_INITIALIZER_LIST())
, mAudioClock(this)
, mLatencyRequest(HighLatency)
, mReadPoint(0)
, mDumpFile(nullptr)

View File

@ -181,8 +181,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mDecoder(aDecoder),
mScheduler(new MediaDecoderStateMachineScheduler(
aDecoder->GetReentrantMonitor(),
&MediaDecoderStateMachine::TimeoutExpired,
MOZ_THIS_IN_INITIALIZER_LIST(), aRealTime)),
&MediaDecoderStateMachine::TimeoutExpired, this, aRealTime)),
mState(DECODER_STATE_DECODING_NONE),
mSyncPointInMediaStream(-1),
mSyncPointInDecodedStream(-1),
@ -1831,7 +1830,6 @@ MediaDecoderStateMachine::DispatchDecodeTasksIfNeeded()
EnsureVideoDecodeTaskQueued();
}
if (needIdle) {
RefPtr<nsIRunnable> event = NS_NewRunnableMethod(
this, &MediaDecoderStateMachine::SetReaderIdle);

View File

@ -80,7 +80,7 @@ ChannelMediaResource::ChannelMediaResource(MediaDecoder* aDecoder,
: BaseMediaResource(aDecoder, aChannel, aURI, aContentType),
mOffset(0), mSuspendCount(0),
mReopenOnError(false), mIgnoreClose(false),
mCacheStream(MOZ_THIS_IN_INITIALIZER_LIST()),
mCacheStream(this),
mLock("ChannelMediaResource.mLock"),
mIgnoreResume(false),
mIsTransportSeekable(true)

View File

@ -2742,7 +2742,7 @@ MediaStreamGraphImpl::MediaStreamGraphImpl(bool aRealtime,
, mFarendObserverRef(nullptr)
#endif
, mMemoryReportMonitor("MSGIMemory")
, mSelfRef(MOZ_THIS_IN_INITIALIZER_LIST())
, mSelfRef(this)
, mAudioStreamSizes()
, mNeedsMemoryReport(false)
#ifdef DEBUG

View File

@ -17,7 +17,7 @@ GMPVideoDecoderChild::GMPVideoDecoderChild(GMPChild* aPlugin)
: GMPSharedMemManager(aPlugin),
mPlugin(aPlugin),
mVideoDecoder(nullptr),
mVideoHost(MOZ_THIS_IN_INITIALIZER_LIST())
mVideoHost(this)
{
MOZ_ASSERT(mPlugin);
}

View File

@ -48,7 +48,7 @@ GMPVideoDecoderParent::GMPVideoDecoderParent(GMPParent* aPlugin)
, mShuttingDown(false)
, mPlugin(aPlugin)
, mCallback(nullptr)
, mVideoHost(MOZ_THIS_IN_INITIALIZER_LIST())
, mVideoHost(this)
{
MOZ_ASSERT(mPlugin);
}

View File

@ -17,7 +17,7 @@ GMPVideoEncoderChild::GMPVideoEncoderChild(GMPChild* aPlugin)
: GMPSharedMemManager(aPlugin),
mPlugin(aPlugin),
mVideoEncoder(nullptr),
mVideoHost(MOZ_THIS_IN_INITIALIZER_LIST())
mVideoHost(this)
{
MOZ_ASSERT(mPlugin);
}

View File

@ -55,7 +55,7 @@ GMPVideoEncoderParent::GMPVideoEncoderParent(GMPParent *aPlugin)
mShuttingDown(false),
mPlugin(aPlugin),
mCallback(nullptr),
mVideoHost(MOZ_THIS_IN_INITIALIZER_LIST())
mVideoHost(this)
{
MOZ_ASSERT(mPlugin);

View File

@ -541,8 +541,7 @@ AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* aContext)
, mLoopStart(0.0)
, mLoopEnd(0.0)
// mOffset and mDuration are initialized in Start().
, mPlaybackRate(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendPlaybackRateToStream, 1.0f))
, mPlaybackRate(new AudioParam(this, SendPlaybackRateToStream, 1.0f))
, mLoop(false)
, mStartCalled(false)
, mStopped(false)

View File

@ -244,14 +244,10 @@ BiquadFilterNode::BiquadFilterNode(AudioContext* aContext)
ChannelCountMode::Max,
ChannelInterpretation::Speakers)
, mType(BiquadFilterType::Lowpass)
, mFrequency(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendFrequencyToStream, 350.f))
, mDetune(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendDetuneToStream, 0.f))
, mQ(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendQToStream, 1.f))
, mGain(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendGainToStream, 0.f))
, mFrequency(new AudioParam(this, SendFrequencyToStream, 350.f))
, mDetune(new AudioParam(this, SendDetuneToStream, 0.f))
, mQ(new AudioParam(this, SendQToStream, 1.f))
, mGain(new AudioParam(this, SendGainToStream, 0.f))
{
BiquadFilterNodeEngine* engine = new BiquadFilterNodeEngine(this, aContext->Destination());
mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
@ -372,4 +368,3 @@ BiquadFilterNode::SendGainToStream(AudioNode* aNode)
}
}

View File

@ -190,8 +190,7 @@ DelayNode::DelayNode(AudioContext* aContext, double aMaxDelay)
2,
ChannelCountMode::Max,
ChannelInterpretation::Speakers)
, mDelay(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendDelayToStream, 0.0f))
, mDelay(new AudioParam(this, SendDelayToStream, 0.0f))
{
DelayNodeEngine* engine =
new DelayNodeEngine(this, aContext->Destination(),
@ -233,4 +232,3 @@ DelayNode::SendDelayToStream(AudioNode* aNode)
}
}

View File

@ -204,18 +204,12 @@ DynamicsCompressorNode::DynamicsCompressorNode(AudioContext* aContext)
2,
ChannelCountMode::Explicit,
ChannelInterpretation::Speakers)
, mThreshold(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendThresholdToStream, -24.f))
, mKnee(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendKneeToStream, 30.f))
, mRatio(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendRatioToStream, 12.f))
, mReduction(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
Callback, 0.f))
, mAttack(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendAttackToStream, 0.003f))
, mRelease(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendReleaseToStream, 0.25f))
, mThreshold(new AudioParam(this, SendThresholdToStream, -24.f))
, mKnee(new AudioParam(this, SendKneeToStream, 30.f))
, mRatio(new AudioParam(this, SendRatioToStream, 12.f))
, mReduction(new AudioParam(this, Callback, 0.f))
, mAttack(new AudioParam(this, SendAttackToStream, 0.003f))
, mRelease(new AudioParam(this, SendReleaseToStream, 0.25f))
{
DynamicsCompressorNodeEngine* engine = new DynamicsCompressorNodeEngine(this, aContext->Destination());
mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
@ -287,4 +281,3 @@ DynamicsCompressorNode::SendReleaseToStream(AudioNode* aNode)
}
}

View File

@ -125,8 +125,7 @@ GainNode::GainNode(AudioContext* aContext)
2,
ChannelCountMode::Max,
ChannelInterpretation::Speakers)
, mGain(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendGainToStream, 1.0f))
, mGain(new AudioParam(this, SendGainToStream, 1.0f))
{
GainNodeEngine* engine = new GainNodeEngine(this, aContext->Destination());
mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
@ -166,4 +165,3 @@ GainNode::SendGainToStream(AudioNode* aNode)
}
}

View File

@ -68,7 +68,7 @@ MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* a
ChannelCountMode::Explicit,
ChannelInterpretation::Speakers)
, mDOMStream(DOMAudioNodeMediaStream::CreateTrackUnionStream(GetOwner(),
MOZ_THIS_IN_INITIALIZER_LIST(),
this,
DOMMediaStream::HINT_CONTENTS_AUDIO))
{
TrackUnionStream* tus = static_cast<TrackUnionStream*>(mDOMStream->GetStream());

View File

@ -381,10 +381,8 @@ OscillatorNode::OscillatorNode(AudioContext* aContext)
ChannelCountMode::Max,
ChannelInterpretation::Speakers)
, mType(OscillatorType::Sine)
, mFrequency(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendFrequencyToStream, 440.0f))
, mDetune(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendDetuneToStream, 0.0f))
, mFrequency(new AudioParam(this, SendFrequencyToStream, 440.0f))
, mDetune(new AudioParam(this, SendDetuneToStream, 0.0f))
, mStartCalled(false)
, mStopped(false)
{
@ -550,4 +548,3 @@ OscillatorNode::NotifyMainThreadStateChanged()
}
}

View File

@ -176,8 +176,7 @@ StereoPannerNode::StereoPannerNode(AudioContext* aContext)
2,
ChannelCountMode::Clamped_max,
ChannelInterpretation::Speakers)
, mPan(new AudioParam(MOZ_THIS_IN_INITIALIZER_LIST(),
SendPanToStream, 0.f))
, mPan(new AudioParam(this, SendPanToStream, 0.f))
{
StereoPannerNodeEngine* engine = new StereoPannerNodeEngine(this, aContext->Destination());
mStream = aContext->Graph()->CreateAudioNodeStream(engine,
@ -218,4 +217,3 @@ StereoPannerNode::SendPanToStream(AudioNode* aNode)
}
}

View File

@ -28,7 +28,7 @@ BrowserStreamChild::BrowserStreamChild(PluginInstanceChild* instance,
, mURL(url)
, mHeaders(headers)
, mStreamNotify(notifyData)
, mDeliveryTracker(MOZ_THIS_IN_INITIALIZER_LIST())
, mDeliveryTracker(this)
{
PLUGIN_LOG_DEBUG(("%s (%s, %i, %i, %p, %s)", FULLFUNCTION,
url.get(), length, lastmodified, (void*) notifyData,

View File

@ -488,7 +488,7 @@ PluginModuleParent::PluginModuleParent(bool aIsChrome)
, mGetSitesWithDataSupported(false)
, mNPNIface(nullptr)
, mPlugin(nullptr)
, mTaskFactory(MOZ_THIS_IN_INITIALIZER_LIST())
, mTaskFactory(this)
, mIsStartingAsync(false)
, mNPInitialized(false)
, mAsyncNewRv(NS_ERROR_NOT_INITIALIZED)
@ -521,7 +521,7 @@ PluginModuleChromeParent::PluginModuleChromeParent(const char* aFilePath, uint32
: PluginModuleParent(true)
, mSubprocess(new PluginProcessParent(aFilePath))
, mPluginId(aPluginId)
, mChromeTaskFactory(MOZ_THIS_IN_INITIALIZER_LIST())
, mChromeTaskFactory(this)
, mHangAnnotationFlags(0)
#ifdef XP_WIN
, mPluginCpuUsageOnHang()

View File

@ -41,7 +41,7 @@ nsSMILTimeValueSpec::nsSMILTimeValueSpec(nsSMILTimedElement& aOwner,
bool aIsBegin)
: mOwner(&aOwner),
mIsBegin(aIsBegin),
mReferencedElement(MOZ_THIS_IN_INITIALIZER_LIST())
mReferencedElement(this)
{
}

View File

@ -64,7 +64,7 @@ NS_IMPL_RELEASE_INHERITED(SVGAElement, SVGAElementBase)
SVGAElement::SVGAElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: SVGAElementBase(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
, Link(this)
{
}

View File

@ -34,7 +34,7 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(SVGAnimationElement,
SVGAnimationElement::SVGAnimationElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: SVGAnimationElementBase(aNodeInfo),
mHrefTarget(MOZ_THIS_IN_INITIALIZER_LIST())
mHrefTarget(this)
{
}

View File

@ -57,7 +57,7 @@ NS_INTERFACE_TABLE_TAIL_INHERITING(SVGMPathElementBase)
// Constructor
SVGMPathElement::SVGMPathElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: SVGMPathElementBase(aNodeInfo),
mHrefTarget(MOZ_THIS_IN_INITIALIZER_LIST())
mHrefTarget(this)
{
}

View File

@ -72,7 +72,7 @@ NS_INTERFACE_TABLE_TAIL_INHERITING(SVGUseElementBase)
// Implementation
SVGUseElement::SVGUseElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: SVGUseElementBase(aNodeInfo), mSource(MOZ_THIS_IN_INITIALIZER_LIST())
: SVGUseElementBase(aNodeInfo), mSource(this)
{
}

View File

@ -894,8 +894,8 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
mRefPtrMonitor("RefPtrMonitor"),
mSharingFrameMetricsAcrossProcesses(false),
mMonitor("AsyncPanZoomController"),
mX(MOZ_THIS_IN_INITIALIZER_LIST()),
mY(MOZ_THIS_IN_INITIALIZER_LIST()),
mX(this),
mY(this),
mPanDirRestricted(false),
mZoomConstraints(false, false, MIN_ZOOM, MAX_ZOOM),
mLastSampleTime(GetFrameTime()),

View File

@ -23,21 +23,20 @@ class BasicCanvasLayer : public CopyableCanvasLayer,
{
public:
explicit BasicCanvasLayer(BasicLayerManager* aLayerManager) :
CopyableCanvasLayer(aLayerManager,
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
CopyableCanvasLayer(aLayerManager, static_cast<BasicImplData*>(this))
{ }
virtual void SetVisibleRegion(const nsIntRegion& aRegion) MOZ_OVERRIDE
{
NS_ASSERTION(BasicManager()->InConstruction(),
"Can only set properties in construction phase");
CanvasLayer::SetVisibleRegion(aRegion);
}
virtual void Paint(gfx::DrawTarget* aDT,
const gfx::Point& aDeviceOffset,
Layer* aMaskLayer) MOZ_OVERRIDE;
protected:
BasicLayerManager* BasicManager()
{

View File

@ -27,8 +27,7 @@ namespace layers {
class BasicColorLayer : public ColorLayer, public BasicImplData {
public:
explicit BasicColorLayer(BasicLayerManager* aLayerManager) :
ColorLayer(aLayerManager,
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
ColorLayer(aLayerManager, static_cast<BasicImplData*>(this))
{
MOZ_COUNT_CTOR(BasicColorLayer);
}

View File

@ -20,8 +20,7 @@ namespace layers {
class BasicContainerLayer : public ContainerLayer, public BasicImplData {
public:
explicit BasicContainerLayer(BasicLayerManager* aManager) :
ContainerLayer(aManager,
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
ContainerLayer(aManager, static_cast<BasicImplData*>(this))
{
MOZ_COUNT_CTOR(BasicContainerLayer);
mSupportsComponentAlphaChildren = true;

View File

@ -26,8 +26,7 @@ namespace layers {
class BasicImageLayer : public ImageLayer, public BasicImplData {
public:
explicit BasicImageLayer(BasicLayerManager* aLayerManager) :
ImageLayer(aLayerManager,
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST())),
ImageLayer(aLayerManager, static_cast<BasicImplData*>(this)),
mSize(-1, -1)
{
MOZ_COUNT_CTOR(BasicImageLayer);

View File

@ -50,8 +50,7 @@ class BasicReadbackLayer : public ReadbackLayer,
{
public:
explicit BasicReadbackLayer(BasicLayerManager* aLayerManager) :
ReadbackLayer(aLayerManager,
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST()))
ReadbackLayer(aLayerManager, static_cast<BasicImplData*>(this))
{
MOZ_COUNT_CTOR(BasicReadbackLayer);
}

View File

@ -31,8 +31,7 @@ public:
typedef RotatedContentBuffer::ContentType ContentType;
explicit BasicPaintedLayer(BasicLayerManager* aLayerManager) :
PaintedLayer(aLayerManager,
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST())),
PaintedLayer(aLayerManager, static_cast<BasicImplData*>(this)),
mContentClient(nullptr)
{
MOZ_COUNT_CTOR(BasicPaintedLayer);

View File

@ -36,8 +36,7 @@ class ClientCanvasLayer : public CopyableCanvasLayer,
typedef CanvasClient::CanvasClientType CanvasClientType;
public:
explicit ClientCanvasLayer(ClientLayerManager* aLayerManager) :
CopyableCanvasLayer(aLayerManager,
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
CopyableCanvasLayer(aLayerManager, static_cast<ClientLayer*>(this))
{
MOZ_COUNT_CTOR(ClientCanvasLayer);
}

View File

@ -18,12 +18,11 @@ namespace layers {
using namespace mozilla::gfx;
class ClientColorLayer : public ColorLayer,
class ClientColorLayer : public ColorLayer,
public ClientLayer {
public:
explicit ClientColorLayer(ClientLayerManager* aLayerManager) :
ColorLayer(aLayerManager,
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
ColorLayer(aLayerManager, static_cast<ClientLayer*>(this))
{
MOZ_COUNT_CTOR(ClientColorLayer);
}

View File

@ -28,8 +28,7 @@ class ClientContainerLayer : public ContainerLayer,
{
public:
explicit ClientContainerLayer(ClientLayerManager* aManager) :
ContainerLayer(aManager,
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
ContainerLayer(aManager, static_cast<ClientLayer*>(this))
{
MOZ_COUNT_CTOR(ClientContainerLayer);
mSupportsComponentAlphaChildren = true;
@ -151,8 +150,7 @@ class ClientRefLayer : public RefLayer,
public ClientLayer {
public:
explicit ClientRefLayer(ClientLayerManager* aManager) :
RefLayer(aManager,
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
RefLayer(aManager, static_cast<ClientLayer*>(this))
{
MOZ_COUNT_CTOR(ClientRefLayer);
}

View File

@ -23,12 +23,11 @@ namespace layers {
using namespace mozilla::gfx;
class ClientImageLayer : public ImageLayer,
class ClientImageLayer : public ImageLayer,
public ClientLayer {
public:
explicit ClientImageLayer(ClientLayerManager* aLayerManager)
: ImageLayer(aLayerManager,
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()))
: ImageLayer(aLayerManager, static_cast<ClientLayer*>(this))
, mImageClientTypeContainer(CompositableType::UNKNOWN)
{
MOZ_COUNT_CTOR(ClientImageLayer);
@ -182,5 +181,6 @@ ClientLayerManager::CreateImageLayer()
CREATE_SHADOW(Image);
return layer.forget();
}
}
}

View File

@ -35,9 +35,7 @@ public:
explicit ClientPaintedLayer(ClientLayerManager* aLayerManager,
LayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE) :
PaintedLayer(aLayerManager,
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
aCreationHint),
PaintedLayer(aLayerManager, static_cast<ClientLayer*>(this), aCreationHint),
mContentClient(nullptr)
{
MOZ_COUNT_CTOR(ClientPaintedLayer);

View File

@ -26,9 +26,7 @@ namespace layers {
ClientTiledPaintedLayer::ClientTiledPaintedLayer(ClientLayerManager* const aManager,
ClientLayerManager::PaintedLayerCreationHint aCreationHint)
: PaintedLayer(aManager,
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
aCreationHint)
: PaintedLayer(aManager, static_cast<ClientLayer*>(this), aCreationHint)
, mContentClient()
{
MOZ_COUNT_CTOR(ClientTiledPaintedLayer);

View File

@ -376,8 +376,7 @@ static const char *gPrefLangNames[] = {
gfxPlatform::gfxPlatform()
: mTileWidth(-1)
, mTileHeight(-1)
, mAzureCanvasBackendCollector(MOZ_THIS_IN_INITIALIZER_LIST(),
&gfxPlatform::GetAzureBackendInfo)
, mAzureCanvasBackendCollector(this, &gfxPlatform::GetAzureBackendInfo)
{
mAllowDownloadableFonts = UNINITIALIZED_VALUE;
mFallbackUsesCmaps = UNINITIALIZED_VALUE;

View File

@ -53,7 +53,6 @@ class SurfaceCacheImpl;
// The single surface cache instance.
static StaticRefPtr<SurfaceCacheImpl> sInstance;
///////////////////////////////////////////////////////////////////////////////
// SurfaceCache Implementation
///////////////////////////////////////////////////////////////////////////////
@ -277,8 +276,7 @@ public:
SurfaceCacheImpl(uint32_t aSurfaceCacheExpirationTimeMS,
uint32_t aSurfaceCacheDiscardFactor,
uint32_t aSurfaceCacheSize)
: mExpirationTracker(MOZ_THIS_IN_INITIALIZER_LIST(),
aSurfaceCacheExpirationTimeMS)
: mExpirationTracker(this, aSurfaceCacheExpirationTimeMS)
, mMemoryPressureObserver(new MemoryPressureObserver)
, mMutex("SurfaceCache")
, mDiscardFactor(aSurfaceCacheDiscardFactor)
@ -704,7 +702,6 @@ private:
virtual ~MemoryPressureObserver() { }
};
nsTArray<CostEntry> mCosts;
nsRefPtrHashtable<nsPtrHashKey<Image>, ImageSurfaceCache> mImageCaches;
SurfaceTracker mExpirationTracker;

View File

@ -54,7 +54,7 @@ class BumpChunk
char *bumpBase() const { return limit - bumpSpaceSize; }
explicit BumpChunk(size_t bumpSpaceSize)
: bump(reinterpret_cast<char *>(MOZ_THIS_IN_INITIALIZER_LIST()) + sizeof(BumpChunk)),
: bump(reinterpret_cast<char *>(this) + sizeof(BumpChunk)),
limit(bump + bumpSpaceSize),
next_(nullptr), bumpSpaceSize(bumpSpaceSize)
{

View File

@ -246,7 +246,7 @@ class InlineList : protected InlineListNode<T>
typedef InlineListNode<T> Node;
public:
InlineList() : InlineListNode<T>(MOZ_THIS_IN_INITIALIZER_LIST(), MOZ_THIS_IN_INITIALIZER_LIST())
InlineList() : InlineListNode<T>(this, this)
{ }
public:

View File

@ -1013,7 +1013,7 @@ JSContext::JSContext(JSRuntime *rt)
resolvingList(nullptr),
generatingError(false),
savedFrameChains_(),
cycleDetectorSet(MOZ_THIS_IN_INITIALIZER_LIST()),
cycleDetectorSet(this),
data(nullptr),
data2(nullptr),
outstandingRequests(0),

View File

@ -3156,7 +3156,7 @@ static const JSWrapObjectCallbacks WrapObjectCallbacks = {
XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
: CycleCollectedJSRuntime(nullptr, JS::DefaultHeapMaxBytes, JS::DefaultNurseryBytes),
mJSContextStack(new XPCJSContextStack(MOZ_THIS_IN_INITIALIZER_LIST())),
mJSContextStack(new XPCJSContextStack(this)),
mCallContext(nullptr),
mAutoRoots(nullptr),
mResolveName(JSID_VOID),
@ -3177,10 +3177,10 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
mVariantRoots(nullptr),
mWrappedJSRoots(nullptr),
mObjectHolderRoots(nullptr),
mWatchdogManager(new WatchdogManager(MOZ_THIS_IN_INITIALIZER_LIST())),
mUnprivilegedJunkScope(MOZ_THIS_IN_INITIALIZER_LIST()->Runtime(), nullptr),
mPrivilegedJunkScope(MOZ_THIS_IN_INITIALIZER_LIST()->Runtime(), nullptr),
mCompilationScope(MOZ_THIS_IN_INITIALIZER_LIST()->Runtime(), nullptr),
mWatchdogManager(new WatchdogManager(this)),
mUnprivilegedJunkScope(this->Runtime(), nullptr),
mPrivilegedJunkScope(this->Runtime(), nullptr),
mCompilationScope(this->Runtime(), nullptr),
mAsyncSnowWhiteFreer(new AsyncFreeSnowWhite())
{
// these jsids filled in later when we have a JSContext to work with.

View File

@ -385,7 +385,7 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
nsresult *rv)
: mJSObj(aJSObj),
mClass(aClass),
mRoot(root ? root : MOZ_THIS_IN_INITIALIZER_LIST()),
mRoot(root ? root : this),
mNext(nullptr)
{
*rv = InitStub(GetClass()->GetIID());

View File

@ -181,7 +181,7 @@ nsSVGRenderingObserver::ContentRemoved(nsIDocument *aDocument,
nsSVGIDRenderingObserver::nsSVGIDRenderingObserver(nsIURI* aURI,
nsIContent* aObservingContent,
bool aReferenceImage)
: mElement(MOZ_THIS_IN_INITIALIZER_LIST())
: mElement(this)
{
// Start watching the target element
mElement.Reset(aObservingContent, aURI, true, aReferenceImage);

View File

@ -619,7 +619,7 @@ class MediaPipelineReceiveVideo : public MediaPipelineReceive {
MediaPipelineReceive(pc, main_thread, sts_thread,
stream, track_id, level, conduit, rtp_transport,
rtcp_transport, filter),
renderer_(new PipelineRenderer(MOZ_THIS_IN_INITIALIZER_LIST())),
renderer_(new PipelineRenderer(this)),
listener_(new PipelineListener(stream->AsSourceStream(), track_id)) {
}

View File

@ -530,20 +530,6 @@
# define MOZ_NO_ADDREF_RELEASE_ON_RETURN /* nothing */
#endif /* MOZ_CLANG_PLUGIN */
/*
* MOZ_THIS_IN_INITIALIZER_LIST is used to avoid a warning when we know that
* it's safe to use 'this' in an initializer list.
*/
#ifdef _MSC_VER
# define MOZ_THIS_IN_INITIALIZER_LIST() \
__pragma(warning(push)) \
__pragma(warning(disable:4355)) \
this \
__pragma(warning(pop))
#else
# define MOZ_THIS_IN_INITIALIZER_LIST() this
#endif
#endif /* __cplusplus */
#endif /* mozilla_Attributes_h */

View File

@ -117,8 +117,8 @@ private:
public:
LinkedListElement()
: mNext(MOZ_THIS_IN_INITIALIZER_LIST()),
mPrev(MOZ_THIS_IN_INITIALIZER_LIST()),
: mNext(this),
mPrev(this),
mIsSentinel(false)
{ }
@ -236,8 +236,8 @@ private:
};
explicit LinkedListElement(NodeKind nodeKind)
: mNext(MOZ_THIS_IN_INITIALIZER_LIST()),
mPrev(MOZ_THIS_IN_INITIALIZER_LIST()),
: mNext(this),
mPrev(this),
mIsSentinel(nodeKind == NODE_KIND_SENTINEL)
{ }

View File

@ -739,12 +739,12 @@ nsSocketTransport::nsSocketTransport()
, mResolving(false)
, mNetAddrIsSet(false)
, mLock("nsSocketTransport.mLock")
, mFD(MOZ_THIS_IN_INITIALIZER_LIST())
, mFD(this)
, mFDref(0)
, mFDconnected(false)
, mSocketTransportService(gSocketTransportService)
, mInput(MOZ_THIS_IN_INITIALIZER_LIST())
, mOutput(MOZ_THIS_IN_INITIALIZER_LIST())
, mInput(this)
, mOutput(this)
, mQoSBits(0x00)
, mKeepaliveEnabled(false)
, mKeepaliveIdleTimeS(-1)

View File

@ -61,7 +61,7 @@ static_assert(FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE == 250,
//-----------------------------------------------------------------------------
HttpChannelChild::HttpChannelChild()
: HttpAsyncAborter<HttpChannelChild>(MOZ_THIS_IN_INITIALIZER_LIST())
: HttpAsyncAborter<HttpChannelChild>(this)
, mIsFromCache(false)
, mCacheEntryAvailable(false)
, mCacheExpirationTime(nsICacheEntry::NO_EXPIRATION_TIME)

View File

@ -57,7 +57,7 @@ StrEquivalent(const char16_t *a, const char16_t *b)
nsHttpAuthCache::nsHttpAuthCache()
: mDB(nullptr)
, mObserver(new AppDataClearObserver(MOZ_THIS_IN_INITIALIZER_LIST()))
, mObserver(new AppDataClearObserver(this))
{
nsCOMPtr<nsIObserverService> obsSvc = services::GetObserverService();
if (obsSvc) {

View File

@ -215,7 +215,7 @@ AutoRedirectVetoNotifier::ReportRedirectResult(bool succeeded)
//-----------------------------------------------------------------------------
nsHttpChannel::nsHttpChannel()
: HttpAsyncAborter<nsHttpChannel>(MOZ_THIS_IN_INITIALIZER_LIST())
: HttpAsyncAborter<nsHttpChannel>(this)
, mLogicalOffset(0)
, mPostID(0)
, mRequestTime(0)

View File

@ -35,6 +35,7 @@ CXXFLAGS += ['-Wall']
if CONFIG['_MSC_VER']:
# -Wall with Visual C++ enables too many problematic warnings
CXXFLAGS += [
'-wd4355', # 'this' used in base member initializer list
'-wd4480', # nonstandard extension used: specifying underlying type for
# enum 'enum'
'-wd4481', # nonstandard extension used: override specifier 'keyword'

View File

@ -157,7 +157,7 @@ ThreadProfile::ThreadProfile(ThreadInfo* aInfo, int aEntrySize)
, mGeneration(0)
, mPendingGenerationFlush(0)
, mStackTop(aInfo->StackTop())
, mRespInfo(MOZ_THIS_IN_INITIALIZER_LIST())
, mRespInfo(this)
#ifdef XP_LINUX
, mRssMemory(0)
, mUssMemory(0)

View File

@ -319,8 +319,8 @@ protected:
//-----------------------------------------------------------------------------
nsPipe::nsPipe()
: mInput(MOZ_THIS_IN_INITIALIZER_LIST())
, mOutput(MOZ_THIS_IN_INITIALIZER_LIST())
: mInput(this)
, mOutput(this)
, mReentrantMonitor("nsPipe.mReentrantMonitor")
, mReadCursor(nullptr)
, mReadLimit(nullptr)