summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-02-04 01:44:41 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-19 17:38:02 +0000
commit185a027640f9b18c97eda39a49bfa2dcce58fcdb (patch)
treed29b146d37f0f831ec981316da778c91fd77be8a /dom
parent99ec088ecf1259643f6124206af024de3ebc49ad (diff)
downloaduxp-185a027640f9b18c97eda39a49bfa2dcce58fcdb.tar.gz
Issue #1877 - Resolve RELEASE_OR_BETA conditionals.
Diffstat (limited to 'dom')
-rw-r--r--dom/base/nsDOMClassInfo.cpp2
-rw-r--r--dom/base/nsGlobalWindow.cpp26
-rw-r--r--dom/cache/CacheWorkerHolder.cpp4
-rw-r--r--dom/cache/DBSchema.cpp4
-rw-r--r--dom/cache/Manager.cpp8
-rw-r--r--dom/cache/ReadStream.cpp6
-rw-r--r--dom/cache/StreamControl.cpp6
-rw-r--r--dom/plugins/base/nsPluginTags.cpp8
-rw-r--r--dom/worklet/Worklet.cpp3
9 files changed, 18 insertions, 49 deletions
diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp
index 7cc92a1b74..805c6ccd9b 100644
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1688,9 +1688,7 @@ nsWindowSH::NameStructEnabled(JSContext* aCx, nsGlobalWindow *aWin,
OldBindingConstructorEnabled(nameStruct, aWin, aCx);
}
-#ifdef RELEASE_OR_BETA
#define USE_CONTROLLERS_SHIM
-#endif
#ifdef USE_CONTROLLERS_SHIM
static const JSClass ControllersShimClass = {
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index 2b8ace3e0c..ccfbf488d3 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1116,9 +1116,6 @@ nsOuterWindowProxy::getOwnPropertyDescriptor(JSContext* cx,
}
// else fall through to js::Wrapper
- // When we change this to always claim the property is configurable (bug
- // 1178639), update the comments in nsOuterWindowProxy::defineProperty
- // accordingly.
return js::Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc);
}
@@ -1136,29 +1133,6 @@ nsOuterWindowProxy::defineProperty(JSContext* cx,
return result.failCantDefineWindowElement();
}
-#ifndef RELEASE_OR_BETA // To be turned on in bug 1178638.
- // For now, allow chrome code to define non-configurable properties
- // on windows, until we sort out what exactly the addon SDK is
- // doing. In the meantime, this still allows us to test web compat
- // behavior.
- if (desc.hasConfigurable() && !desc.configurable() &&
- !nsContentUtils::IsCallerChrome()) {
- return ThrowErrorMessage(cx, MSG_DEFINE_NON_CONFIGURABLE_PROP_ON_WINDOW);
- }
-
- // Note that if hasConfigurable() is false we do NOT want to
- // setConfigurable(true). That would make this code:
- //
- // var x;
- // window.x = 5;
- //
- // fail, because the JS engine ends up converting the assignment into a define
- // with !hasConfigurable(), but the var actually declared a non-configurable
- // property on our underlying Window object, so the set would fail if we
- // forced setConfigurable(true) here. What we want to do instead is change
- // getOwnPropertyDescriptor to always claim configurable. See bug 1178639.
-#endif
-
return js::Wrapper::defineProperty(cx, proxy, id, desc, result);
}
diff --git a/dom/cache/CacheWorkerHolder.cpp b/dom/cache/CacheWorkerHolder.cpp
index afe6c8f1f7..4ac97cbcab 100644
--- a/dom/cache/CacheWorkerHolder.cpp
+++ b/dom/cache/CacheWorkerHolder.cpp
@@ -54,11 +54,7 @@ CacheWorkerHolder::RemoveActor(ActorChild* aActor)
NS_ASSERT_OWNINGTHREAD(CacheWorkerHolder);
MOZ_DIAGNOSTIC_ASSERT(aActor);
-#if defined(RELEASE_OR_BETA)
mActorList.RemoveElement(aActor);
-#else
- MOZ_DIAGNOSTIC_ASSERT(mActorList.RemoveElement(aActor));
-#endif
MOZ_ASSERT(!mActorList.Contains(aActor));
}
diff --git a/dom/cache/DBSchema.cpp b/dom/cache/DBSchema.cpp
index a1ba97ec73..2025150380 100644
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -2550,12 +2550,14 @@ Migrate(mozIStorageConnection* aConn)
}
}
-#if defined(DEBUG) || !defined(RELEASE_OR_BETA)
+#if defined(DEBUG)
int32_t lastVersion = currentVersion;
#endif
rv = aConn->GetSchemaVersion(&currentVersion);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
+#if defined(DEBUG)
MOZ_DIAGNOSTIC_ASSERT(currentVersion > lastVersion);
+#endif
}
MOZ_DIAGNOSTIC_ASSERT(currentVersion == kLatestSchemaVersion);
diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp
index 915d8607e0..f294beb544 100644
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -1525,11 +1525,13 @@ Manager::ReleaseCacheId(CacheId aCacheId)
NS_ASSERT_OWNINGTHREAD(Manager);
for (uint32_t i = 0; i < mCacheIdRefs.Length(); ++i) {
if (mCacheIdRefs[i].mCacheId == aCacheId) {
-#if defined(DEBUG) || !defined(RELEASE_OR_BETA)
+#if defined(DEBUG)
uint32_t oldRef = mCacheIdRefs[i].mCount;
#endif
mCacheIdRefs[i].mCount -= 1;
+#if defined(DEBUG)
MOZ_DIAGNOSTIC_ASSERT(mCacheIdRefs[i].mCount < oldRef);
+#endif
if (mCacheIdRefs[i].mCount == 0) {
bool orphaned = mCacheIdRefs[i].mOrphaned;
mCacheIdRefs.RemoveElementAt(i);
@@ -1576,11 +1578,13 @@ Manager::ReleaseBodyId(const nsID& aBodyId)
NS_ASSERT_OWNINGTHREAD(Manager);
for (uint32_t i = 0; i < mBodyIdRefs.Length(); ++i) {
if (mBodyIdRefs[i].mBodyId == aBodyId) {
-#if defined(DEBUG) || !defined(RELEASE_OR_BETA)
+#if defined(DEBUG)
uint32_t oldRef = mBodyIdRefs[i].mCount;
#endif
mBodyIdRefs[i].mCount -= 1;
+#if defined(DEBUG)
MOZ_DIAGNOSTIC_ASSERT(mBodyIdRefs[i].mCount < oldRef);
+#endif
if (mBodyIdRefs[i].mCount < 1) {
bool orphaned = mBodyIdRefs[i].mOrphaned;
mBodyIdRefs.RemoveElementAt(i);
diff --git a/dom/cache/ReadStream.cpp b/dom/cache/ReadStream.cpp
index 6bc9ced2ed..9c8d0874d7 100644
--- a/dom/cache/ReadStream.cpp
+++ b/dom/cache/ReadStream.cpp
@@ -489,12 +489,6 @@ ReadStream::Create(const CacheReadStream& aReadStream)
nsCOMPtr<nsIInputStream> stream = DeserializeIPCStream(aReadStream.stream());
MOZ_DIAGNOSTIC_ASSERT(stream);
- // Currently we expect all cache read streams to be blocking file streams.
-#if !defined(RELEASE_OR_BETA)
- nsCOMPtr<nsIAsyncInputStream> asyncStream = do_QueryInterface(stream);
- MOZ_DIAGNOSTIC_ASSERT(!asyncStream);
-#endif
-
RefPtr<Inner> inner = new Inner(control, aReadStream.id(), stream);
RefPtr<ReadStream> ref = new ReadStream(inner);
return ref.forget();
diff --git a/dom/cache/StreamControl.cpp b/dom/cache/StreamControl.cpp
index c084081806..892070a6d0 100644
--- a/dom/cache/StreamControl.cpp
+++ b/dom/cache/StreamControl.cpp
@@ -44,7 +44,7 @@ void
StreamControl::CloseReadStreams(const nsID& aId)
{
AssertOwningThread();
-#if defined(DEBUG) || !defined(RELEASE_OR_BETA)
+#if defined(DEBUG)
uint32_t closedCount = 0;
#endif
@@ -53,13 +53,15 @@ StreamControl::CloseReadStreams(const nsID& aId)
RefPtr<ReadStream::Controllable> stream = iter.GetNext();
if (stream->MatchId(aId)) {
stream->CloseStream();
-#if defined(DEBUG) || !defined(RELEASE_OR_BETA)
+#if defined(DEBUG)
closedCount += 1;
#endif
}
}
+#if defined(DEBUG)
MOZ_DIAGNOSTIC_ASSERT(closedCount > 0);
+#endif
}
void
diff --git a/dom/plugins/base/nsPluginTags.cpp b/dom/plugins/base/nsPluginTags.cpp
index 3f845b5cd4..ae5ba87586 100644
--- a/dom/plugins/base/nsPluginTags.cpp
+++ b/dom/plugins/base/nsPluginTags.cpp
@@ -375,10 +375,10 @@ void nsPluginTag::InitMime(const char* const* aMimeTypes,
break;
case nsPluginHost::eSpecialType_None:
default:
-#ifndef RELEASE_OR_BETA
- // Allow async init for all plugins on Nightly and Aurora
- mSupportsAsyncInit = true;
-#endif
+ // XXXMC: Async init for all plugins is experimental, but was historically
+ // default-enabled here on Nightly and Aurora but not release.
+ // Likely not a big concern. We can wait for plugins to be ready.
+ mSupportsAsyncInit = false;
break;
}
diff --git a/dom/worklet/Worklet.cpp b/dom/worklet/Worklet.cpp
index 7a76fcd1c8..f6baabd935 100644
--- a/dom/worklet/Worklet.cpp
+++ b/dom/worklet/Worklet.cpp
@@ -328,9 +328,8 @@ Worklet::Worklet(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
MOZ_ASSERT(aWindow);
MOZ_ASSERT(aPrincipal);
-#ifdef RELEASE_OR_BETA
+ // XXXMC: Do we want this worklet code in the future?
MOZ_CRASH("This code should not go to release/beta yet!");
-#endif
}
Worklet::~Worklet()