Bug 1322458 - Fix kungFuDeathGrip errors that clang plugin reports on Windows. r=aklotz,Ehsan

MozReview-Commit-ID: FLTLZSg2yh9

--HG--
extra : rebase_source : e8aad8f35cffb3312e043a4fcec6296371baf432
This commit is contained in:
Ting-Yu Chou 2016-12-14 16:34:12 +08:00
parent c2a23d7e57
commit 4f285bd583
4 changed files with 14 additions and 11 deletions

View File

@ -215,6 +215,7 @@ CompositorD3D9::SetRenderTarget(CompositingRenderTarget *aRenderTarget)
{
MOZ_ASSERT(aRenderTarget && mDeviceManager);
RefPtr<CompositingRenderTargetD3D9> oldRT = mCurrentRT;
Unused << oldRT;
mCurrentRT = static_cast<CompositingRenderTargetD3D9*>(aRenderTarget);
mCurrentRT->BindRenderTarget(device());
PrepareViewport(mCurrentRT->GetSize());

View File

@ -10,6 +10,7 @@
#include "MainThreadUtils.h"
#include "mozilla/Attributes.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Unused.h"
#include "mozilla/mscom/COMApartmentRegion.h"
#include "mozilla/mscom/Utils.h"
#include "nsCOMPtr.h"
@ -33,6 +34,7 @@ public:
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIThread> thread = GetMTAThread();
MOZ_ASSERT(thread);
Unused << thread;
}
template <typename FuncT>

View File

@ -40,7 +40,7 @@ WeakReferenceSupport::QueryInterface(REFIID riid, void** ppv)
*ppv = nullptr;
// Raise the refcount for stabilization purposes during aggregation
RefPtr<IUnknown> kungFuDeathGrip(static_cast<IUnknown*>(this));
RefPtr<IUnknown> kungFuDeathGrip(this);
if (riid == IID_IUnknown || riid == IID_IWeakReferenceSource) {
punk = static_cast<IUnknown*>(this);

View File

@ -1719,7 +1719,7 @@ TSFTextStore::FlushPendingActions()
return;
}
RefPtr<nsWindowBase> kungFuDeathGrip(mWidget);
RefPtr<nsWindowBase> widget(mWidget);
nsresult rv = mDispatcher->BeginNativeInputTransaction();
if (NS_WARN_IF(NS_FAILED(rv))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
@ -1748,8 +1748,8 @@ TSFTextStore::FlushPendingActions()
if (action.mAdjustSelection) {
// Select composition range so the new composition replaces the range
WidgetSelectionEvent selectionSet(true, eSetSelection, mWidget);
mWidget->InitEvent(selectionSet);
WidgetSelectionEvent selectionSet(true, eSetSelection, widget);
widget->InitEvent(selectionSet);
selectionSet.mOffset = static_cast<uint32_t>(action.mSelectionStart);
selectionSet.mLength = static_cast<uint32_t>(action.mSelectionLength);
selectionSet.mReversed = false;
@ -1770,7 +1770,7 @@ TSFTextStore::FlushPendingActions()
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("0x%p TSFTextStore::FlushPendingActions() "
"dispatching compositionstart event...", this));
WidgetEventTime eventTime = mWidget->CurrentMessageWidgetEventTime();
WidgetEventTime eventTime = widget->CurrentMessageWidgetEventTime();
nsEventStatus status;
rv = mDispatcher->StartComposition(status, &eventTime);
if (NS_WARN_IF(NS_FAILED(rv))) {
@ -1781,7 +1781,7 @@ TSFTextStore::FlushPendingActions()
this, GetBoolName(!IsComposingInContent())));
mDeferClearingContentForTSF = !IsComposingInContent();
}
if (!mWidget || mWidget->Destroyed()) {
if (!widget || widget->Destroyed()) {
break;
}
break;
@ -1814,7 +1814,7 @@ TSFTextStore::FlushPendingActions()
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("0x%p TSFTextStore::FlushPendingActions() "
"dispatching compositionchange event...", this));
WidgetEventTime eventTime = mWidget->CurrentMessageWidgetEventTime();
WidgetEventTime eventTime = widget->CurrentMessageWidgetEventTime();
nsEventStatus status;
rv = mDispatcher->FlushPendingComposition(status, &eventTime);
if (NS_WARN_IF(NS_FAILED(rv))) {
@ -1844,7 +1844,7 @@ TSFTextStore::FlushPendingActions()
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("0x%p TSFTextStore::FlushPendingActions(), "
"dispatching compositioncommit event...", this));
WidgetEventTime eventTime = mWidget->CurrentMessageWidgetEventTime();
WidgetEventTime eventTime = widget->CurrentMessageWidgetEventTime();
nsEventStatus status;
rv = mDispatcher->CommitComposition(status, &action.mData, &eventTime);
if (NS_WARN_IF(NS_FAILED(rv))) {
@ -1875,8 +1875,8 @@ TSFTextStore::FlushPendingActions()
break;
}
WidgetSelectionEvent selectionSet(true, eSetSelection, mWidget);
selectionSet.mOffset =
WidgetSelectionEvent selectionSet(true, eSetSelection, widget);
selectionSet.mOffset =
static_cast<uint32_t>(action.mSelectionStart);
selectionSet.mLength =
static_cast<uint32_t>(action.mSelectionLength);
@ -1887,7 +1887,7 @@ TSFTextStore::FlushPendingActions()
MOZ_CRASH("unexpected action type");
}
if (mWidget && !mWidget->Destroyed()) {
if (widget && !widget->Destroyed()) {
continue;
}