diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2019-12-18 23:07:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-18 23:07:31 -0500 |
commit | 3332f584c829aaac455d688c6c073937442c4c7f (patch) | |
tree | 741e4325721d1d8d9970e075320262097d3cbeb1 /xpcom | |
parent | 8220776c9b2e8291f0414f98ac20fbda30e00d2e (diff) | |
parent | c7ae364a887e9fb77196596d6e4345b455ab209f (diff) | |
download | UXP-3332f584c829aaac455d688c6c073937442c4c7f.tar UXP-3332f584c829aaac455d688c6c073937442c4c7f.tar.gz UXP-3332f584c829aaac455d688c6c073937442c4c7f.tar.lz UXP-3332f584c829aaac455d688c6c073937442c4c7f.tar.xz UXP-3332f584c829aaac455d688c6c073937442c4c7f.zip |
Merge pull request #1330 from MoonchildProductions/DOM-promise-removal
DOM `Promise` removal
Diffstat (limited to 'xpcom')
-rw-r--r-- | xpcom/base/CycleCollectedJSContext.cpp | 6 | ||||
-rw-r--r-- | xpcom/base/CycleCollectedJSContext.h | 12 |
2 files changed, 2 insertions, 16 deletions
diff --git a/xpcom/base/CycleCollectedJSContext.cpp b/xpcom/base/CycleCollectedJSContext.cpp index 206984656..e16c15455 100644 --- a/xpcom/base/CycleCollectedJSContext.cpp +++ b/xpcom/base/CycleCollectedJSContext.cpp @@ -468,10 +468,8 @@ CycleCollectedJSContext::~CycleCollectedJSContext() MOZ_ASSERT(mDebuggerPromiseMicroTaskQueue.empty()); MOZ_ASSERT(mPromiseMicroTaskQueue.empty()); -#ifdef SPIDERMONKEY_PROMISE mUncaughtRejections.reset(); mConsumedRejections.reset(); -#endif // SPIDERMONKEY_PROMISE JS_DestroyContext(mJSContext); mJSContext = nullptr; @@ -544,12 +542,10 @@ CycleCollectedJSContext::Initialize(JSContext* aParentContext, JS::SetGetIncumbentGlobalCallback(mJSContext, GetIncumbentGlobalCallback); -#ifdef SPIDERMONKEY_PROMISE JS::SetEnqueuePromiseJobCallback(mJSContext, EnqueuePromiseJobCallback, this); JS::SetPromiseRejectionTrackerCallback(mJSContext, PromiseRejectionTrackerCallback, this); mUncaughtRejections.init(mJSContext, JS::GCVector<JSObject*, 0, js::SystemAllocPolicy>(js::SystemAllocPolicy())); mConsumedRejections.init(mJSContext, JS::GCVector<JSObject*, 0, js::SystemAllocPolicy>(js::SystemAllocPolicy())); -#endif // SPIDERMONKEY_PROMISE JS::dbg::SetDebuggerMallocSizeOf(mJSContext, moz_malloc_size_of); @@ -975,7 +971,6 @@ CycleCollectedJSContext::EnqueuePromiseJobCallback(JSContext* aCx, return true; } -#ifdef SPIDERMONKEY_PROMISE /* static */ void CycleCollectedJSContext::PromiseRejectionTrackerCallback(JSContext* aCx, @@ -995,7 +990,6 @@ CycleCollectedJSContext::PromiseRejectionTrackerCallback(JSContext* aCx, PromiseDebugging::AddConsumedRejection(aPromise); } } -#endif // SPIDERMONKEY_PROMISE struct JsGcTracer : public TraceCallbacks { diff --git a/xpcom/base/CycleCollectedJSContext.h b/xpcom/base/CycleCollectedJSContext.h index 9415634b8..ac4cf4361 100644 --- a/xpcom/base/CycleCollectedJSContext.h +++ b/xpcom/base/CycleCollectedJSContext.h @@ -224,12 +224,10 @@ private: JS::HandleObject aAllocationSite, JS::HandleObject aIncumbentGlobal, void* aData); -#ifdef SPIDERMONKEY_PROMISE static void PromiseRejectionTrackerCallback(JSContext* aCx, JS::HandleObject aPromise, PromiseRejectionHandlingState state, void* aData); -#endif // SPIDERMONKEY_PROMISE virtual void TraceNativeBlackRoots(JSTracer* aTracer) { }; void TraceNativeGrayRoots(JSTracer* aTracer); @@ -406,7 +404,7 @@ public: // Storage for watching rejected promises waiting for some client to // consume their rejection. -#ifdef SPIDERMONKEY_PROMISE + // Promises in this list have been rejected in the last turn of the // event loop without the rejection being handled. // Note that this can contain nullptrs in place of promises removed because @@ -417,13 +415,7 @@ public: // (because they were in the above list), but the rejection was handled // in the last turn of the event loop. JS::PersistentRooted<JS::GCVector<JSObject*, 0, js::SystemAllocPolicy>> mConsumedRejections; -#else - // We store values as `nsISupports` to avoid adding compile-time dependencies - // from xpcom to dom/promise, but they can really only have a single concrete - // type. - nsTArray<nsCOMPtr<nsISupports /* Promise */>> mUncaughtRejections; - nsTArray<nsCOMPtr<nsISupports /* Promise */ >> mConsumedRejections; -#endif // SPIDERMONKEY_PROMISE + nsTArray<nsCOMPtr<nsISupports /* UncaughtRejectionObserver */ >> mUncaughtRejectionObservers; private: |