mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 19:41:49 +00:00
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:
parent
1fa2c4a121
commit
caf785c695
@ -18,8 +18,7 @@ namespace a11y {
|
|||||||
static StaticAutoPtr<PlatformChild> sPlatformChild;
|
static StaticAutoPtr<PlatformChild> sPlatformChild;
|
||||||
|
|
||||||
DocAccessibleChild::DocAccessibleChild(DocAccessible* aDoc, IProtocol* aManager)
|
DocAccessibleChild::DocAccessibleChild(DocAccessible* aDoc, IProtocol* aManager)
|
||||||
: DocAccessibleChildBase(aDoc),
|
: DocAccessibleChildBase(aDoc), mEmulatedWindowHandle(nullptr) {
|
||||||
mEmulatedWindowHandle(nullptr) {
|
|
||||||
MOZ_COUNT_CTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
|
MOZ_COUNT_CTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
|
||||||
if (!sPlatformChild) {
|
if (!sPlatformChild) {
|
||||||
sPlatformChild = new PlatformChild();
|
sPlatformChild = new PlatformChild();
|
||||||
|
@ -39,12 +39,10 @@ class GeckoTextMarker final {
|
|||||||
|
|
||||||
class GeckoTextMarkerRange final {
|
class GeckoTextMarkerRange final {
|
||||||
public:
|
public:
|
||||||
GeckoTextMarkerRange(const GeckoTextMarker& aStart,
|
GeckoTextMarkerRange(const GeckoTextMarker& aStart, const GeckoTextMarker& aEnd)
|
||||||
const GeckoTextMarker& aEnd)
|
|
||||||
: mStart(aStart), mEnd(aEnd) {}
|
: mStart(aStart), mEnd(aEnd) {}
|
||||||
|
|
||||||
GeckoTextMarkerRange(AccessibleOrProxy aDoc,
|
GeckoTextMarkerRange(AccessibleOrProxy aDoc, AXTextMarkerRangeRef aTextMarkerRange);
|
||||||
AXTextMarkerRangeRef aTextMarkerRange);
|
|
||||||
|
|
||||||
id CreateAXTextMarkerRange();
|
id CreateAXTextMarkerRange();
|
||||||
|
|
||||||
@ -77,8 +75,7 @@ class GeckoTextMarkerRange final {
|
|||||||
* @param aStartIntlOffset [in] start offset if current node is a text node
|
* @param aStartIntlOffset [in] start offset if current node is a text node
|
||||||
* @return true if calculation is not finished yet
|
* @return true if calculation is not finished yet
|
||||||
*/
|
*/
|
||||||
bool TextInternal(nsAString& aText, AccessibleOrProxy aCurrent,
|
bool TextInternal(nsAString& aText, AccessibleOrProxy aCurrent, int32_t aStartIntlOffset) const;
|
||||||
int32_t aStartIntlOffset) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
|
@ -146,13 +146,13 @@ namespace std {
|
|||||||
template basic_ios<char, char_traits<char>>::operator bool() const;
|
template basic_ios<char, char_traits<char>>::operator bool() const;
|
||||||
} // namespace std
|
} // 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
|
/* operator delete with size is only available in CXXAPI_1.3.9, equivalent to
|
||||||
* GLIBCXX_3.4.21. */
|
* GLIBCXX_3.4.21. */
|
||||||
void operator delete(void* ptr, size_t size) noexcept(true) {
|
void operator delete(void* ptr, size_t size) noexcept(true) {
|
||||||
::operator delete(ptr);
|
::operator delete(ptr);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 23)
|
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 23)
|
||||||
|
@ -818,7 +818,7 @@ class CopyableErrorResult
|
|||||||
|
|
||||||
// Allow conversion to ErrorResult&& so we can move out of ourselves into
|
// Allow conversion to ErrorResult&& so we can move out of ourselves into
|
||||||
// an ErrorResult.
|
// an ErrorResult.
|
||||||
operator ErrorResult &&() && {
|
operator ErrorResult&&() && {
|
||||||
auto* val = reinterpret_cast<ErrorResult*>(this);
|
auto* val = reinterpret_cast<ErrorResult*>(this);
|
||||||
return std::move(*val);
|
return std::move(*val);
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,8 @@ bool WebGLContext::CreateAndInitGL(
|
|||||||
mIncompleteTexOverride.reset(new gl::Texture(*gl));
|
mIncompleteTexOverride.reset(new gl::Texture(*gl));
|
||||||
const gl::ScopedBindTexture autoBind(gl, mIncompleteTexOverride->name);
|
const gl::ScopedBindTexture autoBind(gl, mIncompleteTexOverride->name);
|
||||||
const auto heapVal = std::make_unique<uint32_t>(val);
|
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;
|
return true;
|
||||||
|
@ -144,11 +144,12 @@ ScopedResolveTexturesForDraw::ScopedResolveTexturesForDraw(
|
|||||||
const auto& gl = mWebGL->gl;
|
const auto& gl = mWebGL->gl;
|
||||||
for (const auto& itr : mRebindRequests) {
|
for (const auto& itr : mRebindRequests) {
|
||||||
gl->fActiveTexture(LOCAL_GL_TEXTURE0 + itr.texUnit);
|
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;
|
const auto& overrideTex = webgl->mIncompleteTexOverride;
|
||||||
if (overrideTex) {
|
if (overrideTex) {
|
||||||
// In all but the simplest cases, this will be incomplete anyway, since e.g. int-samplers need int-textures.
|
// In all but the simplest cases, this will be incomplete anyway, since
|
||||||
// This is useful for e.g. dom-to-texture failures, though.
|
// e.g. int-samplers need int-textures. This is useful for e.g.
|
||||||
|
// dom-to-texture failures, though.
|
||||||
incompleteTex = overrideTex->name;
|
incompleteTex = overrideTex->name;
|
||||||
}
|
}
|
||||||
gl->fBindTexture(itr.tex->Target().get(), incompleteTex);
|
gl->fBindTexture(itr.tex->Target().get(), incompleteTex);
|
||||||
|
@ -381,8 +381,8 @@ void MediaController::HandlePositionStateChanged(const PositionState& aState) {
|
|||||||
init.mDuration = aState.mDuration;
|
init.mDuration = aState.mDuration;
|
||||||
init.mPlaybackRate = aState.mPlaybackRate;
|
init.mPlaybackRate = aState.mPlaybackRate;
|
||||||
init.mPosition = aState.mLastReportedPlaybackPosition;
|
init.mPosition = aState.mLastReportedPlaybackPosition;
|
||||||
RefPtr<PositionStateEvent> event = PositionStateEvent::Constructor(
|
RefPtr<PositionStateEvent> event =
|
||||||
this, u"positionstatechange"_ns, init);
|
PositionStateEvent::Constructor(this, u"positionstatechange"_ns, init);
|
||||||
DispatchAsyncEvent(event);
|
DispatchAsyncEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4394,9 +4394,10 @@ class HTMLEditor final : public TextEditor,
|
|||||||
const nsAString& aInfoStr, nsCOMPtr<nsINode>* aOutFragNode,
|
const nsAString& aInfoStr, nsCOMPtr<nsINode>* aOutFragNode,
|
||||||
nsCOMPtr<nsINode>* aOutStartNode, nsCOMPtr<nsINode>* aOutEndNode,
|
nsCOMPtr<nsINode>* aOutStartNode, nsCOMPtr<nsINode>* aOutEndNode,
|
||||||
int32_t* aOutStartOffset, int32_t* aOutEndOffset, bool aTrustedInput);
|
int32_t* aOutStartOffset, int32_t* aOutEndOffset, bool aTrustedInput);
|
||||||
static nsresult ParseFragment(const nsAString& aStr, nsAtom* aContextLocalName,
|
static nsresult ParseFragment(const nsAString& aStr,
|
||||||
Document* aTargetDoc,
|
nsAtom* aContextLocalName, Document* aTargetDoc,
|
||||||
dom::DocumentFragment** aFragment, bool aTrustedInput);
|
dom::DocumentFragment** aFragment,
|
||||||
|
bool aTrustedInput);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param aInfoStr as indicated by nsITransferable's kHTMLInfo.
|
* @param aInfoStr as indicated by nsITransferable's kHTMLInfo.
|
||||||
|
@ -59,8 +59,10 @@ class SwapChain final {
|
|||||||
private:
|
private:
|
||||||
std::queue<std::shared_ptr<SharedSurface>> mPool;
|
std::queue<std::shared_ptr<SharedSurface>> mPool;
|
||||||
std::shared_ptr<SharedSurface> mFrontBuffer;
|
std::shared_ptr<SharedSurface> mFrontBuffer;
|
||||||
|
|
||||||
public:
|
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:
|
private:
|
||||||
SwapChainPresenter* mPresenter = nullptr;
|
SwapChainPresenter* mPresenter = nullptr;
|
||||||
|
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
#include "CompositorAnimationStorage.h"
|
#include "CompositorAnimationStorage.h"
|
||||||
|
|
||||||
#include "AnimationHelper.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/layers/LayerManagerComposite.h" // for LayerComposite, etc
|
||||||
#include "mozilla/ServoStyleConsts.h"
|
#include "mozilla/ServoStyleConsts.h"
|
||||||
#include "mozilla/webrender/WebRenderTypes.h" // for ToWrTransformProperty, etc
|
#include "mozilla/webrender/WebRenderTypes.h" // for ToWrTransformProperty, etc
|
||||||
#include "nsDeviceContext.h" // for AppUnitsPerCSSPixel
|
#include "nsDeviceContext.h" // for AppUnitsPerCSSPixel
|
||||||
#include "nsDisplayList.h" // for nsDisplayTransform, etc
|
#include "nsDisplayList.h" // for nsDisplayTransform, etc
|
||||||
#include "TreeTraversal.h" // for ForEachNode, BreadthFirstSearch
|
#include "TreeTraversal.h" // for ForEachNode, BreadthFirstSearch
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
#include "gfxFontFeatures.h" // for gfxFontFeature, etc
|
#include "gfxFontFeatures.h" // for gfxFontFeature, etc
|
||||||
#include "gfxFontUtils.h" // for TRUETYPE_TAG
|
#include "gfxFontUtils.h" // for TRUETYPE_TAG
|
||||||
#include "mozilla/ServoStyleConstsInlines.h"
|
#include "mozilla/ServoStyleConstsInlines.h"
|
||||||
#include "nsCRT.h" // for nsCRT
|
#include "nsCRT.h" // for nsCRT
|
||||||
#include "nsDebug.h" // for NS_ASSERTION
|
#include "nsDebug.h" // for NS_ASSERTION
|
||||||
#include "nsISupports.h"
|
#include "nsISupports.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nscore.h" // for char16_t
|
#include "nscore.h" // for char16_t
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "gfxFontFeatures.h"
|
#include "gfxFontFeatures.h"
|
||||||
#include "gfxFontVariations.h"
|
#include "gfxFontVariations.h"
|
||||||
#include "mozilla/FontPropertyTypes.h"
|
#include "mozilla/FontPropertyTypes.h"
|
||||||
#include "mozilla/RefPtr.h" // for RefPtr
|
#include "mozilla/RefPtr.h" // for RefPtr
|
||||||
#include "mozilla/ServoStyleConstsInlines.h"
|
#include "mozilla/ServoStyleConstsInlines.h"
|
||||||
#include "mozilla/StyleColorInlines.h" // for StyleRGBA
|
#include "mozilla/StyleColorInlines.h" // for StyleRGBA
|
||||||
#include "nsCoord.h" // for nscoord
|
#include "nsCoord.h" // for nscoord
|
||||||
|
@ -837,8 +837,7 @@ Family* FontList::FindFamily(const nsCString& aName) {
|
|||||||
families = AliasFamilies();
|
families = AliasFamilies();
|
||||||
size_t match;
|
size_t match;
|
||||||
if (families && BinarySearchIf(families, 0, header.mAliasCount,
|
if (families && BinarySearchIf(families, 0, header.mAliasCount,
|
||||||
FamilyNameComparator(this, aName),
|
FamilyNameComparator(this, aName), &match)) {
|
||||||
&match)) {
|
|
||||||
return &families[match];
|
return &families[match];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -871,9 +870,9 @@ Family* FontList::FindFamily(const nsCString& aName) {
|
|||||||
nsAutoCString strippedName(aName.BeginReading(),
|
nsAutoCString strippedName(aName.BeginReading(),
|
||||||
aName.Length() - styleName.Length());
|
aName.Length() - styleName.Length());
|
||||||
families = Families();
|
families = Families();
|
||||||
if (families && BinarySearchIf(families, 0, header.mFamilyCount,
|
if (families &&
|
||||||
FamilyNameComparator(this, strippedName),
|
BinarySearchIf(families, 0, header.mFamilyCount,
|
||||||
&match)) {
|
FamilyNameComparator(this, strippedName), &match)) {
|
||||||
// If so, this may be a possible family to satisfy the search; check
|
// If so, this may be a possible family to satisfy the search; check
|
||||||
// if the extended family name was actually found as an alternate
|
// if the extended family name was actually found as an alternate
|
||||||
// (either it's already in mAliasTable, or it gets added there when
|
// (either it's already in mAliasTable, or it gets added there when
|
||||||
|
@ -803,7 +803,8 @@ void gfxPlatformFontList::GetFontList(nsAtom* aLangGroup,
|
|||||||
if (!IsVisibleToCSS(f)) {
|
if (!IsVisibleToCSS(f)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// XXX TODO: filter families for aGenericFamily, if supported by platform
|
// XXX TODO: filter families for aGenericFamily, if supported by
|
||||||
|
// platform
|
||||||
aListOfFonts.AppendElement(
|
aListOfFonts.AppendElement(
|
||||||
NS_ConvertUTF8toUTF16(f.DisplayName().AsString(list)));
|
NS_ConvertUTF8toUTF16(f.DisplayName().AsString(list)));
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::CreateWritableStreamDefaultWriter, js::WritableStreamDefaultWriter
|
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::CreateWritableStreamDefaultWriter, js::WritableStreamDefaultWriter
|
||||||
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStreamCloseQueuedOrInFlight
|
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStreamCloseQueuedOrInFlight
|
||||||
#include "builtin/streams/WritableStreamWriterOperations.h" // js::WritableStreamDefaultWriter{GetDesiredSize,Release,Write}
|
#include "builtin/streams/WritableStreamWriterOperations.h" // js::WritableStreamDefaultWriter{GetDesiredSize,Release,Write}
|
||||||
#include "js/CallArgs.h" // JS::CallArgsFromVp, JS::CallArgs
|
#include "js/CallArgs.h" // JS::CallArgsFromVp, JS::CallArgs
|
||||||
#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS
|
#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS
|
||||||
#include "js/Promise.h" // JS::AddPromiseReactions
|
#include "js/Promise.h" // JS::AddPromiseReactions
|
||||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||||
#include "js/Value.h" // JS::{,Int32,Magic,Object}Value, JS::UndefinedHandleValue
|
#include "js/Value.h" // JS::{,Int32,Magic,Object}Value, JS::UndefinedHandleValue
|
||||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#ifndef builtin_streams_PipeToState_h
|
#ifndef builtin_streams_PipeToState_h
|
||||||
#define 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 "mozilla/WrappingOperations.h" // mozilla::WrapToSigned
|
||||||
|
|
||||||
#include <stdint.h> // uint32_t
|
#include <stdint.h> // uint32_t
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter
|
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter
|
||||||
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStream{Abort,CloseQueuedOrInFlight}
|
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStream{Abort,CloseQueuedOrInFlight}
|
||||||
#include "js/Promise.h" // JS::PromiseState
|
#include "js/Promise.h" // JS::PromiseState
|
||||||
#include "js/Value.h" // JS::Value, JS::{Int32,Null}Value
|
#include "js/Value.h" // JS::Value, JS::{Int32,Null}Value
|
||||||
#include "vm/Compartment.h" // JS::Compartment
|
#include "vm/Compartment.h" // JS::Compartment
|
||||||
#include "vm/Interpreter.h" // js::GetAndClearException
|
#include "vm/Interpreter.h" // js::GetAndClearException
|
||||||
#include "vm/JSContext.h" // JSContext
|
#include "vm/JSContext.h" // JSContext
|
||||||
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
|
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
|
||||||
|
|
||||||
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled
|
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled
|
||||||
|
@ -247,7 +247,6 @@ js::Nursery::Nursery(GCRuntime* gc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool js::Nursery::init(AutoLockGCBgAlloc& lock) {
|
bool js::Nursery::init(AutoLockGCBgAlloc& lock) {
|
||||||
|
|
||||||
char* env = getenv("JS_GC_PROFILE_NURSERY");
|
char* env = getenv("JS_GC_PROFILE_NURSERY");
|
||||||
if (env) {
|
if (env) {
|
||||||
if (0 == strcmp(env, "help")) {
|
if (0 == strcmp(env, "help")) {
|
||||||
|
@ -92,8 +92,7 @@ class SweepGroupZonesIter {
|
|||||||
: current(gc->getCurrentSweepGroup()) {
|
: current(gc->getCurrentSweepGroup()) {
|
||||||
MOZ_ASSERT(CurrentThreadIsPerformingGC());
|
MOZ_ASSERT(CurrentThreadIsPerformingGC());
|
||||||
}
|
}
|
||||||
explicit SweepGroupZonesIter(JSRuntime* rt)
|
explicit SweepGroupZonesIter(JSRuntime* rt) : SweepGroupZonesIter(&rt->gc) {}
|
||||||
: SweepGroupZonesIter(&rt->gc) {}
|
|
||||||
|
|
||||||
bool done() const { return !current; }
|
bool done() const { return !current; }
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
#include "jstypes.h"
|
#include "jstypes.h"
|
||||||
|
|
||||||
#include "gc/Allocator.h" // AllowGC
|
#include "gc/Allocator.h" // AllowGC
|
||||||
#include "gc/Cell.h" // gc::TenuredCellWithNonGCPointer
|
#include "gc/Cell.h" // gc::TenuredCellWithNonGCPointer
|
||||||
#include "jit/ExecutableAllocator.h" // ExecutablePool
|
#include "jit/ExecutableAllocator.h" // ExecutablePool
|
||||||
#include "js/TraceKind.h" // JS::TraceKind
|
#include "js/TraceKind.h" // JS::TraceKind
|
||||||
#include "js/UbiNode.h" // ubi::{TracerConcrete, Size, CourseType}
|
#include "js/UbiNode.h" // ubi::{TracerConcrete, Size, CourseType}
|
||||||
|
@ -74,7 +74,6 @@ class BigInt final : public js::gc::CellWithLengthAndFlags {
|
|||||||
|
|
||||||
js::gc::AllocKind getAllocKind() const { return js::gc::AllocKind::BIGINT; }
|
js::gc::AllocKind getAllocKind() const { return js::gc::AllocKind::BIGINT; }
|
||||||
|
|
||||||
|
|
||||||
// Offset for direct access from JIT code.
|
// Offset for direct access from JIT code.
|
||||||
static constexpr size_t offsetOfDigitLength() {
|
static constexpr size_t offsetOfDigitLength() {
|
||||||
return offsetOfHeaderLength();
|
return offsetOfHeaderLength();
|
||||||
|
@ -170,7 +170,6 @@ class ObjectGroup : public gc::TenuredCellWithNonGCPointer<const JSClass> {
|
|||||||
friend class js::jit::MacroAssembler;
|
friend class js::jit::MacroAssembler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool hasDynamicPrototype() const { return proto_.isDynamic(); }
|
bool hasDynamicPrototype() const { return proto_.isDynamic(); }
|
||||||
|
|
||||||
const GCPtr<TaggedProto>& proto() const { return proto_; }
|
const GCPtr<TaggedProto>& proto() const { return proto_; }
|
||||||
|
@ -711,9 +711,9 @@ class BaseShape : public gc::TenuredCellWithNonGCPointer<const JSClass> {
|
|||||||
/* Class of referring object, stored in the cell header */
|
/* Class of referring object, stored in the cell header */
|
||||||
const JSClass* clasp() const { return headerPtr(); }
|
const JSClass* clasp() const { return headerPtr(); }
|
||||||
|
|
||||||
uint32_t flags; /* Vector of above flags. */
|
uint32_t flags; /* Vector of above flags. */
|
||||||
uint32_t slotSpan_; /* Object slot span for BaseShapes at
|
uint32_t slotSpan_; /* Object slot span for BaseShapes at
|
||||||
* dictionary last properties. */
|
* dictionary last properties. */
|
||||||
|
|
||||||
/* For owned BaseShapes, the canonical unowned BaseShape. */
|
/* For owned BaseShapes, the canonical unowned BaseShape. */
|
||||||
GCPtrUnownedBaseShape unowned_;
|
GCPtrUnownedBaseShape unowned_;
|
||||||
@ -732,7 +732,6 @@ class BaseShape : public gc::TenuredCellWithNonGCPointer<const JSClass> {
|
|||||||
/* Not defined: BaseShapes must not be stack allocated. */
|
/* Not defined: BaseShapes must not be stack allocated. */
|
||||||
~BaseShape();
|
~BaseShape();
|
||||||
|
|
||||||
|
|
||||||
bool isOwned() const { return !!(flags & OWNED_SHAPE); }
|
bool isOwned() const { return !!(flags & OWNED_SHAPE); }
|
||||||
|
|
||||||
static void copyFromUnowned(BaseShape& dest, UnownedBaseShape& src);
|
static void copyFromUnowned(BaseShape& dest, UnownedBaseShape& src);
|
||||||
|
@ -3072,8 +3072,7 @@ class ChildCounter {
|
|||||||
size_t objCountsIndex;
|
size_t objCountsIndex;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ChildCounter(JSContext* cx)
|
explicit ChildCounter(JSContext* cx) : cx(cx), counts(cx), objsLength(0) {}
|
||||||
: cx(cx), counts(cx), objsLength(0) {}
|
|
||||||
|
|
||||||
void noteObjIsOnTopOfStack() { objCountsIndex = counts.length() - 1; }
|
void noteObjIsOnTopOfStack() { objCountsIndex = counts.length() - 1; }
|
||||||
|
|
||||||
|
@ -835,8 +835,8 @@ void nsTextControlFrame::ScrollSelectionIntoViewAsync(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int16_t flags = aScrollAncestors == ScrollAncestors::Yes
|
int16_t flags = aScrollAncestors == ScrollAncestors::Yes
|
||||||
? 0
|
? 0
|
||||||
: nsISelectionController::SCROLL_FIRST_ANCESTOR_ONLY;
|
: nsISelectionController::SCROLL_FIRST_ANCESTOR_ONLY;
|
||||||
|
|
||||||
// Scroll the selection into view (see bug 231389).
|
// Scroll the selection into view (see bug 231389).
|
||||||
selCon->ScrollSelectionIntoView(
|
selCon->ScrollSelectionIntoView(
|
||||||
|
@ -415,7 +415,8 @@ void StyleSheetInfo::AddSheet(StyleSheet* aSheet) {
|
|||||||
|
|
||||||
void StyleSheetInfo::RemoveSheet(StyleSheet* aSheet) {
|
void StyleSheetInfo::RemoveSheet(StyleSheet* aSheet) {
|
||||||
// Fix up the parent pointer in children lists.
|
// 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) {
|
for (StyleSheet* child : mChildren) {
|
||||||
MOZ_ASSERT(child->mParentSheet);
|
MOZ_ASSERT(child->mParentSheet);
|
||||||
MOZ_ASSERT(child->mParentSheet->mInner == this);
|
MOZ_ASSERT(child->mParentSheet->mInner == this);
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
# include "malloc_decls.h"
|
# include "malloc_decls.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
# include "mozilla/fallible.h"
|
# include "mozilla/fallible.h"
|
||||||
# include "mozilla/mozalloc_abort.h"
|
# include "mozilla/mozalloc_abort.h"
|
||||||
|
@ -85,8 +85,8 @@
|
|||||||
* Our supported compilers provide architecture-independent macros for this.
|
* Our supported compilers provide architecture-independent macros for this.
|
||||||
* Yes, there are more than two values for __BYTE_ORDER__.
|
* Yes, there are more than two values for __BYTE_ORDER__.
|
||||||
*/
|
*/
|
||||||
#if defined(__BYTE_ORDER__) && \
|
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
|
||||||
defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__)
|
defined(__ORDER_BIG_ENDIAN__)
|
||||||
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
# define MOZ_LITTLE_ENDIAN() 1
|
# define MOZ_LITTLE_ENDIAN() 1
|
||||||
# define MOZ_BIG_ENDIAN() 0
|
# define MOZ_BIG_ENDIAN() 0
|
||||||
|
@ -177,7 +177,7 @@ auto getter_Transfers(UniquePtr<T, D>& up) {
|
|||||||
explicit UniquePtrGetterTransfers(Ptr& p) : mPtr(p) {}
|
explicit UniquePtrGetterTransfers(Ptr& p) : mPtr(p) {}
|
||||||
~UniquePtrGetterTransfers() { mPtr.reset(mRawPtr); }
|
~UniquePtrGetterTransfers() { mPtr.reset(mRawPtr); }
|
||||||
|
|
||||||
operator typename Ptr::ElementType**() { return &mRawPtr; }
|
operator typename Ptr::ElementType **() { return &mRawPtr; }
|
||||||
operator void**() { return reinterpret_cast<void**>(&mRawPtr); }
|
operator void**() { return reinterpret_cast<void**>(&mRawPtr); }
|
||||||
typename Ptr::ElementType*& operator*() { return mRawPtr; }
|
typename Ptr::ElementType*& operator*() { return mRawPtr; }
|
||||||
|
|
||||||
|
@ -43,9 +43,9 @@
|
|||||||
#ifdef MOZ_GECKO_PROFILER
|
#ifdef MOZ_GECKO_PROFILER
|
||||||
|
|
||||||
MOZ_MAYBE_UNUSED static void SleepMilli(unsigned aMilliseconds) {
|
MOZ_MAYBE_UNUSED static void SleepMilli(unsigned aMilliseconds) {
|
||||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
# if defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
Sleep(aMilliseconds);
|
Sleep(aMilliseconds);
|
||||||
#else
|
# else
|
||||||
struct timespec ts = {/* .tv_sec */ static_cast<time_t>(aMilliseconds / 1000),
|
struct timespec ts = {/* .tv_sec */ static_cast<time_t>(aMilliseconds / 1000),
|
||||||
/* ts.tv_nsec */ long(aMilliseconds % 1000) * 1000000};
|
/* ts.tv_nsec */ long(aMilliseconds % 1000) * 1000000};
|
||||||
struct timespec tr = {0, 0};
|
struct timespec tr = {0, 0};
|
||||||
@ -57,7 +57,7 @@ MOZ_MAYBE_UNUSED static void SleepMilli(unsigned aMilliseconds) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
@ -154,7 +154,7 @@ nsresult Http3Stream::OnReadSegment(const char* buf, uint32_t count,
|
|||||||
}
|
}
|
||||||
mSendState = WAITING_TO_ACTIVATE;
|
mSendState = WAITING_TO_ACTIVATE;
|
||||||
}
|
}
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case WAITING_TO_ACTIVATE:
|
case WAITING_TO_ACTIVATE:
|
||||||
rv = TryActivating();
|
rv = TryActivating();
|
||||||
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
|
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
|
||||||
@ -309,7 +309,8 @@ nsresult Http3Stream::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count,
|
|||||||
// is already done.
|
// is already done.
|
||||||
LOG3(
|
LOG3(
|
||||||
("Http3Stream %p ReadSegments request stream aborted due to"
|
("Http3Stream %p ReadSegments request stream aborted due to"
|
||||||
" response side closure\n", this));
|
" response side closure\n",
|
||||||
|
this));
|
||||||
return NS_ERROR_ABORT;
|
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
|
// A transaction that had already generated its headers before it was
|
||||||
// queued at the session level (due to concurrency concerns) may not call
|
// queued at the session level (due to concurrency concerns) may not call
|
||||||
// onReadSegment off the ReadSegments() stack above.
|
// onReadSegment off the ReadSegments() stack above.
|
||||||
LOG3(
|
LOG3(("Http3Stream %p ReadSegments forcing OnReadSegment call\n", this));
|
||||||
("Http3Stream %p ReadSegments forcing OnReadSegment call\n", this));
|
|
||||||
uint32_t wasted = 0;
|
uint32_t wasted = 0;
|
||||||
nsresult rv2 = OnReadSegment("", 0, &wasted);
|
nsresult rv2 = OnReadSegment("", 0, &wasted);
|
||||||
LOG3((" OnReadSegment returned 0x%08" PRIx32,
|
LOG3((" OnReadSegment returned 0x%08" PRIx32,
|
||||||
@ -330,8 +330,8 @@ nsresult Http3Stream::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we are in state SENDING_BODY we can continue sending data.
|
// If we are in state SENDING_BODY we can continue sending data.
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case PREPARING_HEADERS:
|
case PREPARING_HEADERS:
|
||||||
case SENDING_BODY: {
|
case SENDING_BODY: {
|
||||||
rv = mTransaction->ReadSegments(this, count, countRead);
|
rv = mTransaction->ReadSegments(this, count, countRead);
|
||||||
|
@ -23,7 +23,7 @@ enum {
|
|||||||
kCharsetFromIrreversibleAutoDetection,
|
kCharsetFromIrreversibleAutoDetection,
|
||||||
kCharsetFromChannel,
|
kCharsetFromChannel,
|
||||||
kCharsetFromOtherComponent,
|
kCharsetFromOtherComponent,
|
||||||
kCharsetFromUserForced, // propagates to child frames
|
kCharsetFromUserForced, // propagates to child frames
|
||||||
kCharsetFromUserForcedAutoDetection,
|
kCharsetFromUserForcedAutoDetection,
|
||||||
kCharsetFromByteOrderMark,
|
kCharsetFromByteOrderMark,
|
||||||
kCharsetFromUtf8OnlyMime, // For JSON, WebVTT and such
|
kCharsetFromUtf8OnlyMime, // For JSON, WebVTT and such
|
||||||
|
@ -80,8 +80,8 @@ bool RemoteSandboxBroker::LaunchApp(
|
|||||||
// We need to wait on the current thread for the process to launch which will
|
// We need to wait on the current thread for the process to launch which will
|
||||||
// block the running IPC Launch taskqueue. We cannot use
|
// block the running IPC Launch taskqueue. We cannot use
|
||||||
// GetCurrentSerialEventTarget() (as this returns the currently running
|
// GetCurrentSerialEventTarget() (as this returns the currently running
|
||||||
// TaskQueue) to resolve our promise as it will be blocked until we return from
|
// TaskQueue) to resolve our promise as it will be blocked until we return
|
||||||
// this function.
|
// from this function.
|
||||||
nsCOMPtr<nsISerialEventTarget> target = NS_GetCurrentThread();
|
nsCOMPtr<nsISerialEventTarget> target = NS_GetCurrentThread();
|
||||||
mParent.Launch(mParameters.shareHandles(), target)
|
mParent.Launch(mParameters.shareHandles(), target)
|
||||||
->Then(target, __func__, std::move(resolve), std::move(reject));
|
->Then(target, __func__, std::move(resolve), std::move(reject));
|
||||||
|
@ -43,8 +43,7 @@ nsUrlClassifierPrefixSet::Init(const nsACString& aName) {
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsUrlClassifierPrefixSet::~nsUrlClassifierPrefixSet() {
|
nsUrlClassifierPrefixSet::~nsUrlClassifierPrefixSet() {}
|
||||||
}
|
|
||||||
|
|
||||||
void nsUrlClassifierPrefixSet::Clear() {
|
void nsUrlClassifierPrefixSet::Clear() {
|
||||||
LOG(("[%s] Clearing PrefixSet", mName.get()));
|
LOG(("[%s] Clearing PrefixSet", mName.get()));
|
||||||
|
@ -680,7 +680,6 @@ const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id) {
|
|||||||
// Renoir
|
// Renoir
|
||||||
APPEND_DEVICE(0x1636);
|
APPEND_DEVICE(0x1636);
|
||||||
|
|
||||||
|
|
||||||
#ifdef EARLY_BETA_OR_EARLIER
|
#ifdef EARLY_BETA_OR_EARLIER
|
||||||
// Stoney
|
// Stoney
|
||||||
APPEND_DEVICE(0x98e4);
|
APPEND_DEVICE(0x98e4);
|
||||||
|
@ -1625,7 +1625,8 @@ void GfxInfoBase::DescribeFeatures(JSContext* aCx, JS::Handle<JSObject*> aObj) {
|
|||||||
gfxConfig::GetFeature(gfx::Feature::WEBRENDER_COMPOSITOR);
|
gfxConfig::GetFeature(gfx::Feature::WEBRENDER_COMPOSITOR);
|
||||||
InitFeatureObject(aCx, aObj, "wrCompositor", wrCompositor, &obj);
|
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);
|
InitFeatureObject(aCx, aObj, "openglCompositing", openglCompositing, &obj);
|
||||||
|
|
||||||
// Only include AL if the platform attempted to use it.
|
// Only include AL if the platform attempted to use it.
|
||||||
|
@ -382,9 +382,9 @@ const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
|
|||||||
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
|
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
|
||||||
OperatingSystem::OSX, DeviceFamily::IntelRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
|
OperatingSystem::OSX, DeviceFamily::IntelRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
|
||||||
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_INTEL_MAC");
|
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_INTEL_MAC");
|
||||||
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
|
IMPLEMENT_MAC_DRIVER_BLOCKLIST(OperatingSystem::OSX, DeviceFamily::AtiRolloutWebRender,
|
||||||
OperatingSystem::OSX, DeviceFamily::AtiRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
|
nsIGfxInfo::FEATURE_WEBRENDER,
|
||||||
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_AMD_MAC");
|
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_AMD_MAC");
|
||||||
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
|
IMPLEMENT_MAC_DRIVER_BLOCKLIST(
|
||||||
OperatingSystem::OSX, DeviceFamily::NvidiaRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
|
OperatingSystem::OSX, DeviceFamily::NvidiaRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
|
||||||
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_NVIDIA_MAC");
|
nsIGfxInfo::FEATURE_ALLOW_QUALIFIED, "FEATURE_ROLLOUT_NVIDIA_MAC");
|
||||||
|
@ -98,7 +98,7 @@ class nsAutoOwningEventTarget {
|
|||||||
_mOwningThread.AssertOwnership(#_class " not thread-safe")
|
_mOwningThread.AssertOwnership(#_class " not thread-safe")
|
||||||
#else // !MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
|
#else // !MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
|
||||||
|
|
||||||
# define NS_DECL_OWNINGTHREAD /* nothing */
|
# define NS_DECL_OWNINGTHREAD /* nothing */
|
||||||
# define NS_DECL_OWNINGEVENTTARGET /* nothing */
|
# define NS_DECL_OWNINGEVENTTARGET /* nothing */
|
||||||
# define NS_ASSERT_OWNINGTHREAD(_class) ((void)0)
|
# define NS_ASSERT_OWNINGTHREAD(_class) ((void)0)
|
||||||
|
|
||||||
@ -619,8 +619,7 @@ class ThreadSafeAutoRefCnt {
|
|||||||
\
|
\
|
||||||
protected: \
|
protected: \
|
||||||
nsAutoRefCnt mRefCnt; \
|
nsAutoRefCnt mRefCnt; \
|
||||||
_owning \
|
_owning public:
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this macro to declare and implement the AddRef & Release methods for a
|
* Use this macro to declare and implement the AddRef & Release methods for a
|
||||||
|
@ -1459,7 +1459,7 @@ nsTSubstringSplitter<T> nsTSubstring<T>::Split(const char_type aChar) const {
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
const nsTDependentSubstring<T>&
|
const nsTDependentSubstring<T>&
|
||||||
nsTSubstringSplitter<T>::nsTSubstringSplit_Iter::operator*() const {
|
nsTSubstringSplitter<T>::nsTSubstringSplit_Iter::operator*() const {
|
||||||
return mObj.Get(mPos);
|
return mObj.Get(mPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,29 +511,27 @@ TEST(MozPromise, DirectTaskDispatch)
|
|||||||
// For direct task dispatch to be working, we must be within a
|
// For direct task dispatch to be working, we must be within a
|
||||||
// nested event loop. So the test itself must be dispatched within
|
// nested event loop. So the test itself must be dispatched within
|
||||||
// a task.
|
// a task.
|
||||||
GetCurrentSerialEventTarget()->Dispatch(
|
GetCurrentSerialEventTarget()->Dispatch(NS_NewRunnableFunction("test", [&]() {
|
||||||
NS_NewRunnableFunction("test", [&]() {
|
GetCurrentSerialEventTarget()->Dispatch(
|
||||||
GetCurrentSerialEventTarget()->Dispatch(
|
NS_NewRunnableFunction("test", [&]() {
|
||||||
NS_NewRunnableFunction("test", [&]() {
|
EXPECT_EQ(value1, true);
|
||||||
EXPECT_EQ(value1, true);
|
value2 = true;
|
||||||
value2 = true;
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
RefPtr<TestPromise::Private> promise =
|
RefPtr<TestPromise::Private> promise = new TestPromise::Private(__func__);
|
||||||
new TestPromise::Private(__func__);
|
promise->UseDirectTaskDispatch(__func__);
|
||||||
promise->UseDirectTaskDispatch(__func__);
|
promise->Resolve(42, __func__);
|
||||||
promise->Resolve(42, __func__);
|
EXPECT_EQ(value1, false);
|
||||||
EXPECT_EQ(value1, false);
|
promise->Then(
|
||||||
promise->Then(
|
GetCurrentSerialEventTarget(), __func__,
|
||||||
GetCurrentSerialEventTarget(), __func__,
|
[&](int aResolveValue) -> void {
|
||||||
[&](int aResolveValue) -> void {
|
EXPECT_EQ(aResolveValue, 42);
|
||||||
EXPECT_EQ(aResolveValue, 42);
|
EXPECT_EQ(value2, false);
|
||||||
EXPECT_EQ(value2, false);
|
value1 = true;
|
||||||
value1 = true;
|
},
|
||||||
},
|
DO_FAIL);
|
||||||
DO_FAIL);
|
EXPECT_EQ(value1, false);
|
||||||
EXPECT_EQ(value1, false);
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
// Spin the event loop.
|
// Spin the event loop.
|
||||||
NS_ProcessPendingEvents(nullptr);
|
NS_ProcessPendingEvents(nullptr);
|
||||||
@ -547,42 +545,40 @@ TEST(MozPromise, ChainedDirectTaskDispatch)
|
|||||||
// For direct task dispatch to be working, we must be within a
|
// For direct task dispatch to be working, we must be within a
|
||||||
// nested event loop. So the test itself must be dispatched within
|
// nested event loop. So the test itself must be dispatched within
|
||||||
// a task.
|
// a task.
|
||||||
GetCurrentSerialEventTarget()->Dispatch(
|
GetCurrentSerialEventTarget()->Dispatch(NS_NewRunnableFunction("test", [&]() {
|
||||||
NS_NewRunnableFunction("test", [&]() {
|
GetCurrentSerialEventTarget()->Dispatch(
|
||||||
GetCurrentSerialEventTarget()->Dispatch(
|
NS_NewRunnableFunction("test", [&]() {
|
||||||
NS_NewRunnableFunction("test", [&]() {
|
EXPECT_EQ(value1, true);
|
||||||
EXPECT_EQ(value1, true);
|
value2 = true;
|
||||||
value2 = true;
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
RefPtr<TestPromise::Private> promise1 =
|
RefPtr<TestPromise::Private> promise1 = new TestPromise::Private(__func__);
|
||||||
new TestPromise::Private(__func__);
|
promise1->UseDirectTaskDispatch(__func__);
|
||||||
promise1->UseDirectTaskDispatch(__func__);
|
promise1->Resolve(42, __func__);
|
||||||
promise1->Resolve(42, __func__);
|
EXPECT_EQ(value1, false);
|
||||||
EXPECT_EQ(value1, false);
|
promise1
|
||||||
promise1
|
->Then(
|
||||||
->Then(
|
GetCurrentSerialEventTarget(), __func__,
|
||||||
GetCurrentSerialEventTarget(), __func__,
|
[&](int aResolveValue) -> RefPtr<TestPromise> {
|
||||||
[&](int aResolveValue) -> RefPtr<TestPromise> {
|
EXPECT_EQ(aResolveValue, 42);
|
||||||
EXPECT_EQ(aResolveValue, 42);
|
EXPECT_EQ(value2, false);
|
||||||
EXPECT_EQ(value2, false);
|
RefPtr<TestPromise::Private> promise2 =
|
||||||
RefPtr<TestPromise::Private> promise2 =
|
new TestPromise::Private(__func__);
|
||||||
new TestPromise::Private(__func__);
|
promise2->UseDirectTaskDispatch(__func__);
|
||||||
promise2->UseDirectTaskDispatch(__func__);
|
promise2->Resolve(43, __func__);
|
||||||
promise2->Resolve(43, __func__);
|
return promise2;
|
||||||
return promise2;
|
},
|
||||||
},
|
DO_FAIL)
|
||||||
DO_FAIL)
|
->Then(
|
||||||
->Then(
|
GetCurrentSerialEventTarget(), __func__,
|
||||||
GetCurrentSerialEventTarget(), __func__,
|
[&](int aResolveValue) -> void {
|
||||||
[&](int aResolveValue) -> void {
|
EXPECT_EQ(aResolveValue, 43);
|
||||||
EXPECT_EQ(aResolveValue, 43);
|
EXPECT_EQ(value2, false);
|
||||||
EXPECT_EQ(value2, false);
|
value1 = true;
|
||||||
value1 = true;
|
},
|
||||||
},
|
DO_FAIL);
|
||||||
DO_FAIL);
|
EXPECT_EQ(value1, false);
|
||||||
EXPECT_EQ(value1, false);
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
// Spin the event loop.
|
// Spin the event loop.
|
||||||
NS_ProcessPendingEvents(nullptr);
|
NS_ProcessPendingEvents(nullptr);
|
||||||
@ -596,33 +592,30 @@ TEST(MozPromise, ChainToDirectTaskDispatch)
|
|||||||
// For direct task dispatch to be working, we must be within a
|
// For direct task dispatch to be working, we must be within a
|
||||||
// nested event loop. So the test itself must be dispatched within
|
// nested event loop. So the test itself must be dispatched within
|
||||||
// a task.
|
// a task.
|
||||||
GetCurrentSerialEventTarget()->Dispatch(
|
GetCurrentSerialEventTarget()->Dispatch(NS_NewRunnableFunction("test", [&]() {
|
||||||
NS_NewRunnableFunction("test", [&]() {
|
GetCurrentSerialEventTarget()->Dispatch(
|
||||||
GetCurrentSerialEventTarget()->Dispatch(
|
NS_NewRunnableFunction("test", [&]() {
|
||||||
NS_NewRunnableFunction("test", [&]() {
|
EXPECT_EQ(value1, true);
|
||||||
EXPECT_EQ(value1, true);
|
value2 = true;
|
||||||
value2 = true;
|
}));
|
||||||
}));
|
|
||||||
|
|
||||||
RefPtr<TestPromise::Private> promise1 =
|
RefPtr<TestPromise::Private> promise1 = new TestPromise::Private(__func__);
|
||||||
new TestPromise::Private(__func__);
|
promise1->UseDirectTaskDispatch(__func__);
|
||||||
promise1->UseDirectTaskDispatch(__func__);
|
|
||||||
|
|
||||||
RefPtr<TestPromise::Private> promise2 =
|
RefPtr<TestPromise::Private> promise2 = new TestPromise::Private(__func__);
|
||||||
new TestPromise::Private(__func__);
|
promise2->Then(
|
||||||
promise2->Then(
|
GetCurrentSerialEventTarget(), __func__,
|
||||||
GetCurrentSerialEventTarget(), __func__,
|
[&](int aResolveValue) -> void {
|
||||||
[&](int aResolveValue) -> void {
|
EXPECT_EQ(aResolveValue, 42);
|
||||||
EXPECT_EQ(aResolveValue, 42);
|
EXPECT_EQ(value2, false);
|
||||||
EXPECT_EQ(value2, false);
|
value1 = true;
|
||||||
value1 = true;
|
},
|
||||||
},
|
DO_FAIL);
|
||||||
DO_FAIL);
|
|
||||||
|
|
||||||
promise1->ChainTo(promise2.forget(), __func__);
|
promise1->ChainTo(promise2.forget(), __func__);
|
||||||
EXPECT_EQ(value1, false);
|
EXPECT_EQ(value1, false);
|
||||||
promise1->Resolve(42, __func__);
|
promise1->Resolve(42, __func__);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Spin the event loop.
|
// Spin the event loop.
|
||||||
NS_ProcessPendingEvents(nullptr);
|
NS_ProcessPendingEvents(nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user