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

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
This commit is contained in:
Sylvestre Ledru 2020-07-04 09:38:43 +00:00
parent 1fa2c4a121
commit caf785c695
40 changed files with 152 additions and 166 deletions

View File

@ -18,8 +18,7 @@ namespace a11y {
static StaticAutoPtr<PlatformChild> sPlatformChild;
DocAccessibleChild::DocAccessibleChild(DocAccessible* aDoc, IProtocol* aManager)
: DocAccessibleChildBase(aDoc),
mEmulatedWindowHandle(nullptr) {
: DocAccessibleChildBase(aDoc), mEmulatedWindowHandle(nullptr) {
MOZ_COUNT_CTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
if (!sPlatformChild) {
sPlatformChild = new PlatformChild();

View File

@ -39,12 +39,10 @@ class GeckoTextMarker final {
class GeckoTextMarkerRange final {
public:
GeckoTextMarkerRange(const GeckoTextMarker& aStart,
const GeckoTextMarker& aEnd)
GeckoTextMarkerRange(const GeckoTextMarker& aStart, const GeckoTextMarker& aEnd)
: mStart(aStart), mEnd(aEnd) {}
GeckoTextMarkerRange(AccessibleOrProxy aDoc,
AXTextMarkerRangeRef aTextMarkerRange);
GeckoTextMarkerRange(AccessibleOrProxy aDoc, AXTextMarkerRangeRef aTextMarkerRange);
id CreateAXTextMarkerRange();
@ -77,8 +75,7 @@ class GeckoTextMarkerRange final {
* @param aStartIntlOffset [in] start offset if current node is a text node
* @return true if calculation is not finished yet
*/
bool TextInternal(nsAString& aText, AccessibleOrProxy aCurrent,
int32_t aStartIntlOffset) const;
bool TextInternal(nsAString& aText, AccessibleOrProxy aCurrent, int32_t aStartIntlOffset) const;
};
} // namespace a11y

View File

@ -146,13 +146,13 @@ namespace std {
template basic_ios<char, char_traits<char>>::operator bool() const;
} // namespace std
#if !defined(MOZ_ASAN) && !defined(MOZ_TSAN)
# if !defined(MOZ_ASAN) && !defined(MOZ_TSAN)
/* operator delete with size is only available in CXXAPI_1.3.9, equivalent to
* GLIBCXX_3.4.21. */
void operator delete(void* ptr, size_t size) noexcept(true) {
::operator delete(ptr);
}
#endif
# endif
#endif
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 23)

View File

@ -818,7 +818,7 @@ class CopyableErrorResult
// Allow conversion to ErrorResult&& so we can move out of ourselves into
// an ErrorResult.
operator ErrorResult &&() && {
operator ErrorResult&&() && {
auto* val = reinterpret_cast<ErrorResult*>(this);
return std::move(*val);
}

View File

@ -485,7 +485,8 @@ bool WebGLContext::CreateAndInitGL(
mIncompleteTexOverride.reset(new gl::Texture(*gl));
const gl::ScopedBindTexture autoBind(gl, mIncompleteTexOverride->name);
const auto heapVal = std::make_unique<uint32_t>(val);
gl->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGBA, 1, 1, 0, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, heapVal.get());
gl->fTexImage2D(LOCAL_GL_TEXTURE_2D, 0, LOCAL_GL_RGBA, 1, 1, 0,
LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, heapVal.get());
}
return true;

View File

@ -144,11 +144,12 @@ ScopedResolveTexturesForDraw::ScopedResolveTexturesForDraw(
const auto& gl = mWebGL->gl;
for (const auto& itr : mRebindRequests) {
gl->fActiveTexture(LOCAL_GL_TEXTURE0 + itr.texUnit);
GLuint incompleteTex = 0; // Tex 0 is always incomplete.
GLuint incompleteTex = 0; // Tex 0 is always incomplete.
const auto& overrideTex = webgl->mIncompleteTexOverride;
if (overrideTex) {
// In all but the simplest cases, this will be incomplete anyway, since e.g. int-samplers need int-textures.
// This is useful for e.g. dom-to-texture failures, though.
// In all but the simplest cases, this will be incomplete anyway, since
// e.g. int-samplers need int-textures. This is useful for e.g.
// dom-to-texture failures, though.
incompleteTex = overrideTex->name;
}
gl->fBindTexture(itr.tex->Target().get(), incompleteTex);

View File

@ -381,8 +381,8 @@ void MediaController::HandlePositionStateChanged(const PositionState& aState) {
init.mDuration = aState.mDuration;
init.mPlaybackRate = aState.mPlaybackRate;
init.mPosition = aState.mLastReportedPlaybackPosition;
RefPtr<PositionStateEvent> event = PositionStateEvent::Constructor(
this, u"positionstatechange"_ns, init);
RefPtr<PositionStateEvent> event =
PositionStateEvent::Constructor(this, u"positionstatechange"_ns, init);
DispatchAsyncEvent(event);
}

View File

@ -4394,9 +4394,10 @@ class HTMLEditor final : public TextEditor,
const nsAString& aInfoStr, nsCOMPtr<nsINode>* aOutFragNode,
nsCOMPtr<nsINode>* aOutStartNode, nsCOMPtr<nsINode>* aOutEndNode,
int32_t* aOutStartOffset, int32_t* aOutEndOffset, bool aTrustedInput);
static nsresult ParseFragment(const nsAString& aStr, nsAtom* aContextLocalName,
Document* aTargetDoc,
dom::DocumentFragment** aFragment, bool aTrustedInput);
static nsresult ParseFragment(const nsAString& aStr,
nsAtom* aContextLocalName, Document* aTargetDoc,
dom::DocumentFragment** aFragment,
bool aTrustedInput);
/**
* @param aInfoStr as indicated by nsITransferable's kHTMLInfo.

View File

@ -59,8 +59,10 @@ class SwapChain final {
private:
std::queue<std::shared_ptr<SharedSurface>> mPool;
std::shared_ptr<SharedSurface> mFrontBuffer;
public:
std::shared_ptr<SharedSurface> mPrevFrontBuffer; // Hold this ref while it's in-flight.
std::shared_ptr<SharedSurface>
mPrevFrontBuffer; // Hold this ref while it's in-flight.
private:
SwapChainPresenter* mPresenter = nullptr;

View File

@ -7,12 +7,12 @@
#include "CompositorAnimationStorage.h"
#include "AnimationHelper.h"
#include "mozilla/layers/CompositorThread.h" // for CompositorThreadHolder
#include "mozilla/layers/CompositorThread.h" // for CompositorThreadHolder
#include "mozilla/layers/LayerManagerComposite.h" // for LayerComposite, etc
#include "mozilla/ServoStyleConsts.h"
#include "mozilla/webrender/WebRenderTypes.h" // for ToWrTransformProperty, etc
#include "nsDeviceContext.h" // for AppUnitsPerCSSPixel
#include "nsDisplayList.h" // for nsDisplayTransform, etc
#include "nsDeviceContext.h" // for AppUnitsPerCSSPixel
#include "nsDisplayList.h" // for nsDisplayTransform, etc
#include "TreeTraversal.h" // for ForEachNode, BreadthFirstSearch
namespace mozilla {

View File

@ -9,8 +9,8 @@
#include "gfxFontFeatures.h" // for gfxFontFeature, etc
#include "gfxFontUtils.h" // for TRUETYPE_TAG
#include "mozilla/ServoStyleConstsInlines.h"
#include "nsCRT.h" // for nsCRT
#include "nsDebug.h" // for NS_ASSERTION
#include "nsCRT.h" // for nsCRT
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupports.h"
#include "nsUnicharUtils.h"
#include "nscore.h" // for char16_t

View File

@ -14,7 +14,7 @@
#include "gfxFontFeatures.h"
#include "gfxFontVariations.h"
#include "mozilla/FontPropertyTypes.h"
#include "mozilla/RefPtr.h" // for RefPtr
#include "mozilla/RefPtr.h" // for RefPtr
#include "mozilla/ServoStyleConstsInlines.h"
#include "mozilla/StyleColorInlines.h" // for StyleRGBA
#include "nsCoord.h" // for nscoord

View File

@ -837,8 +837,7 @@ Family* FontList::FindFamily(const nsCString& aName) {
families = AliasFamilies();
size_t match;
if (families && BinarySearchIf(families, 0, header.mAliasCount,
FamilyNameComparator(this, aName),
&match)) {
FamilyNameComparator(this, aName), &match)) {
return &families[match];
}
}
@ -871,9 +870,9 @@ Family* FontList::FindFamily(const nsCString& aName) {
nsAutoCString strippedName(aName.BeginReading(),
aName.Length() - styleName.Length());
families = Families();
if (families && BinarySearchIf(families, 0, header.mFamilyCount,
FamilyNameComparator(this, strippedName),
&match)) {
if (families &&
BinarySearchIf(families, 0, header.mFamilyCount,
FamilyNameComparator(this, strippedName), &match)) {
// If so, this may be a possible family to satisfy the search; check
// if the extended family name was actually found as an alternate
// (either it's already in mAliasTable, or it gets added there when

View File

@ -803,7 +803,8 @@ void gfxPlatformFontList::GetFontList(nsAtom* aLangGroup,
if (!IsVisibleToCSS(f)) {
continue;
}
// XXX TODO: filter families for aGenericFamily, if supported by platform
// XXX TODO: filter families for aGenericFamily, if supported by
// platform
aListOfFonts.AppendElement(
NS_ConvertUTF8toUTF16(f.DisplayName().AsString(list)));
}

View File

@ -22,10 +22,10 @@
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::CreateWritableStreamDefaultWriter, js::WritableStreamDefaultWriter
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStreamCloseQueuedOrInFlight
#include "builtin/streams/WritableStreamWriterOperations.h" // js::WritableStreamDefaultWriter{GetDesiredSize,Release,Write}
#include "js/CallArgs.h" // JS::CallArgsFromVp, JS::CallArgs
#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS
#include "js/Promise.h" // JS::AddPromiseReactions
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
#include "js/CallArgs.h" // JS::CallArgsFromVp, JS::CallArgs
#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS
#include "js/Promise.h" // JS::AddPromiseReactions
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
#include "js/Value.h" // JS::{,Int32,Magic,Object}Value, JS::UndefinedHandleValue
#include "vm/PromiseObject.h" // js::PromiseObject

View File

@ -9,7 +9,7 @@
#ifndef builtin_streams_PipeToState_h
#define builtin_streams_PipeToState_h
#include "mozilla/Assertions.h" // MOZ_ASSERT
#include "mozilla/Assertions.h" // MOZ_ASSERT
#include "mozilla/WrappingOperations.h" // mozilla::WrapToSigned
#include <stdint.h> // uint32_t

View File

@ -21,10 +21,10 @@
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStream{Abort,CloseQueuedOrInFlight}
#include "js/Promise.h" // JS::PromiseState
#include "js/Value.h" // JS::Value, JS::{Int32,Null}Value
#include "vm/Compartment.h" // JS::Compartment
#include "vm/Interpreter.h" // js::GetAndClearException
#include "vm/JSContext.h" // JSContext
#include "js/Value.h" // JS::Value, JS::{Int32,Null}Value
#include "vm/Compartment.h" // JS::Compartment
#include "vm/Interpreter.h" // js::GetAndClearException
#include "vm/JSContext.h" // JSContext
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled

View File

@ -247,7 +247,6 @@ js::Nursery::Nursery(GCRuntime* gc)
}
bool js::Nursery::init(AutoLockGCBgAlloc& lock) {
char* env = getenv("JS_GC_PROFILE_NURSERY");
if (env) {
if (0 == strcmp(env, "help")) {

View File

@ -92,8 +92,7 @@ class SweepGroupZonesIter {
: current(gc->getCurrentSweepGroup()) {
MOZ_ASSERT(CurrentThreadIsPerformingGC());
}
explicit SweepGroupZonesIter(JSRuntime* rt)
: SweepGroupZonesIter(&rt->gc) {}
explicit SweepGroupZonesIter(JSRuntime* rt) : SweepGroupZonesIter(&rt->gc) {}
bool done() const { return !current; }

View File

@ -14,8 +14,8 @@
#include "jstypes.h"
#include "gc/Allocator.h" // AllowGC
#include "gc/Cell.h" // gc::TenuredCellWithNonGCPointer
#include "gc/Allocator.h" // AllowGC
#include "gc/Cell.h" // gc::TenuredCellWithNonGCPointer
#include "jit/ExecutableAllocator.h" // ExecutablePool
#include "js/TraceKind.h" // JS::TraceKind
#include "js/UbiNode.h" // ubi::{TracerConcrete, Size, CourseType}

View File

@ -74,7 +74,6 @@ class BigInt final : public js::gc::CellWithLengthAndFlags {
js::gc::AllocKind getAllocKind() const { return js::gc::AllocKind::BIGINT; }
// Offset for direct access from JIT code.
static constexpr size_t offsetOfDigitLength() {
return offsetOfHeaderLength();

View File

@ -170,7 +170,6 @@ class ObjectGroup : public gc::TenuredCellWithNonGCPointer<const JSClass> {
friend class js::jit::MacroAssembler;
public:
bool hasDynamicPrototype() const { return proto_.isDynamic(); }
const GCPtr<TaggedProto>& proto() const { return proto_; }

View File

@ -711,9 +711,9 @@ class BaseShape : public gc::TenuredCellWithNonGCPointer<const JSClass> {
/* Class of referring object, stored in the cell header */
const JSClass* clasp() const { return headerPtr(); }
uint32_t flags; /* Vector of above flags. */
uint32_t slotSpan_; /* Object slot span for BaseShapes at
* dictionary last properties. */
uint32_t flags; /* Vector of above flags. */
uint32_t slotSpan_; /* Object slot span for BaseShapes at
* dictionary last properties. */
/* For owned BaseShapes, the canonical unowned BaseShape. */
GCPtrUnownedBaseShape unowned_;
@ -732,7 +732,6 @@ class BaseShape : public gc::TenuredCellWithNonGCPointer<const JSClass> {
/* Not defined: BaseShapes must not be stack allocated. */
~BaseShape();
bool isOwned() const { return !!(flags & OWNED_SHAPE); }
static void copyFromUnowned(BaseShape& dest, UnownedBaseShape& src);

View File

@ -3072,8 +3072,7 @@ class ChildCounter {
size_t objCountsIndex;
public:
explicit ChildCounter(JSContext* cx)
: cx(cx), counts(cx), objsLength(0) {}
explicit ChildCounter(JSContext* cx) : cx(cx), counts(cx), objsLength(0) {}
void noteObjIsOnTopOfStack() { objCountsIndex = counts.length() - 1; }

View File

@ -835,8 +835,8 @@ void nsTextControlFrame::ScrollSelectionIntoViewAsync(
}
int16_t flags = aScrollAncestors == ScrollAncestors::Yes
? 0
: nsISelectionController::SCROLL_FIRST_ANCESTOR_ONLY;
? 0
: nsISelectionController::SCROLL_FIRST_ANCESTOR_ONLY;
// Scroll the selection into view (see bug 231389).
selCon->ScrollSelectionIntoView(

View File

@ -415,7 +415,8 @@ void StyleSheetInfo::AddSheet(StyleSheet* aSheet) {
void StyleSheetInfo::RemoveSheet(StyleSheet* aSheet) {
// Fix up the parent pointer in children lists.
StyleSheet* newParent = aSheet == mSheets[0] ? mSheets.SafeElementAt(1) : mSheets[0];
StyleSheet* newParent =
aSheet == mSheets[0] ? mSheets.SafeElementAt(1) : mSheets[0];
for (StyleSheet* child : mChildren) {
MOZ_ASSERT(child->mParentSheet);
MOZ_ASSERT(child->mParentSheet->mInner == this);

View File

@ -38,7 +38,6 @@
# include "malloc_decls.h"
#endif
#if defined(__cplusplus)
# include "mozilla/fallible.h"
# include "mozilla/mozalloc_abort.h"

View File

@ -85,8 +85,8 @@
* Our supported compilers provide architecture-independent macros for this.
* Yes, there are more than two values for __BYTE_ORDER__.
*/
#if defined(__BYTE_ORDER__) && \
defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__)
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
defined(__ORDER_BIG_ENDIAN__)
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define MOZ_LITTLE_ENDIAN() 1
# define MOZ_BIG_ENDIAN() 0

View File

@ -177,7 +177,7 @@ auto getter_Transfers(UniquePtr<T, D>& up) {
explicit UniquePtrGetterTransfers(Ptr& p) : mPtr(p) {}
~UniquePtrGetterTransfers() { mPtr.reset(mRawPtr); }
operator typename Ptr::ElementType**() { return &mRawPtr; }
operator typename Ptr::ElementType **() { return &mRawPtr; }
operator void**() { return reinterpret_cast<void**>(&mRawPtr); }
typename Ptr::ElementType*& operator*() { return mRawPtr; }

View File

@ -43,9 +43,9 @@
#ifdef MOZ_GECKO_PROFILER
MOZ_MAYBE_UNUSED static void SleepMilli(unsigned aMilliseconds) {
#if defined(_MSC_VER) || defined(__MINGW32__)
# if defined(_MSC_VER) || defined(__MINGW32__)
Sleep(aMilliseconds);
#else
# else
struct timespec ts = {/* .tv_sec */ static_cast<time_t>(aMilliseconds / 1000),
/* ts.tv_nsec */ long(aMilliseconds % 1000) * 1000000};
struct timespec tr = {0, 0};
@ -57,7 +57,7 @@ MOZ_MAYBE_UNUSED static void SleepMilli(unsigned aMilliseconds) {
exit(1);
}
}
#endif
# endif
}
using namespace mozilla;

View File

@ -154,7 +154,7 @@ nsresult Http3Stream::OnReadSegment(const char* buf, uint32_t count,
}
mSendState = WAITING_TO_ACTIVATE;
}
[[fallthrough]];
[[fallthrough]];
case WAITING_TO_ACTIVATE:
rv = TryActivating();
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
@ -309,7 +309,8 @@ nsresult Http3Stream::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count,
// is already done.
LOG3(
("Http3Stream %p ReadSegments request stream aborted due to"
" response side closure\n", this));
" response side closure\n",
this));
return NS_ERROR_ABORT;
}
@ -320,8 +321,7 @@ nsresult Http3Stream::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count,
// A transaction that had already generated its headers before it was
// queued at the session level (due to concurrency concerns) may not call
// onReadSegment off the ReadSegments() stack above.
LOG3(
("Http3Stream %p ReadSegments forcing OnReadSegment call\n", this));
LOG3(("Http3Stream %p ReadSegments forcing OnReadSegment call\n", this));
uint32_t wasted = 0;
nsresult rv2 = OnReadSegment("", 0, &wasted);
LOG3((" OnReadSegment returned 0x%08" PRIx32,
@ -330,8 +330,8 @@ nsresult Http3Stream::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count,
break;
}
}
// If we are in state SENDING_BODY we can continue sending data.
[[fallthrough]];
// If we are in state SENDING_BODY we can continue sending data.
[[fallthrough]];
case PREPARING_HEADERS:
case SENDING_BODY: {
rv = mTransaction->ReadSegments(this, count, countRead);

View File

@ -23,7 +23,7 @@ enum {
kCharsetFromIrreversibleAutoDetection,
kCharsetFromChannel,
kCharsetFromOtherComponent,
kCharsetFromUserForced, // propagates to child frames
kCharsetFromUserForced, // propagates to child frames
kCharsetFromUserForcedAutoDetection,
kCharsetFromByteOrderMark,
kCharsetFromUtf8OnlyMime, // For JSON, WebVTT and such

View File

@ -80,8 +80,8 @@ bool RemoteSandboxBroker::LaunchApp(
// We need to wait on the current thread for the process to launch which will
// block the running IPC Launch taskqueue. We cannot use
// GetCurrentSerialEventTarget() (as this returns the currently running
// TaskQueue) to resolve our promise as it will be blocked until we return from
// this function.
// TaskQueue) to resolve our promise as it will be blocked until we return
// from this function.
nsCOMPtr<nsISerialEventTarget> target = NS_GetCurrentThread();
mParent.Launch(mParameters.shareHandles(), target)
->Then(target, __func__, std::move(resolve), std::move(reject));

View File

@ -43,8 +43,7 @@ nsUrlClassifierPrefixSet::Init(const nsACString& aName) {
return NS_OK;
}
nsUrlClassifierPrefixSet::~nsUrlClassifierPrefixSet() {
}
nsUrlClassifierPrefixSet::~nsUrlClassifierPrefixSet() {}
void nsUrlClassifierPrefixSet::Clear() {
LOG(("[%s] Clearing PrefixSet", mName.get()));

View File

@ -680,7 +680,6 @@ const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id) {
// Renoir
APPEND_DEVICE(0x1636);
#ifdef EARLY_BETA_OR_EARLIER
// Stoney
APPEND_DEVICE(0x98e4);

View File

@ -1625,7 +1625,8 @@ void GfxInfoBase::DescribeFeatures(JSContext* aCx, JS::Handle<JSObject*> aObj) {
gfxConfig::GetFeature(gfx::Feature::WEBRENDER_COMPOSITOR);
InitFeatureObject(aCx, aObj, "wrCompositor", wrCompositor, &obj);
gfx::FeatureState& openglCompositing = gfxConfig::GetFeature(gfx::Feature::OPENGL_COMPOSITING);
gfx::FeatureState& openglCompositing =
gfxConfig::GetFeature(gfx::Feature::OPENGL_COMPOSITING);
InitFeatureObject(aCx, aObj, "openglCompositing", openglCompositing, &obj);
// Only include AL if the platform attempted to use it.

View File

@ -382,9 +382,9 @@ const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
OperatingSystem::OSX, DeviceFamily::IntelRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_INTEL_MAC");
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
OperatingSystem::OSX, DeviceFamily::AtiRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_AMD_MAC");
IMPLEMENT_MAC_DRIVER_BLOCKLIST(OperatingSystem::OSX, DeviceFamily::AtiRolloutWebRender,
nsIGfxInfo::FEATURE_WEBRENDER,
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_AMD_MAC");
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
OperatingSystem::OSX, DeviceFamily::NvidiaRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_NVIDIA_MAC");

View File

@ -98,7 +98,7 @@ class nsAutoOwningEventTarget {
_mOwningThread.AssertOwnership(#_class " not thread-safe")
#else // !MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
# define NS_DECL_OWNINGTHREAD /* nothing */
# define NS_DECL_OWNINGTHREAD /* nothing */
# define NS_DECL_OWNINGEVENTTARGET /* nothing */
# define NS_ASSERT_OWNINGTHREAD(_class) ((void)0)
@ -619,8 +619,7 @@ class ThreadSafeAutoRefCnt {
\
protected: \
nsAutoRefCnt mRefCnt; \
_owning \
public:
_owning public:
/**
* Use this macro to declare and implement the AddRef & Release methods for a

View File

@ -1459,7 +1459,7 @@ nsTSubstringSplitter<T> nsTSubstring<T>::Split(const char_type aChar) const {
template <typename T>
const nsTDependentSubstring<T>&
nsTSubstringSplitter<T>::nsTSubstringSplit_Iter::operator*() const {
nsTSubstringSplitter<T>::nsTSubstringSplit_Iter::operator*() const {
return mObj.Get(mPos);
}

View File

@ -511,29 +511,27 @@ TEST(MozPromise, DirectTaskDispatch)
// For direct task dispatch to be working, we must be within a
// nested event loop. So the test itself must be dispatched within
// a task.
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
EXPECT_EQ(value1, true);
value2 = true;
}));
GetCurrentSerialEventTarget()->Dispatch(NS_NewRunnableFunction("test", [&]() {
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
EXPECT_EQ(value1, true);
value2 = true;
}));
RefPtr<TestPromise::Private> promise =
new TestPromise::Private(__func__);
promise->UseDirectTaskDispatch(__func__);
promise->Resolve(42, __func__);
EXPECT_EQ(value1, false);
promise->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> void {
EXPECT_EQ(aResolveValue, 42);
EXPECT_EQ(value2, false);
value1 = true;
},
DO_FAIL);
EXPECT_EQ(value1, false);
}));
RefPtr<TestPromise::Private> promise = new TestPromise::Private(__func__);
promise->UseDirectTaskDispatch(__func__);
promise->Resolve(42, __func__);
EXPECT_EQ(value1, false);
promise->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> void {
EXPECT_EQ(aResolveValue, 42);
EXPECT_EQ(value2, false);
value1 = true;
},
DO_FAIL);
EXPECT_EQ(value1, false);
}));
// Spin the event loop.
NS_ProcessPendingEvents(nullptr);
@ -547,42 +545,40 @@ TEST(MozPromise, ChainedDirectTaskDispatch)
// For direct task dispatch to be working, we must be within a
// nested event loop. So the test itself must be dispatched within
// a task.
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
EXPECT_EQ(value1, true);
value2 = true;
}));
GetCurrentSerialEventTarget()->Dispatch(NS_NewRunnableFunction("test", [&]() {
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
EXPECT_EQ(value1, true);
value2 = true;
}));
RefPtr<TestPromise::Private> promise1 =
new TestPromise::Private(__func__);
promise1->UseDirectTaskDispatch(__func__);
promise1->Resolve(42, __func__);
EXPECT_EQ(value1, false);
promise1
->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> RefPtr<TestPromise> {
EXPECT_EQ(aResolveValue, 42);
EXPECT_EQ(value2, false);
RefPtr<TestPromise::Private> promise2 =
new TestPromise::Private(__func__);
promise2->UseDirectTaskDispatch(__func__);
promise2->Resolve(43, __func__);
return promise2;
},
DO_FAIL)
->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> void {
EXPECT_EQ(aResolveValue, 43);
EXPECT_EQ(value2, false);
value1 = true;
},
DO_FAIL);
EXPECT_EQ(value1, false);
}));
RefPtr<TestPromise::Private> promise1 = new TestPromise::Private(__func__);
promise1->UseDirectTaskDispatch(__func__);
promise1->Resolve(42, __func__);
EXPECT_EQ(value1, false);
promise1
->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> RefPtr<TestPromise> {
EXPECT_EQ(aResolveValue, 42);
EXPECT_EQ(value2, false);
RefPtr<TestPromise::Private> promise2 =
new TestPromise::Private(__func__);
promise2->UseDirectTaskDispatch(__func__);
promise2->Resolve(43, __func__);
return promise2;
},
DO_FAIL)
->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> void {
EXPECT_EQ(aResolveValue, 43);
EXPECT_EQ(value2, false);
value1 = true;
},
DO_FAIL);
EXPECT_EQ(value1, false);
}));
// Spin the event loop.
NS_ProcessPendingEvents(nullptr);
@ -596,33 +592,30 @@ TEST(MozPromise, ChainToDirectTaskDispatch)
// For direct task dispatch to be working, we must be within a
// nested event loop. So the test itself must be dispatched within
// a task.
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
EXPECT_EQ(value1, true);
value2 = true;
}));
GetCurrentSerialEventTarget()->Dispatch(NS_NewRunnableFunction("test", [&]() {
GetCurrentSerialEventTarget()->Dispatch(
NS_NewRunnableFunction("test", [&]() {
EXPECT_EQ(value1, true);
value2 = true;
}));
RefPtr<TestPromise::Private> promise1 =
new TestPromise::Private(__func__);
promise1->UseDirectTaskDispatch(__func__);
RefPtr<TestPromise::Private> promise1 = new TestPromise::Private(__func__);
promise1->UseDirectTaskDispatch(__func__);
RefPtr<TestPromise::Private> promise2 =
new TestPromise::Private(__func__);
promise2->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> void {
EXPECT_EQ(aResolveValue, 42);
EXPECT_EQ(value2, false);
value1 = true;
},
DO_FAIL);
RefPtr<TestPromise::Private> promise2 = new TestPromise::Private(__func__);
promise2->Then(
GetCurrentSerialEventTarget(), __func__,
[&](int aResolveValue) -> void {
EXPECT_EQ(aResolveValue, 42);
EXPECT_EQ(value2, false);
value1 = true;
},
DO_FAIL);
promise1->ChainTo(promise2.forget(), __func__);
EXPECT_EQ(value1, false);
promise1->Resolve(42, __func__);
}));
promise1->ChainTo(promise2.forget(), __func__);
EXPECT_EQ(value1, false);
promise1->Resolve(42, __func__);
}));
// Spin the event loop.
NS_ProcessPendingEvents(nullptr);