Bug 1519636 - Reformat recent changes to the Google coding style r=andi

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
This commit is contained in:
Sylvestre Ledru 2020-08-02 15:29:15 +00:00
parent 964bac7f10
commit 843f943758
72 changed files with 145 additions and 156 deletions

View file

@ -33,7 +33,6 @@ namespace devtools {
// } // }
// // The memory is automatically unmapped when the AutoMemMap leaves scope. // // The memory is automatically unmapped when the AutoMemMap leaves scope.
class MOZ_RAII AutoMemMap { class MOZ_RAII AutoMemMap {
PRFileInfo64 fileInfo; PRFileInfo64 fileInfo;
PRFileDesc* fd; PRFileDesc* fd;
PRFileMap* fileMap; PRFileMap* fileMap;

View file

@ -27,7 +27,6 @@ namespace mozilla {
// ... // ...
// } // }
class MOZ_RAII AutoGlobalTimelineMarker { class MOZ_RAII AutoGlobalTimelineMarker {
// The name of the marker we are adding. // The name of the marker we are adding.
const char* mName; const char* mName;
// Whether to capture the JS stack or not. // Whether to capture the JS stack or not.

View file

@ -14,7 +14,6 @@ class nsIDocShell;
namespace mozilla { namespace mozilla {
class MOZ_RAII AutoRestyleTimelineMarker { class MOZ_RAII AutoRestyleTimelineMarker {
RefPtr<nsIDocShell> mDocShell; RefPtr<nsIDocShell> mDocShell;
bool mIsAnimationOnly; bool mIsAnimationOnly;

View file

@ -27,7 +27,6 @@ namespace mozilla {
// ... // ...
// } // }
class MOZ_RAII AutoTimelineMarker { class MOZ_RAII AutoTimelineMarker {
// The name of the marker we are adding. // The name of the marker we are adding.
const char* mName; const char* mName;

View file

@ -231,7 +231,6 @@ class nsSHistory : public mozilla::LinkedListElement<nsSHistory>,
nsISHEntry* aNewEntry); nsISHEntry* aNewEntry);
protected: protected:
bool mHasOngoingUpdate; bool mHasOngoingUpdate;
bool mIsRemote; bool mIsRemote;
nsTArray<nsCOMPtr<nsISHEntry>> mEntries; // entries are never null nsTArray<nsCOMPtr<nsISHEntry>> mEntries; // entries are never null

View file

@ -917,6 +917,7 @@ class MOZ_STACK_CLASS SelectionBatcher final {
class MOZ_RAII AutoHideSelectionChanges final { class MOZ_RAII AutoHideSelectionChanges final {
private: private:
RefPtr<Selection> mSelection; RefPtr<Selection> mSelection;
public: public:
explicit AutoHideSelectionChanges(const nsFrameSelection* aFrame); explicit AutoHideSelectionChanges(const nsFrameSelection* aFrame);

View file

@ -397,7 +397,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
~TemporarilyDisableDialogs(); ~TemporarilyDisableDialogs();
private: private:
// Always an inner window; this is the window whose dialog state we messed // Always an inner window; this is the window whose dialog state we messed
// with. We just want to keep it alive, because we plan to poke at its // with. We just want to keep it alive, because we plan to poke at its
// members in our destructor. // members in our destructor.

View file

@ -976,8 +976,8 @@ nsImageLoadingContent::LoadImageWithChannel(nsIChannel* aChannel,
// Do the load. // Do the load.
RefPtr<imgRequestProxy>& req = PrepareNextRequest(eImageLoadType_Normal); RefPtr<imgRequestProxy>& req = PrepareNextRequest(eImageLoadType_Normal);
nsresult rv = loader->LoadImageWithChannel(aChannel, this, doc, nsresult rv = loader->LoadImageWithChannel(aChannel, this, doc, aListener,
aListener, getter_AddRefs(req)); getter_AddRefs(req));
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
CloneScriptedRequests(req); CloneScriptedRequests(req);
TrackImage(req); TrackImage(req);

View file

@ -37,6 +37,7 @@ class WebGLChild final : public PWebGLChild, public SupportsWeakPtr {
webgl::RaiiShmem mPendingCmdsShmem; webgl::RaiiShmem mPendingCmdsShmem;
size_t mPendingCmdsPos = 0; size_t mPendingCmdsPos = 0;
FlushedCmdInfo mFlushedCmdInfo; FlushedCmdInfo mFlushedCmdInfo;
public: public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebGLChild, override); NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebGLChild, override);
using OtherSideActor = WebGLParent; using OtherSideActor = WebGLParent;

View file

@ -12,7 +12,8 @@
namespace mozilla { namespace mozilla {
namespace webgl { namespace webgl {
// TODO: This should probably replace Shmem, or at least this should move to ipc/glue. // TODO: This should probably replace Shmem, or at least this should move to
// ipc/glue.
class RaiiShmem final { class RaiiShmem final {
RefPtr<mozilla::ipc::ActorLifecycleProxy> mWeakRef; RefPtr<mozilla::ipc::ActorLifecycleProxy> mWeakRef;
mozilla::ipc::Shmem mShmem = {}; mozilla::ipc::Shmem mShmem = {};

View file

@ -18,7 +18,7 @@ class HostWebGLContext;
namespace layers { namespace layers {
class SharedSurfaceTextureClient; class SharedSurfaceTextureClient;
class SurfaceDescriptor; class SurfaceDescriptor;
} } // namespace layers
namespace dom { namespace dom {

View file

@ -342,12 +342,14 @@ class StadiaControllerRemapper final : public GamepadRemapper {
break; break;
case 4: { case 4: {
const double value = AxisToButtonValue(aValue); const double value = AxisToButtonValue(aValue);
service->NewButtonEvent(aIndex, BUTTON_INDEX_LEFT_TRIGGER, value > BUTTON_THRESHOLD_VALUE, value); service->NewButtonEvent(aIndex, BUTTON_INDEX_LEFT_TRIGGER,
value > BUTTON_THRESHOLD_VALUE, value);
break; break;
} }
case 5: { case 5: {
const double value = AxisToButtonValue(aValue); const double value = AxisToButtonValue(aValue);
service->NewButtonEvent(aIndex, BUTTON_INDEX_RIGHT_TRIGGER, value > BUTTON_THRESHOLD_VALUE, value); service->NewButtonEvent(aIndex, BUTTON_INDEX_RIGHT_TRIGGER,
value > BUTTON_THRESHOLD_VALUE, value);
break; break;
} }
default: default:
@ -420,7 +422,8 @@ class Playstation3Remapper final : public GamepadRemapper {
default: default:
NS_WARNING( NS_WARNING(
nsPrintfCString( nsPrintfCString(
"Axis idx '%d' doesn't support in Playstation3Remapper().", aAxis) "Axis idx '%d' doesn't support in Playstation3Remapper().",
aAxis)
.get()); .get());
break; break;
} }
@ -1723,7 +1726,8 @@ already_AddRefed<GamepadRemapper> GetGamepadRemapper(const uint16_t aVendorId,
{GamepadId::kPadixProduct2060, new IBuffaloRemapper()}, {GamepadId::kPadixProduct2060, new IBuffaloRemapper()},
{GamepadId::kPlayComProduct0005, new XSkillsRemapper()}, {GamepadId::kPlayComProduct0005, new XSkillsRemapper()},
{GamepadId::kPrototypeVendorProduct0667, new BoomN64PsxRemapper()}, {GamepadId::kPrototypeVendorProduct0667, new BoomN64PsxRemapper()},
{GamepadId::kPrototypeVendorProduct9401, new StadiaControllerOldFirmwareRemapper()}, {GamepadId::kPrototypeVendorProduct9401,
new StadiaControllerOldFirmwareRemapper()},
{GamepadId::kRazer1532Product0900, new RazerServalRemapper()}, {GamepadId::kRazer1532Product0900, new RazerServalRemapper()},
{GamepadId::kSonyProduct0268, new Playstation3Remapper()}, {GamepadId::kSonyProduct0268, new Playstation3Remapper()},
{GamepadId::kSonyProduct05c4, new Dualshock4Remapper()}, {GamepadId::kSonyProduct05c4, new Dualshock4Remapper()},

View file

@ -751,8 +751,8 @@ nsresult HTMLImageElement::CopyInnerTo(HTMLImageElement* aDest) {
// initaiated by a user interaction. // initaiated by a user interaction.
mUseUrgentStartForChannel = UserActivation::IsHandlingUserInput(); mUseUrgentStartForChannel = UserActivation::IsHandlingUserInput();
nsContentUtils::AddScriptRunner(NewRunnableMethod<bool>( nsContentUtils::AddScriptRunner(
"dom::HTMLImageElement::MaybeLoadImage", aDest, NewRunnableMethod<bool>("dom::HTMLImageElement::MaybeLoadImage", aDest,
&HTMLImageElement::MaybeLoadImage, false)); &HTMLImageElement::MaybeLoadImage, false));
} }

View file

@ -290,8 +290,8 @@ bool ExtractVPXCodecDetails(const nsAString& aCodec, uint8_t& aProfile,
// No more than 8 fields are expected. // No more than 8 fields are expected.
return false; return false;
} }
*(fields[fieldsCount]) = static_cast<uint8_t>( *(fields[fieldsCount]) =
(*fieldsItr).ToInteger(&rv, 10)); static_cast<uint8_t>((*fieldsItr).ToInteger(&rv, 10));
// We got invalid field value, parsing error. // We got invalid field value, parsing error.
NS_ENSURE_SUCCESS(rv, false); NS_ENSURE_SUCCESS(rv, false);
} }

View file

@ -708,7 +708,6 @@ AutoJSContext::AutoJSContext() : mCx(nullptr) {
MOZ_ASSERT(!mCx, "mCx should not be initialized!"); MOZ_ASSERT(!mCx, "mCx should not be initialized!");
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
if (dom::IsJSAPIActive()) { if (dom::IsJSAPIActive()) {
mCx = dom::danger::GetJSContext(); mCx = dom::danger::GetJSContext();
} else { } else {
@ -722,7 +721,6 @@ AutoJSContext::operator JSContext*() const { return mCx; }
AutoSafeJSContext::AutoSafeJSContext() : AutoJSAPI() { AutoSafeJSContext::AutoSafeJSContext() : AutoJSAPI() {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
DebugOnly<bool> ok = Init(xpc::UnprivilegedJunkScope()); DebugOnly<bool> ok = Init(xpc::UnprivilegedJunkScope());
MOZ_ASSERT(ok, MOZ_ASSERT(ok,
"This is quite odd. We should have crashed in the " "This is quite odd. We should have crashed in the "

View file

@ -101,7 +101,6 @@ static bool IsStyleCachePreservingSubAction(EditSubAction aEditSubAction) {
} }
class MOZ_RAII AutoSetTemporaryAncestorLimiter final { class MOZ_RAII AutoSetTemporaryAncestorLimiter final {
public: public:
explicit AutoSetTemporaryAncestorLimiter(HTMLEditor& aHTMLEditor, explicit AutoSetTemporaryAncestorLimiter(HTMLEditor& aHTMLEditor,
Selection& aSelection, Selection& aSelection,

View file

@ -784,7 +784,6 @@ class TextureClientReleaseTask : public Runnable {
// Automatically lock and unlock a texture. Since texture locking is fallible, // Automatically lock and unlock a texture. Since texture locking is fallible,
// Succeeded() must be checked on the guard object before proceeding. // Succeeded() must be checked on the guard object before proceeding.
class MOZ_RAII TextureClientAutoLock { class MOZ_RAII TextureClientAutoLock {
public: public:
TextureClientAutoLock(TextureClient* aTexture, OpenMode aMode) TextureClientAutoLock(TextureClient* aTexture, OpenMode aMode)
: mTexture(aTexture), mSucceeded(false) { : mTexture(aTexture), mSucceeded(false) {

View file

@ -711,4 +711,3 @@ TEST_F(GfxConfigManager, WebRenderWhenXRenderEnabled) {
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled()); EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled()); EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
} }

View file

@ -1069,7 +1069,8 @@ imgRequestProxy::GetStaticRequest(imgIRequest** aReturn) {
already_AddRefed<imgRequestProxy> imgRequestProxy::GetStaticRequest( already_AddRefed<imgRequestProxy> imgRequestProxy::GetStaticRequest(
Document* aLoadingDocument) { Document* aLoadingDocument) {
MOZ_DIAGNOSTIC_ASSERT(!aLoadingDocument || aLoadingDocument->IsStaticDocument()); MOZ_DIAGNOSTIC_ASSERT(!aLoadingDocument ||
aLoadingDocument->IsStaticDocument());
RefPtr<Image> image = GetImage(); RefPtr<Image> image = GetImage();
bool animated; bool animated;

View file

@ -123,7 +123,8 @@ class imgRequestProxy : public mozilla::PreloaderBase,
Document* aLoadingDocument, imgRequestProxy** aClone); Document* aLoadingDocument, imgRequestProxy** aClone);
nsresult Clone(imgINotificationObserver* aObserver, nsresult Clone(imgINotificationObserver* aObserver,
Document* aLoadingDocument, imgRequestProxy** aClone); Document* aLoadingDocument, imgRequestProxy** aClone);
already_AddRefed<imgRequestProxy> GetStaticRequest(Document* aLoadingDocument); already_AddRefed<imgRequestProxy> GetStaticRequest(
Document* aLoadingDocument);
imgRequest* GetOwner() const; imgRequest* GetOwner() const;

View file

@ -7,7 +7,6 @@
#ifndef mozilla_ipc_Neutering_h #ifndef mozilla_ipc_Neutering_h
#define mozilla_ipc_Neutering_h #define mozilla_ipc_Neutering_h
/** /**
* This header declares RAII wrappers for Window neutering. See * This header declares RAII wrappers for Window neutering. See
* WindowsMessageLoop.cpp for more details. * WindowsMessageLoop.cpp for more details.

View file

@ -187,6 +187,7 @@ class FinalizationRegistryObject : public NativeObject {
static bool cleanupQueuedRecords(JSContext* cx, static bool cleanupQueuedRecords(JSContext* cx,
HandleFinalizationRegistryObject registry, HandleFinalizationRegistryObject registry,
HandleObject callback = nullptr); HandleObject callback = nullptr);
private: private:
static const JSClassOps classOps_; static const JSClassOps classOps_;
static const ClassSpec classSpec_; static const ClassSpec classSpec_;

View file

@ -2961,7 +2961,6 @@ class MOZ_RAII ExecutionObservableRealms
// don't match. // don't match.
return iter.hasUsableAbstractFramePtr() && realms_.has(iter.realm()); return iter.hasUsableAbstractFramePtr() && realms_.has(iter.realm());
} }
}; };
// Given a particular AbstractFramePtr F that has become observable, this // Given a particular AbstractFramePtr F that has become observable, this
@ -3025,7 +3024,6 @@ class MOZ_RAII ExecutionObservableFrame
return iter.hasUsableAbstractFramePtr() && return iter.hasUsableAbstractFramePtr() &&
iter.abstractFramePtr() == frame_; iter.abstractFramePtr() == frame_;
} }
}; };
class MOZ_RAII ExecutionObservableScript class MOZ_RAII ExecutionObservableScript
@ -3057,7 +3055,6 @@ class MOZ_RAII ExecutionObservableScript
return iter.hasUsableAbstractFramePtr() && !iter.isWasm() && return iter.hasUsableAbstractFramePtr() && !iter.isWasm() &&
iter.abstractFramePtr().script() == script_; iter.abstractFramePtr().script() == script_;
} }
}; };
/* static */ /* static */

View file

@ -834,8 +834,7 @@ void GCMarker::severWeakDelegate(JSObject* key, JSObject* delegate) {
// 'delegate' is now the delegate of 'key'. Update weakmap marking state. // 'delegate' is now the delegate of 'key'. Update weakmap marking state.
void GCMarker::restoreWeakDelegate(JSObject* key, JSObject* delegate) { void GCMarker::restoreWeakDelegate(JSObject* key, JSObject* delegate) {
if (!key->zone()->needsIncrementalBarrier() || if (!key->zone()->needsIncrementalBarrier() ||
!delegate->zone()->needsIncrementalBarrier()) !delegate->zone()->needsIncrementalBarrier()) {
{
MOZ_ASSERT(!key->zone()->gcWeakKeys(key).get(key), MOZ_ASSERT(!key->zone()->gcWeakKeys(key).get(key),
"non-collecting zone should not have populated gcWeakKeys"); "non-collecting zone should not have populated gcWeakKeys");
return; return;

View file

@ -120,7 +120,6 @@ class MOZ_RAII AutoEnterIonBackend {
jcx->leaveIonBackend(); jcx->leaveIonBackend();
} }
#endif #endif
}; };
bool OffThreadCompilationAvailable(JSContext* cx); bool OffThreadCompilationAvailable(JSContext* cx);

View file

@ -419,7 +419,6 @@ class MOZ_RAII JS_PUBLIC_API JSAutoRealm {
JSAutoRealm(JSContext* cx, JSObject* target); JSAutoRealm(JSContext* cx, JSObject* target);
JSAutoRealm(JSContext* cx, JSScript* target); JSAutoRealm(JSContext* cx, JSScript* target);
~JSAutoRealm(); ~JSAutoRealm();
}; };
class MOZ_RAII JS_PUBLIC_API JSAutoNullableRealm { class MOZ_RAII JS_PUBLIC_API JSAutoNullableRealm {
@ -429,7 +428,6 @@ class MOZ_RAII JS_PUBLIC_API JSAutoNullableRealm {
public: public:
explicit JSAutoNullableRealm(JSContext* cx, JSObject* targetOrNull); explicit JSAutoNullableRealm(JSContext* cx, JSObject* targetOrNull);
~JSAutoNullableRealm(); ~JSAutoNullableRealm();
}; };
namespace JS { namespace JS {

View file

@ -787,7 +787,6 @@ class MOZ_RAII EnvironmentIter {
} }
AbstractFramePtr maybeInitialFrame() const { return frame_; } AbstractFramePtr maybeInitialFrame() const { return frame_; }
}; };
// The key in MissingEnvironmentMap. For live frames, maps live frames to // The key in MissingEnvironmentMap. For live frames, maps live frames to

View file

@ -670,7 +670,6 @@ void RunPendingSourceCompressions(JSRuntime* runtime);
class MOZ_RAII AutoLockHelperThreadState : public LockGuard<Mutex> { class MOZ_RAII AutoLockHelperThreadState : public LockGuard<Mutex> {
using Base = LockGuard<Mutex>; using Base = LockGuard<Mutex>;
public: public:
explicit AutoLockHelperThreadState() : Base(HelperThreadState().helperLock) {} explicit AutoLockHelperThreadState() : Base(HelperThreadState().helperLock) {}
}; };
@ -678,7 +677,6 @@ class MOZ_RAII AutoLockHelperThreadState : public LockGuard<Mutex> {
class MOZ_RAII AutoUnlockHelperThreadState : public UnlockGuard<Mutex> { class MOZ_RAII AutoUnlockHelperThreadState : public UnlockGuard<Mutex> {
using Base = UnlockGuard<Mutex>; using Base = UnlockGuard<Mutex>;
public: public:
explicit AutoUnlockHelperThreadState(AutoLockHelperThreadState& locked) explicit AutoUnlockHelperThreadState(AutoLockHelperThreadState& locked)
: Base(locked) {} : Base(locked) {}

View file

@ -1144,7 +1144,6 @@ class MOZ_RAII AutoLockScriptData {
#endif #endif
} }
} }
}; };
// A token used to prove you can safely access the atoms zone. This zone is // A token used to prove you can safely access the atoms zone. This zone is

View file

@ -192,7 +192,6 @@ using NewObjectMetadataState =
mozilla::Variant<ImmediateMetadata, DelayMetadata, PendingMetadata>; mozilla::Variant<ImmediateMetadata, DelayMetadata, PendingMetadata>;
class MOZ_RAII AutoSetNewObjectMetadata { class MOZ_RAII AutoSetNewObjectMetadata {
JSContext* cx_; JSContext* cx_;
Rooted<NewObjectMetadataState> prevState_; Rooted<NewObjectMetadataState> prevState_;

View file

@ -12,7 +12,8 @@ namespace mozilla {
// https://drafts.csswg.org/css-overflow/#overflow-propagation // https://drafts.csswg.org/css-overflow/#overflow-propagation
// "If `visible` is applied to the viewport, it must be interpreted as `auto`. // "If `visible` is applied to the viewport, it must be interpreted as `auto`.
// If `clip` is applied to the viewport, it must be interpreted as `hidden`." // If `clip` is applied to the viewport, it must be interpreted as `hidden`."
static StyleOverflow MapOverflowValueForViewportPropagation(StyleOverflow aOverflow) { static StyleOverflow MapOverflowValueForViewportPropagation(
StyleOverflow aOverflow) {
switch (aOverflow) { switch (aOverflow) {
case StyleOverflow::Visible: case StyleOverflow::Visible:
return StyleOverflow::Auto; return StyleOverflow::Auto;
@ -35,7 +36,8 @@ ScrollStyles::ScrollStyles(StyleOverflow aH, StyleOverflow aV)
ScrollStyles::ScrollStyles(const nsStyleDisplay& aDisplay, ScrollStyles::ScrollStyles(const nsStyleDisplay& aDisplay,
MapOverflowToValidScrollStyleTag) MapOverflowToValidScrollStyleTag)
: ScrollStyles(MapOverflowValueForViewportPropagation(aDisplay.mOverflowX), : ScrollStyles(
MapOverflowValueForViewportPropagation(aDisplay.mOverflowX),
MapOverflowValueForViewportPropagation(aDisplay.mOverflowY)) {} MapOverflowValueForViewportPropagation(aDisplay.mOverflowY)) {}
bool ScrollStyles::IsHiddenInBothDirections() const { bool ScrollStyles::IsHiddenInBothDirections() const {

View file

@ -1090,7 +1090,8 @@ static bool CheckOverflow(const ComputedStyle* aComputedStyle,
return false; return false;
} }
*aStyles = ScrollStyles(*display, ScrollStyles::MapOverflowToValidScrollStyle); *aStyles =
ScrollStyles(*display, ScrollStyles::MapOverflowToValidScrollStyle);
return true; return true;
} }

View file

@ -405,8 +405,7 @@ already_AddRefed<imgRequestProxy> ImageLoader::LoadImage(
RefPtr<imgRequestProxy> request; RefPtr<imgRequestProxy> request;
nsresult rv = nsContentUtils::LoadImage( nsresult rv = nsContentUtils::LoadImage(
uri, &aDocument, &aDocument, data.Principal(), 0, data.ReferrerInfo(), uri, &aDocument, &aDocument, data.Principal(), 0, data.ReferrerInfo(),
sImageObserver, loadFlags, u"css"_ns, sImageObserver, loadFlags, u"css"_ns, getter_AddRefs(request));
getter_AddRefs(request));
if (NS_FAILED(rv) || !request) { if (NS_FAILED(rv) || !request) {
return nullptr; return nullptr;

View file

@ -129,7 +129,8 @@ class SharedStyleSheetCache final : public nsIMemoryReporter {
// //
// Note that we hold on to all sheet loads, even if in the end they happen not // Note that we hold on to all sheet loads, even if in the end they happen not
// to be cacheable. // to be cacheable.
nsDataHashtable<SheetLoadDataHashKey, WeakPtr<css::SheetLoadData>> mLoadingDatas; nsDataHashtable<SheetLoadDataHashKey, WeakPtr<css::SheetLoadData>>
mLoadingDatas;
// An origin-to-number-of-registered-documents count, in order to manage cache // An origin-to-number-of-registered-documents count, in order to manage cache
// eviction as described in RegisterLoader / UnregisterLoader. // eviction as described in RegisterLoader / UnregisterLoader.

View file

@ -32,7 +32,8 @@ LazyLogModule gDtmfLog("RTCDTMFSender");
RTCDTMFSender::RTCDTMFSender(nsPIDOMWindowInner* aWindow, RTCDTMFSender::RTCDTMFSender(nsPIDOMWindowInner* aWindow,
TransceiverImpl* aTransceiver, TransceiverImpl* aTransceiver,
AudioSessionConduit* aConduit) AudioSessionConduit* aConduit)
: DOMEventTargetHelper(aWindow), mTransceiver(aTransceiver), : DOMEventTargetHelper(aWindow),
mTransceiver(aTransceiver),
mConduit(aConduit) {} mConduit(aConduit) {}
JSObject* RTCDTMFSender::WrapObject(JSContext* aCx, JSObject* RTCDTMFSender::WrapObject(JSContext* aCx,

View file

@ -192,9 +192,7 @@ class SupportsWeakPtr {
using WeakReference = detail::WeakReference; using WeakReference = detail::WeakReference;
protected: protected:
~SupportsWeakPtr() { ~SupportsWeakPtr() { DetachWeakPtr(); }
DetachWeakPtr();
}
protected: protected:
void DetachWeakPtr() { void DetachWeakPtr() {

View file

@ -634,7 +634,6 @@ class MOZ_RAII AutoProfilerStats {
~AutoProfilerStats() { mStats.AddDurationFrom(mStart); } ~AutoProfilerStats() { mStats.AddDurationFrom(mStart); }
private: private:
StaticBaseProfilerStats& mStats; StaticBaseProfilerStats& mStats;
TimeStamp mStart; TimeStamp mStart;
}; };
@ -1006,7 +1005,6 @@ class MOZ_RAII AutoProfilerLabel {
MFBT_API static ProfilingStack* GetProfilingStack(); MFBT_API static ProfilingStack* GetProfilingStack();
private: private:
// We save a ProfilingStack pointer in the ctor so we don't have to redo the // We save a ProfilingStack pointer in the ctor so we don't have to redo the
// TLS lookup in the dtor. // TLS lookup in the dtor.
ProfilingStack* mProfilingStack; ProfilingStack* mProfilingStack;

View file

@ -305,7 +305,6 @@ TRRLoadInfo::GetInnerWindowID(uint64_t* aResult) {
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_IMETHODIMP NS_IMETHODIMP
TRRLoadInfo::GetBrowsingContextID(uint64_t* aResult) { TRRLoadInfo::GetBrowsingContextID(uint64_t* aResult) {
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;

View file

@ -181,8 +181,7 @@ void Http3Session::Shutdown() {
Http3Session::~Http3Session() { Http3Session::~Http3Session() {
LOG3(("Http3Session::~Http3Session %p", this)); LOG3(("Http3Session::~Http3Session %p", this));
Telemetry::Accumulate(Telemetry::HTTP3_REQUEST_PER_CONN, Telemetry::Accumulate(Telemetry::HTTP3_REQUEST_PER_CONN, mTransactionCount);
mTransactionCount);
Shutdown(); Shutdown();
} }

View file

@ -1216,7 +1216,6 @@ class MOZ_RAII AutoProfilerLabel {
} }
private: private:
// We save a ProfilingStack pointer in the ctor so we don't have to redo the // We save a ProfilingStack pointer in the ctor so we don't have to redo the
// TLS lookup in the dtor. // TLS lookup in the dtor.
ProfilingStack* mProfilingStack; ProfilingStack* mProfilingStack;

View file

@ -270,9 +270,11 @@ NS_IMETHODIMP nsDeviceContextSpecX::Init(nsIWidget* aWidget, nsIPrintSettings* a
mPrintViaSkPDF = true; mPrintViaSkPDF = true;
} else if (destination == kPMDestinationFile) { } else if (destination == kPMDestinationFile) {
AutoCFRelease<CFURLRef> destURL(nullptr); AutoCFRelease<CFURLRef> destURL(nullptr);
status = ::PMSessionCopyDestinationLocation(mPrintSession, mPrintSettings, destURL.receive()); status =
::PMSessionCopyDestinationLocation(mPrintSession, mPrintSettings, destURL.receive());
if (status == noErr) { if (status == noErr) {
AutoCFRelease<CFStringRef> destPathRef = CFURLCopyFileSystemPath(destURL, kCFURLPOSIXPathStyle); AutoCFRelease<CFStringRef> destPathRef =
CFURLCopyFileSystemPath(destURL, kCFURLPOSIXPathStyle);
NSString* destPath = (NSString*)CFStringRef(destPathRef); NSString* destPath = (NSString*)CFStringRef(destPathRef);
NSString* destPathExt = [destPath pathExtension]; NSString* destPathExt = [destPath pathExtension];
if ([destPathExt isEqualToString:@"pdf"]) { if ([destPathExt isEqualToString:@"pdf"]) {
@ -367,12 +369,15 @@ NS_IMETHODIMP nsDeviceContextSpecX::EndDocument() {
} }
case kPMDestinationFile: { case kPMDestinationFile: {
AutoCFRelease<CFURLRef> destURL(nullptr); AutoCFRelease<CFURLRef> destURL(nullptr);
status = ::PMSessionCopyDestinationLocation(mPrintSession, mPrintSettings, destURL.receive()); status =
::PMSessionCopyDestinationLocation(mPrintSession, mPrintSettings, destURL.receive());
if (status == noErr) { if (status == noErr) {
AutoCFRelease<CFStringRef> sourcePathRef = CFURLCopyFileSystemPath(pdfURL, kCFURLPOSIXPathStyle); AutoCFRelease<CFStringRef> sourcePathRef =
CFURLCopyFileSystemPath(pdfURL, kCFURLPOSIXPathStyle);
NSString* sourcePath = (NSString*)CFStringRef(sourcePathRef); NSString* sourcePath = (NSString*)CFStringRef(sourcePathRef);
# ifdef DEBUG # ifdef DEBUG
AutoCFRelease<CFStringRef> destPathRef = CFURLCopyFileSystemPath(destURL, kCFURLPOSIXPathStyle); AutoCFRelease<CFStringRef> destPathRef =
CFURLCopyFileSystemPath(destURL, kCFURLPOSIXPathStyle);
NSString* destPath = (NSString*)CFStringRef(destPathRef); NSString* destPath = (NSString*)CFStringRef(destPathRef);
NSString* destPathExt = [destPath pathExtension]; NSString* destPathExt = [destPath pathExtension];
MOZ_ASSERT([destPathExt isEqualToString:@"pdf"], MOZ_ASSERT([destPathExt isEqualToString:@"pdf"],

View file

@ -30,6 +30,7 @@ class MOZ_RAII AutoRestore {
private: private:
T& mLocation; T& mLocation;
T mValue; T mValue;
public: public:
explicit AutoRestore(T& aValue) : mLocation(aValue), mValue(aValue) {} explicit AutoRestore(T& aValue) : mLocation(aValue), mValue(aValue) {}
~AutoRestore() { mLocation = mValue; } ~AutoRestore() { mLocation = mValue; }