Backed out changeset a296439a25ff (bug 1519636) for frequent Windows cppunit failures CLOSED TREE

This commit is contained in:
arthur.iakab 2019-05-24 14:26:01 +03:00
parent 5bed2b0138
commit af8e458c5f
159 changed files with 591 additions and 564 deletions

View file

@ -338,8 +338,7 @@ uint64_t HTMLTextFieldAccessible::NativeState() const {
return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP; return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP;
// Ordinal XUL textboxes don't support autocomplete. // Ordinal XUL textboxes don't support autocomplete.
if (!BindingOrWidgetParent() && if (!BindingOrWidgetParent() && Preferences::GetBool("browser.formfill.enable")) {
Preferences::GetBool("browser.formfill.enable")) {
// Check to see if autocompletion is allowed on this input. We don't expose // Check to see if autocompletion is allowed on this input. We don't expose
// it for password fields even though the entire password can be remembered // it for password fields even though the entire password can be remembered
// for a page if the user asks it to be. However, the kind of autocomplete // for a page if the user asks it to be. However, the kind of autocomplete

View file

@ -102,7 +102,7 @@ class HTMLTextFieldAccessible final : public HyperTextAccessibleWrap {
* HTML:input@type="number". * HTML:input@type="number".
*/ */
nsIContent* BindingOrWidgetParent() const { nsIContent* BindingOrWidgetParent() const {
nsIContent* el = mContent->GetBindingParent(); nsIContent * el = mContent->GetBindingParent();
if (el) { if (el) {
return el; return el;
} }

View file

@ -176,11 +176,11 @@ static mozilla::Maybe<bool> RunAsLauncherProcess(int& argc, wchar_t** argv) {
bool runAsLauncher = DoLauncherProcessChecks(argc, argv); bool runAsLauncher = DoLauncherProcessChecks(argc, argv);
#if defined(MOZ_LAUNCHER_PROCESS) #if defined(MOZ_LAUNCHER_PROCESS)
bool forceLauncher = bool forceLauncher = runAsLauncher &&
runAsLauncher && mozilla::CheckArg(argc, argv, L"force-launcher",
mozilla::CheckArg(argc, argv, L"force-launcher", static_cast<const wchar_t**>(nullptr),
static_cast<const wchar_t**>(nullptr), mozilla::CheckArgFlag::RemoveArg) ==
mozilla::CheckArgFlag::RemoveArg) == mozilla::ARG_FOUND; mozilla::ARG_FOUND;
mozilla::LauncherRegistryInfo::ProcessType desiredType = mozilla::LauncherRegistryInfo::ProcessType desiredType =
runAsLauncher ? mozilla::LauncherRegistryInfo::ProcessType::Launcher runAsLauncher ? mozilla::LauncherRegistryInfo::ProcessType::Launcher

View file

@ -49,7 +49,8 @@ NS_IMPL_CI_INTERFACE_GETTER(ContentPrincipal, nsIPrincipal, nsISerializable)
ContentPrincipal::ContentPrincipal() : BasePrincipal(eCodebasePrincipal) {} ContentPrincipal::ContentPrincipal() : BasePrincipal(eCodebasePrincipal) {}
ContentPrincipal::~ContentPrincipal() {} ContentPrincipal::~ContentPrincipal() {
}
nsresult ContentPrincipal::Init(nsIURI* aCodebase, nsresult ContentPrincipal::Init(nsIURI* aCodebase,
const OriginAttributes& aOriginAttributes, const OriginAttributes& aOriginAttributes,

View file

@ -814,9 +814,9 @@ void BrowsingContext::Transaction::Apply(BrowsingContext* aBrowsingContext,
} }
BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() { BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() {
MOZ_ASSERT(!mozilla::Preferences::GetBool( MOZ_ASSERT(
"fission.preserve_browsing_contexts", false) || !mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", false) ||
IsContent()); IsContent());
IPCInitializer init; IPCInitializer init;
init.mId = Id(); init.mId = Id();

View file

@ -766,24 +766,24 @@ class nsDocShell final : public nsDocLoader,
BFCACHE_SUCCESS, BFCACHE_SUCCESS,
UNLOAD = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER, UNLOAD = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER,
UNLOAD_REQUEST = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER | UNLOAD_REQUEST = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER |
mozilla::dom::BFCacheStatus::REQUEST, mozilla::dom::BFCacheStatus::REQUEST,
REQUEST = mozilla::dom::BFCacheStatus::REQUEST, REQUEST = mozilla::dom::BFCacheStatus::REQUEST,
UNLOAD_REQUEST_PEER = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER | UNLOAD_REQUEST_PEER = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER |
mozilla::dom::BFCacheStatus::REQUEST | mozilla::dom::BFCacheStatus::REQUEST |
mozilla::dom::BFCacheStatus::ACTIVE_PEER_CONNECTION, mozilla::dom::BFCacheStatus::ACTIVE_PEER_CONNECTION,
UNLOAD_REQUEST_PEER_MSE = UNLOAD_REQUEST_PEER_MSE =
mozilla::dom::BFCacheStatus::UNLOAD_LISTENER | mozilla::dom::BFCacheStatus::UNLOAD_LISTENER |
mozilla::dom::BFCacheStatus::REQUEST | mozilla::dom::BFCacheStatus::REQUEST |
mozilla::dom::BFCacheStatus::ACTIVE_PEER_CONNECTION | mozilla::dom::BFCacheStatus::ACTIVE_PEER_CONNECTION |
mozilla::dom::BFCacheStatus::CONTAINS_MSE_CONTENT, mozilla::dom::BFCacheStatus::CONTAINS_MSE_CONTENT,
UNLOAD_REQUEST_MSE = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER | UNLOAD_REQUEST_MSE = mozilla::dom::BFCacheStatus::UNLOAD_LISTENER |
mozilla::dom::BFCacheStatus::REQUEST | mozilla::dom::BFCacheStatus::REQUEST |
mozilla::dom::BFCacheStatus::CONTAINS_MSE_CONTENT, mozilla::dom::BFCacheStatus::CONTAINS_MSE_CONTENT,
SUSPENDED_UNLOAD_REQUEST_PEER = SUSPENDED_UNLOAD_REQUEST_PEER =
mozilla::dom::BFCacheStatus::SUSPENDED | mozilla::dom::BFCacheStatus::SUSPENDED |
mozilla::dom::BFCacheStatus::UNLOAD_LISTENER | mozilla::dom::BFCacheStatus::UNLOAD_LISTENER |
mozilla::dom::BFCacheStatus::REQUEST | mozilla::dom::BFCacheStatus::REQUEST |
mozilla::dom::BFCacheStatus::ACTIVE_PEER_CONNECTION, mozilla::dom::BFCacheStatus::ACTIVE_PEER_CONNECTION,
}; };
void ReportBFCacheComboTelemetry(uint16_t aCombo); void ReportBFCacheComboTelemetry(uint16_t aCombo);

View file

@ -6871,7 +6871,7 @@ static Maybe<LayoutDeviceToScreenScale> ParseScaleString(
} }
Maybe<LayoutDeviceToScreenScale> Document::ParseScaleInHeader( Maybe<LayoutDeviceToScreenScale> Document::ParseScaleInHeader(
nsAtom* aHeaderField) { nsAtom* aHeaderField) {
MOZ_ASSERT(aHeaderField == nsGkAtoms::viewport_initial_scale || MOZ_ASSERT(aHeaderField == nsGkAtoms::viewport_initial_scale ||
aHeaderField == nsGkAtoms::viewport_maximum_scale || aHeaderField == nsGkAtoms::viewport_maximum_scale ||
aHeaderField == nsGkAtoms::viewport_minimum_scale); aHeaderField == nsGkAtoms::viewport_minimum_scale);

View file

@ -280,7 +280,7 @@ void ResizeObserverEntry::SetContentRectAndSize(const nsSize& aSize) {
nsIFrame* frame = mTarget->GetPrimaryFrame(); nsIFrame* frame = mTarget->GetPrimaryFrame();
// 1. Update mContentRect. // 1. Update mContentRect.
nsMargin padding = frame ? frame->GetUsedPadding() : nsMargin(); nsMargin padding = frame ? frame->GetUsedPadding(): nsMargin();
// Per the spec, we need to use the top-left padding offset as the origin of // Per the spec, we need to use the top-left padding offset as the origin of
// our contentRect. // our contentRect.
nsRect rect(nsPoint(padding.left, padding.top), aSize); nsRect rect(nsPoint(padding.left, padding.top), aSize);

View file

@ -59,9 +59,8 @@ void ResizeObserverNotificationHelper::Unregister() {
} }
nsRefreshDriver* refreshDriver = GetRefreshDriver(); nsRefreshDriver* refreshDriver = GetRefreshDriver();
MOZ_RELEASE_ASSERT( MOZ_RELEASE_ASSERT(refreshDriver,
refreshDriver, "We should not leave a dangling reference to the observer around");
"We should not leave a dangling reference to the observer around");
bool rv = refreshDriver->RemoveRefreshObserver(this, FlushType::Display); bool rv = refreshDriver->RemoveRefreshObserver(this, FlushType::Display);
MOZ_DIAGNOSTIC_ASSERT(rv, "Should remove the observer successfully"); MOZ_DIAGNOSTIC_ASSERT(rv, "Should remove the observer successfully");

View file

@ -13,10 +13,9 @@ namespace mozilla {
namespace dom { namespace dom {
SerializedStackHolder::SerializedStackHolder() SerializedStackHolder::SerializedStackHolder()
: mHolder(StructuredCloneHolder::CloningSupported, : mHolder(StructuredCloneHolder::CloningSupported,
StructuredCloneHolder::TransferringNotSupported, StructuredCloneHolder::TransferringNotSupported,
StructuredCloneHolder::StructuredCloneScope:: StructuredCloneHolder::StructuredCloneScope::SameProcessDifferentThread) {}
SameProcessDifferentThread) {}
void SerializedStackHolder::WriteStack(JSContext* aCx, void SerializedStackHolder::WriteStack(JSContext* aCx,
JS::HandleObject aStack) { JS::HandleObject aStack) {
@ -38,8 +37,8 @@ void SerializedStackHolder::SerializeWorkerStack(JSContext* aCx,
JS::HandleObject aStack) { JS::HandleObject aStack) {
MOZ_ASSERT(aWorkerPrivate->IsOnCurrentThread()); MOZ_ASSERT(aWorkerPrivate->IsOnCurrentThread());
RefPtr<StrongWorkerRef> workerRef = RefPtr<StrongWorkerRef> workerRef = StrongWorkerRef::Create(
StrongWorkerRef::Create(aWorkerPrivate, "WorkerErrorReport"); aWorkerPrivate, "WorkerErrorReport");
if (workerRef) { if (workerRef) {
mWorkerRef = new ThreadSafeWorkerRef(workerRef); mWorkerRef = new ThreadSafeWorkerRef(workerRef);
} else { } else {
@ -79,7 +78,8 @@ JSObject* SerializedStackHolder::ReadStack(JSContext* aCx) {
} }
JS::RootedValue stackValue(aCx); JS::RootedValue stackValue(aCx);
mHolder.Read(xpc::CurrentNativeGlobal(aCx), aCx, &stackValue, IgnoreErrors()); mHolder.Read(xpc::CurrentNativeGlobal(aCx), aCx, &stackValue,
IgnoreErrors());
return stackValue.isObject() ? &stackValue.toObject() : nullptr; return stackValue.isObject() ? &stackValue.toObject() : nullptr;
} }
@ -92,8 +92,8 @@ UniquePtr<SerializedStackHolder> GetCurrentStackForNetMonitor(JSContext* aCx) {
return stack; return stack;
} }
void NotifyNetworkMonitorAlternateStack( void NotifyNetworkMonitorAlternateStack(nsISupports* aChannel,
nsISupports* aChannel, UniquePtr<SerializedStackHolder> aStackHolder) { UniquePtr<SerializedStackHolder> aStackHolder) {
if (!aStackHolder) { if (!aStackHolder) {
return; return;
} }
@ -121,8 +121,8 @@ void ConvertSerializedStackToJSON(UniquePtr<SerializedStackHolder> aStackHolder,
} }
JS::RootedObject converted(cx); JS::RootedObject converted(cx);
converted = JS::ConvertSavedFrameToPlainObject( converted = JS::ConvertSavedFrameToPlainObject(cx, savedFrame,
cx, savedFrame, JS::SavedFrameSelfHosted::Exclude); JS::SavedFrameSelfHosted::Exclude);
if (!converted) { if (!converted) {
JS_ClearPendingException(cx); JS_ClearPendingException(cx);
return; return;

View file

@ -59,8 +59,8 @@ UniquePtr<SerializedStackHolder> GetCurrentStackForNetMonitor(JSContext* aCx);
// thread. This call is synchronous, and aChannel and aStackHolder will not be // thread. This call is synchronous, and aChannel and aStackHolder will not be
// used afterward. aChannel is an nsISupports object because this can be used // used afterward. aChannel is an nsISupports object because this can be used
// with either nsIChannel or nsIWebSocketChannel. // with either nsIChannel or nsIWebSocketChannel.
void NotifyNetworkMonitorAlternateStack( void NotifyNetworkMonitorAlternateStack(nsISupports* aChannel,
nsISupports* aChannel, UniquePtr<SerializedStackHolder> aStackHolder); UniquePtr<SerializedStackHolder> aStackHolder);
// Read back the saved frame stack and store it in a string as JSON. // Read back the saved frame stack and store it in a string as JSON.
// This must be called on the main thread. // This must be called on the main thread.

View file

@ -81,11 +81,13 @@ void TabGroup::EnsureThrottledEventQueues() {
for (size_t i = 0; i < size_t(TaskCategory::Count); i++) { for (size_t i = 0; i < size_t(TaskCategory::Count); i++) {
TaskCategory category = static_cast<TaskCategory>(i); TaskCategory category = static_cast<TaskCategory>(i);
if (category == TaskCategory::Worker) { if (category == TaskCategory::Worker) {
mEventTargets[i] = ThrottledEventQueue::Create(mEventTargets[i], mEventTargets[i] =
"TabGroup worker queue"); ThrottledEventQueue::Create(mEventTargets[i],
"TabGroup worker queue");
} else if (category == TaskCategory::Timer) { } else if (category == TaskCategory::Timer) {
mEventTargets[i] = mEventTargets[i] =
ThrottledEventQueue::Create(mEventTargets[i], "TabGroup timer queue"); ThrottledEventQueue::Create(mEventTargets[i],
"TabGroup timer queue");
} }
} }
} }

View file

@ -4180,9 +4180,10 @@ void nsContentUtils::RequestFrameFocus(Element& aFrameElement, bool aCanRaise) {
RefPtr<Element> target = &aFrameElement; RefPtr<Element> target = &aFrameElement;
bool defaultAction = true; bool defaultAction = true;
if (aCanRaise) { if (aCanRaise) {
DispatchEventOnlyToChrome( DispatchEventOnlyToChrome(target->OwnerDoc(), target,
target->OwnerDoc(), target, NS_LITERAL_STRING("framefocusrequested"), NS_LITERAL_STRING("framefocusrequested"),
CanBubble::eYes, Cancelable::eYes, &defaultAction); CanBubble::eYes, Cancelable::eYes,
&defaultAction);
} }
if (!defaultAction) { if (!defaultAction) {
return; return;

View file

@ -142,9 +142,7 @@ mozilla::dom::Nullable<uint16_t> nsDOMDataChannel::GetMaxRetransmits() const {
return mDataChannel->GetMaxRetransmits(); return mDataChannel->GetMaxRetransmits();
} }
bool nsDOMDataChannel::Negotiated() const { bool nsDOMDataChannel::Negotiated() const { return mDataChannel->GetNegotiated(); }
return mDataChannel->GetNegotiated();
}
bool nsDOMDataChannel::Ordered() const { return mDataChannel->GetOrdered(); } bool nsDOMDataChannel::Ordered() const { return mDataChannel->GetOrdered(); }

View file

@ -617,20 +617,19 @@ nsresult nsDocumentEncoder::SerializeNodeStart(nsINode& aOriginalNode,
return rv; return rv;
} }
Element* originalElement = aOriginalNode.AsElement(); Element* originalElement = aOriginalNode.AsElement();
rv = mSerializer->AppendElementStart(node->AsElement(), originalElement, rv = mSerializer->AppendElementStart(node->AsElement(), originalElement, aStr);
aStr);
return rv; return rv;
} }
switch (node->NodeType()) { switch (node->NodeType()) {
case nsINode::TEXT_NODE: { case nsINode::TEXT_NODE: {
rv = mSerializer->AppendText(static_cast<nsIContent*>(node), aStartOffset, rv = mSerializer->AppendText(static_cast<nsIContent*>(node), aStartOffset,
aEndOffset, aStr); aEndOffset, aStr);
break; break;
} }
case nsINode::CDATA_SECTION_NODE: { case nsINode::CDATA_SECTION_NODE: {
rv = mSerializer->AppendCDATASection(static_cast<nsIContent*>(node), rv = mSerializer->AppendCDATASection(static_cast<nsIContent*>(node),
aStartOffset, aEndOffset, aStr); aStartOffset, aEndOffset, aStr);
break; break;
} }
case nsINode::PROCESSING_INSTRUCTION_NODE: { case nsINode::PROCESSING_INSTRUCTION_NODE: {
@ -641,7 +640,7 @@ nsresult nsDocumentEncoder::SerializeNodeStart(nsINode& aOriginalNode,
} }
case nsINode::COMMENT_NODE: { case nsINode::COMMENT_NODE: {
rv = mSerializer->AppendComment(static_cast<Comment*>(node), aStartOffset, rv = mSerializer->AppendComment(static_cast<Comment*>(node), aStartOffset,
aEndOffset, aStr); aEndOffset, aStr);
break; break;
} }
case nsINode::DOCUMENT_TYPE_NODE: { case nsINode::DOCUMENT_TYPE_NODE: {

View file

@ -47,8 +47,7 @@ void nsFrameLoaderOwner::ChangeRemoteness(
// Policy, do not preserve the browsing context. Otherwise, save off the // Policy, do not preserve the browsing context. Otherwise, save off the
// browsing context and use it when creating our new FrameLoader. // browsing context and use it when creating our new FrameLoader.
if (!aOptions.mReplaceBrowsingContext && !isChromeRemoteToLocal && if (!aOptions.mReplaceBrowsingContext && !isChromeRemoteToLocal &&
mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", false)) {
false)) {
bc = mFrameLoader->GetBrowsingContext(); bc = mFrameLoader->GetBrowsingContext();
mFrameLoader->SkipBrowsingContextDetach(); mFrameLoader->SkipBrowsingContextDetach();
} }

View file

@ -231,7 +231,9 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
} }
// nsIGlobalJSObjectHolder // nsIGlobalJSObjectHolder
JSObject* GetGlobalJSObject() final { return GetWrapper(); } JSObject* GetGlobalJSObject() final {
return GetWrapper();
}
JSObject* GetGlobalJSObjectPreserveColor() const final { JSObject* GetGlobalJSObjectPreserveColor() const final {
return GetWrapperPreserveColor(); return GetWrapperPreserveColor();
} }

View file

@ -134,8 +134,8 @@ void WebGLShader::CompileShader() {
PrintLongString(mCleanSource.BeginReading(), mCleanSource.Length()); PrintLongString(mCleanSource.BeginReading(), mCleanSource.Length());
} }
const bool success = Translate(mCleanSource, mValidator.get(), const bool success = Translate(mCleanSource, mValidator.get(), &mValidationLog,
&mValidationLog, &mTranslatedSource); &mTranslatedSource);
if (MOZ_UNLIKELY(kDumpShaders)) { if (MOZ_UNLIKELY(kDumpShaders)) {
printf_stderr("\n==== \\/ \\/ \\/ ====\n"); printf_stderr("\n==== \\/ \\/ \\/ ====\n");

View file

@ -16,10 +16,9 @@ namespace mozilla {
namespace webgl { namespace webgl {
class ShaderValidator final { class ShaderValidator final {
public: public:
const ShHandle mHandle; const ShHandle mHandle;
private:
private:
const ShCompileOptions mCompileOptions; const ShCompileOptions mCompileOptions;
const int mMaxVaryingVectors; const int mMaxVaryingVectors;
bool mHasRun; bool mHasRun;

View file

@ -518,8 +518,8 @@ void PointerEventHandler::DispatchPointerFromMouseOrTouch(
break; break;
case eMouseDown: case eMouseDown:
pointerMessage = pointerMessage =
mouseEvent->mButtons & ~nsContentUtils::GetButtonsFlagForButton( mouseEvent->mButtons &
mouseEvent->mButton) ~nsContentUtils::GetButtonsFlagForButton(mouseEvent->mButton)
? ePointerMove ? ePointerMove
: ePointerDown; : ePointerDown;
break; break;

View file

@ -55,7 +55,9 @@ class BrowserHost : public RemoteBrowser,
ContentParent* GetContentParent() const { ContentParent* GetContentParent() const {
return mRoot ? mRoot->Manager() : nullptr; return mRoot ? mRoot->Manager() : nullptr;
} }
TabId GetTabId() const { return mId; } TabId GetTabId() const {
return mId;
}
BrowserHost* AsBrowserHost() override { return this; } BrowserHost* AsBrowserHost() override { return this; }
BrowserBridgeHost* AsBrowserBridgeHost() override { return nullptr; } BrowserBridgeHost* AsBrowserBridgeHost() override { return nullptr; }

View file

@ -137,9 +137,9 @@ using namespace mozilla::widget;
using namespace mozilla::jsipc; using namespace mozilla::jsipc;
using namespace mozilla::gfx; using namespace mozilla::gfx;
using mozilla::Unused;
using mozilla::LazyLogModule; using mozilla::LazyLogModule;
using mozilla::StaticAutoPtr; using mozilla::StaticAutoPtr;
using mozilla::Unused;
LazyLogModule gBrowserFocusLog("BrowserFocus"); LazyLogModule gBrowserFocusLog("BrowserFocus");

View file

@ -161,17 +161,17 @@ NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedFullHash(
} }
NS_IMETHODIMP RemoteWebProgressRequest::SetMatchedTrackingInfo( NS_IMETHODIMP RemoteWebProgressRequest::SetMatchedTrackingInfo(
const nsTArray<nsCString>& aLists, const nsTArray<nsCString>& aFullHashes) { const nsTArray<nsCString> &aLists, const nsTArray<nsCString> &aFullHashes) {
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedTrackingLists( NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedTrackingLists(
nsTArray<nsCString>& aLists) { nsTArray<nsCString> &aLists) {
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedTrackingFullHashes( NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedTrackingFullHashes(
nsTArray<nsCString>& aFullHashes) { nsTArray<nsCString> &aFullHashes) {
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
// nsIRequest methods // nsIRequest methods

View file

@ -974,14 +974,10 @@ long AudioCallbackDriver::DataCallback(const AudioDataValue* aInputBuffer,
static const char* StateToString(cubeb_state aState) { static const char* StateToString(cubeb_state aState) {
switch (aState) { switch (aState) {
case CUBEB_STATE_STARTED: case CUBEB_STATE_STARTED: return "STARTED";
return "STARTED"; case CUBEB_STATE_STOPPED: return "STOPPED";
case CUBEB_STATE_STOPPED: case CUBEB_STATE_DRAINED: return "DRAINED";
return "STOPPED"; case CUBEB_STATE_ERROR: return "ERROR";
case CUBEB_STATE_DRAINED:
return "DRAINED";
case CUBEB_STATE_ERROR:
return "ERROR";
default: default:
MOZ_CRASH("Unexpected state!"); MOZ_CRASH("Unexpected state!");
} }
@ -989,8 +985,7 @@ static const char* StateToString(cubeb_state aState) {
void AudioCallbackDriver::StateCallback(cubeb_state aState) { void AudioCallbackDriver::StateCallback(cubeb_state aState) {
MOZ_ASSERT(!OnGraphThread()); MOZ_ASSERT(!OnGraphThread());
LOG(LogLevel::Debug, LOG(LogLevel::Debug, ("AudioCallbackDriver State: %s", StateToString(aState)));
("AudioCallbackDriver State: %s", StateToString(aState)));
// Clear the flag for the not running // Clear the flag for the not running
// states: stopped, drained, error. // states: stopped, drained, error.

View file

@ -16,7 +16,7 @@
#include "MediaInfo.h" #include "MediaInfo.h"
#include "VPXDecoder.h" #include "VPXDecoder.h"
#include "gfxPrefs.h" #include "gfxPrefs.h"
#include "nsIXULRuntime.h" // for BrowserTabsRemoteAutostart #include "nsIXULRuntime.h" // for BrowserTabsRemoteAutostart
#include "mozilla/CDMProxy.h" #include "mozilla/CDMProxy.h"
#include "mozilla/ClearOnShutdown.h" #include "mozilla/ClearOnShutdown.h"
#include "mozilla/GpuDecoderModule.h" #include "mozilla/GpuDecoderModule.h"
@ -345,7 +345,8 @@ void PDMFactory::CreatePDMs() {
return; return;
} }
if (StaticPrefs::MediaRddProcessEnabled() && BrowserTabsRemoteAutostart()) { if (StaticPrefs::MediaRddProcessEnabled()
&& BrowserTabsRemoteAutostart()) {
m = new RemoteDecoderModule; m = new RemoteDecoderModule;
StartupPDM(m); StartupPDM(m);
} }

View file

@ -26,7 +26,8 @@ bool AgnosticDecoderModule::SupportsMimeType(
VPXDecoder::IsVPX(aMimeType) || OpusDataDecoder::IsOpus(aMimeType) || VPXDecoder::IsVPX(aMimeType) || OpusDataDecoder::IsOpus(aMimeType) ||
WaveDataDecoder::IsWave(aMimeType) || TheoraDecoder::IsTheora(aMimeType); WaveDataDecoder::IsWave(aMimeType) || TheoraDecoder::IsTheora(aMimeType);
if (!StaticPrefs::MediaRddVorbisEnabled() || if (!StaticPrefs::MediaRddVorbisEnabled() ||
!StaticPrefs::MediaRddProcessEnabled() || !BrowserTabsRemoteAutostart()) { !StaticPrefs::MediaRddProcessEnabled() ||
!BrowserTabsRemoteAutostart()) {
supports |= VorbisDataDecoder::IsVorbis(aMimeType); supports |= VorbisDataDecoder::IsVorbis(aMimeType);
} }
#ifdef MOZ_AV1 #ifdef MOZ_AV1

View file

@ -43,7 +43,8 @@ using namespace net;
namespace dom { namespace dom {
static void FireInteralError(TCPSocketParent* aActor, uint32_t aLineNo) { static void FireInteralError(TCPSocketParent* aActor,
uint32_t aLineNo) {
MOZ_ASSERT(aActor->IPCOpen()); MOZ_ASSERT(aActor->IPCOpen());
mozilla::Unused << aActor->SendCallback( mozilla::Unused << aActor->SendCallback(

View file

@ -66,7 +66,9 @@ struct GCPolicy<nsJSObjWrapper*> {
(*wrapper)->trace(trc); (*wrapper)->trace(trc);
} }
static bool isValid(const nsJSObjWrapper*& wrapper) { return true; } static bool isValid(const nsJSObjWrapper *&wrapper) {
return true;
}
}; };
} // namespace JS } // namespace JS

View file

@ -173,8 +173,7 @@ class QuotaManager final : public BackgroundThreadObject {
/** /**
* For use when creating an origin directory. It's possible that origin usage * For use when creating an origin directory. It's possible that origin usage
* is already being tracked due to a call to EnsureQuotaForOrigin, and in that * is already being tracked due to a call to EnsureQuotaForOrigin, and in that
* case we need to update the existing OriginInfo rather than create a new * case we need to update the existing OriginInfo rather than create a new one.
* one.
*/ */
void NoteOriginDirectoryCreated(PersistenceType aPersistenceType, void NoteOriginDirectoryCreated(PersistenceType aPersistenceType,
const nsACString& aGroup, const nsACString& aGroup,

View file

@ -75,8 +75,8 @@ void StorageNotifierService::Broadcast(StorageEvent* aEvent,
// No reasons to continue if the principal of the event doesn't match with // No reasons to continue if the principal of the event doesn't match with
// the window's one. // the window's one.
if (!StorageUtils::PrincipalsEqual( if (!StorageUtils::PrincipalsEqual(aEvent->GetPrincipal(),
aEvent->GetPrincipal(), observer->GetEffectiveStoragePrincipal())) { observer->GetEffectiveStoragePrincipal())) {
continue; continue;
} }

View file

@ -165,11 +165,9 @@ class SVGPathData {
* which is generated by cbindgen from Rust (see ServoStyleConsts.h). * which is generated by cbindgen from Rust (see ServoStyleConsts.h).
* Basically, this is a variant of the above BuildPath() functions. * Basically, this is a variant of the above BuildPath() functions.
*/ */
static already_AddRefed<Path> BuildPath(Span<const StylePathCommand> aPath, static already_AddRefed<Path> BuildPath(
PathBuilder* aBuilder, Span<const StylePathCommand> aPath, PathBuilder* aBuilder,
uint8_t aStrokeLineCap, uint8_t aStrokeLineCap, Float aStrokeWidth, float aZoomFactor = 1.0);
Float aStrokeWidth,
float aZoomFactor = 1.0);
const_iterator begin() const { return mData.Elements(); } const_iterator begin() const { return mData.Elements(); }
const_iterator end() const { return mData.Elements() + mData.Length(); } const_iterator end() const { return mData.Elements() + mData.Length(); }

View file

@ -1649,11 +1649,11 @@ nsresult WebSocketImpl::Init(JSContext* aCx, nsIPrincipal* aLoadingPrincipal,
return NS_OK; return NS_OK;
} }
nsresult WebSocketImpl::AsyncOpen( nsresult WebSocketImpl::AsyncOpen(nsIPrincipal* aPrincipal,
nsIPrincipal* aPrincipal, uint64_t aInnerWindowID, uint64_t aInnerWindowID,
nsITransportProvider* aTransportProvider, nsITransportProvider* aTransportProvider,
const nsACString& aNegotiatedExtensions, const nsACString& aNegotiatedExtensions,
UniquePtr<SerializedStackHolder> aOriginStack) { UniquePtr<SerializedStackHolder> aOriginStack) {
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread"); MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT_IF(!aTransportProvider, aNegotiatedExtensions.IsEmpty()); MOZ_ASSERT_IF(!aTransportProvider, aNegotiatedExtensions.IsEmpty());

View file

@ -72,7 +72,7 @@
#include "xpcpublic.h" #include "xpcpublic.h"
#if defined(XP_MACOSX) #if defined(XP_MACOSX)
# include "nsMacUtilsImpl.h" # include "nsMacUtilsImpl.h"
#endif #endif
#include "Principal.h" #include "Principal.h"

View file

@ -844,7 +844,8 @@ class ScriptLoaderRunnable final : public nsIRunnable, public nsINamed {
// thread) explicitly, so that we can use the stack to notify the net // thread) explicitly, so that we can use the stack to notify the net
// monitor about every script we load. // monitor about every script we load.
if (mOriginStack) { if (mOriginStack) {
ConvertSerializedStackToJSON(std::move(mOriginStack), mOriginStackJSON); ConvertSerializedStackToJSON(std::move(mOriginStack),
mOriginStackJSON);
} }
if (!mWorkerPrivate->IsServiceWorker() || IsDebuggerScript()) { if (!mWorkerPrivate->IsServiceWorker() || IsDebuggerScript()) {
@ -2124,8 +2125,8 @@ void LoadAllScripts(WorkerPrivate* aWorkerPrivate,
} }
RefPtr<ScriptLoaderRunnable> loader = new ScriptLoaderRunnable( RefPtr<ScriptLoaderRunnable> loader = new ScriptLoaderRunnable(
aWorkerPrivate, std::move(aOriginStack), syncLoopTarget, aLoadInfos, aWorkerPrivate, std::move(aOriginStack), syncLoopTarget, aLoadInfos, clientInfo,
clientInfo, controller, aIsMainScript, aWorkerScriptType, aRv); controller, aIsMainScript, aWorkerScriptType, aRv);
NS_ASSERTION(aLoadInfos.IsEmpty(), "Should have swapped!"); NS_ASSERTION(aLoadInfos.IsEmpty(), "Should have swapped!");

View file

@ -310,8 +310,7 @@ class CompileScriptRunnable final : public WorkerDebuggeeRunnable {
UniquePtr<SerializedStackHolder> aOriginStack, UniquePtr<SerializedStackHolder> aOriginStack,
const nsAString& aScriptURL) const nsAString& aScriptURL)
: WorkerDebuggeeRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount), : WorkerDebuggeeRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount),
mScriptURL(aScriptURL), mScriptURL(aScriptURL), mOriginStack(aOriginStack.release()) {}
mOriginStack(aOriginStack.release()) {}
private: private:
// We can't implement PreRun effectively, because at the point when that would // We can't implement PreRun effectively, because at the point when that would
@ -2179,9 +2178,10 @@ WorkerPrivate::WorkerPrivate(WorkerPrivate* aParent,
mMainThreadEventTargetForMessaging = mMainThreadEventTargetForMessaging =
ThrottledEventQueue::Create(target, "Worker queue for messaging"); ThrottledEventQueue::Create(target, "Worker queue for messaging");
if (StaticPrefs::dom_worker_use_medium_high_event_queue()) { if (StaticPrefs::dom_worker_use_medium_high_event_queue()) {
mMainThreadEventTarget = ThrottledEventQueue::Create( mMainThreadEventTarget =
GetMainThreadSerialEventTarget(), "Worker queue", ThrottledEventQueue::Create(GetMainThreadSerialEventTarget(),
nsIRunnablePriority::PRIORITY_MEDIUMHIGH); "Worker queue",
nsIRunnablePriority::PRIORITY_MEDIUMHIGH);
} else { } else {
mMainThreadEventTarget = mMainThreadEventTargetForMessaging; mMainThreadEventTarget = mMainThreadEventTargetForMessaging;
} }

View file

@ -766,7 +766,9 @@ class WorkerPrivate : public RelativeTimeline {
return mLoadInfo.mServiceWorkersTestingInWindow; return mLoadInfo.mServiceWorkersTestingInWindow;
} }
bool IsWatchedByDevtools() const { return mLoadInfo.mWatchedByDevtools; } bool IsWatchedByDevtools() const {
return mLoadInfo.mWatchedByDevtools;
}
// Determine if the worker is currently loading its top level script. // Determine if the worker is currently loading its top level script.
bool IsLoadingWorkerScript() const { return mLoadingWorkerScript; } bool IsLoadingWorkerScript() const { return mLoadingWorkerScript; }

View file

@ -5,10 +5,10 @@
#include "mozilla/HTMLEditorController.h" #include "mozilla/HTMLEditorController.h"
#include "mozilla/EditorCommands.h" // for StyleUpdatingCommand, etc #include "mozilla/EditorCommands.h" // for StyleUpdatingCommand, etc
#include "mozilla/mozalloc.h" // for operator new #include "mozilla/mozalloc.h" // for operator new
#include "nsControllerCommandTable.h" // for nsControllerCommandTable #include "nsControllerCommandTable.h" // for nsControllerCommandTable
#include "nsError.h" // for NS_OK #include "nsError.h" // for NS_OK
namespace mozilla { namespace mozilla {

View file

@ -5,17 +5,17 @@
#include "mozilla/EditorCommands.h" #include "mozilla/EditorCommands.h"
#include "mozilla/HTMLEditor.h" // for HTMLEditor #include "mozilla/HTMLEditor.h" // for HTMLEditor
#include "mozilla/TextEditor.h" // for TextEditor #include "mozilla/TextEditor.h" // for TextEditor
#include "mozilla/dom/Document.h" // for Document #include "mozilla/dom/Document.h" // for Document
#include "nsCommandParams.h" // for nsCommandParams #include "nsCommandParams.h" // for nsCommandParams
#include "nsIDocShell.h" // for nsIDocShell #include "nsIDocShell.h" // for nsIDocShell
#include "nsIEditingSession.h" // for nsIEditingSession, etc #include "nsIEditingSession.h" // for nsIEditingSession, etc
#include "nsISelectionController.h" // for nsISelectionController #include "nsISelectionController.h" // for nsISelectionController
#include "nsISupportsImpl.h" // for nsPresContext::Release #include "nsISupportsImpl.h" // for nsPresContext::Release
#include "nsISupportsUtils.h" // for NS_IF_ADDREF #include "nsISupportsUtils.h" // for NS_IF_ADDREF
#include "nsIURI.h" // for nsIURI #include "nsIURI.h" // for nsIURI
#include "nsPresContext.h" // for nsPresContext #include "nsPresContext.h" // for nsPresContext
// defines // defines
#define STATE_ENABLED "state_enabled" #define STATE_ENABLED "state_enabled"

View file

@ -141,13 +141,15 @@ static void NotifySubdocumentInvalidation(
} }
static void SetChildrenChangedRecursive(Layer* aLayer) { static void SetChildrenChangedRecursive(Layer* aLayer) {
ForEachNode<ForwardIterator>(aLayer, [](Layer* layer) { ForEachNode<ForwardIterator>(
ContainerLayer* container = layer->AsContainerLayer(); aLayer,
if (container) { [](Layer* layer) {
container->SetChildrenChanged(true); ContainerLayer* container = layer->AsContainerLayer();
container->SetInvalidCompositeRect(nullptr); if (container) {
} container->SetChildrenChanged(true);
}); container->SetInvalidCompositeRect(nullptr);
}
});
} }
struct LayerPropertiesBase : public LayerProperties { struct LayerPropertiesBase : public LayerProperties {

View file

@ -590,7 +590,6 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
// Also used for controlling time during tests // Also used for controlling time during tests
void SetTestSampleTime(const Maybe<TimeStamp>& aTime); void SetTestSampleTime(const Maybe<TimeStamp>& aTime);
private: private:
Maybe<TimeStamp> mTestSampleTime; Maybe<TimeStamp> mTestSampleTime;

View file

@ -666,7 +666,8 @@ static bool PrepareForSetTargetAPZCNotification(
nsIWidget* aWidget, const LayersId& aLayersId, nsIFrame* aRootFrame, nsIWidget* aWidget, const LayersId& aLayersId, nsIFrame* aRootFrame,
const LayoutDeviceIntPoint& aRefPoint, const LayoutDeviceIntPoint& aRefPoint,
nsTArray<SLGuidAndRenderRoot>* aTargets) { nsTArray<SLGuidAndRenderRoot>* aTargets) {
SLGuidAndRenderRoot guid(aLayersId, 0, ScrollableLayerGuid::NULL_SCROLL_ID, SLGuidAndRenderRoot guid(aLayersId, 0,
ScrollableLayerGuid::NULL_SCROLL_ID,
wr::RenderRoot::Default); wr::RenderRoot::Default);
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo( nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
aWidget, aRefPoint, aRootFrame); aWidget, aRefPoint, aRootFrame);
@ -817,11 +818,9 @@ void DisplayportSetListener::DidRefresh() {
} }
UniquePtr<DisplayportSetListener> UniquePtr<DisplayportSetListener>
APZCCallbackHelper::SendSetTargetAPZCNotification(nsIWidget* aWidget, APZCCallbackHelper::SendSetTargetAPZCNotification(
dom::Document* aDocument, nsIWidget* aWidget, dom::Document* aDocument, const WidgetGUIEvent& aEvent,
const WidgetGUIEvent& aEvent, const LayersId& aLayersId, uint64_t aInputBlockId) {
const LayersId& aLayersId,
uint64_t aInputBlockId) {
if (!aWidget || !aDocument) { if (!aWidget || !aDocument) {
return nullptr; return nullptr;
} }

View file

@ -176,8 +176,8 @@ void APZEventState::ProcessSingleTap(const CSSPoint& aPoint,
const CSSToLayoutDeviceScale& aScale, const CSSToLayoutDeviceScale& aScale,
Modifiers aModifiers, Modifiers aModifiers,
int32_t aClickCount) { int32_t aClickCount) {
APZES_LOG("Handling single tap at %s with %d\n", Stringify(aPoint).c_str(), APZES_LOG("Handling single tap at %s with %d\n",
mTouchEndCancelled); Stringify(aPoint).c_str(), mTouchEndCancelled);
RefPtr<nsIContent> touchRollup = GetTouchRollup(); RefPtr<nsIContent> touchRollup = GetTouchRollup();
mTouchRollup = nullptr; mTouchRollup = nullptr;

View file

@ -225,6 +225,7 @@ BasicCompositor::BasicCompositor(CompositorBridgeParent* aParent,
mMaxTextureSize = mMaxTextureSize =
std::min(Factory::GetMaxSurfaceSize(gfxVars::ContentBackend()), std::min(Factory::GetMaxSurfaceSize(gfxVars::ContentBackend()),
Factory::GetMaxSurfaceSize(BackendType::CAIRO)); Factory::GetMaxSurfaceSize(BackendType::CAIRO));
} }
BasicCompositor::~BasicCompositor() { MOZ_COUNT_DTOR(BasicCompositor); } BasicCompositor::~BasicCompositor() { MOZ_COUNT_DTOR(BasicCompositor); }

View file

@ -451,8 +451,7 @@ CompositorD3D11::CreateRenderTargetFromSource(
bool CompositorD3D11::ShouldAllowFrameRecording() const { bool CompositorD3D11::ShouldAllowFrameRecording() const {
#ifdef MOZ_GECKO_PROFILER #ifdef MOZ_GECKO_PROFILER
return mAllowFrameRecording || return mAllowFrameRecording || profiler_feature_active(ProfilerFeature::Screenshots);
profiler_feature_active(ProfilerFeature::Screenshots);
#else #else
return mAllowFrameRecording; return mAllowFrameRecording;
#endif #endif

View file

@ -480,13 +480,13 @@ void WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize) {
// so on Android we use RGBA. // so on Android we use RGBA.
SurfaceFormat format = SurfaceFormat format =
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
SurfaceFormat::R8G8B8A8; SurfaceFormat::R8G8B8A8;
#else #else
SurfaceFormat::B8G8R8A8; SurfaceFormat::B8G8R8A8;
#endif #endif
RefPtr<TextureClient> texture = TextureClient::CreateForRawBufferAccess( RefPtr<TextureClient> texture = TextureClient::CreateForRawBufferAccess(
WrBridge(), format, aSize.ToUnknownSize(), BackendType::SKIA, WrBridge(), format, aSize.ToUnknownSize(),
TextureFlags::SNAPSHOT); BackendType::SKIA, TextureFlags::SNAPSHOT);
if (!texture) { if (!texture) {
return; return;
} }

View file

@ -76,7 +76,7 @@ class FontList {
* do not appear in this master list, but are referred to as aliases (see * do not appear in this master list, but are referred to as aliases (see
* SetAliases below); the alias list need not be populated before the font * SetAliases below); the alias list need not be populated before the font
* list is shared to content processes and used. * list is shared to content processes and used.
* *
* Only used in the parent process. * Only used in the parent process.
*/ */
void SetFamilyNames(const nsTArray<Family::InitData>& aFamilies); void SetFamilyNames(const nsTArray<Family::InitData>& aFamilies);
@ -182,12 +182,12 @@ class FontList {
* to use std::atomic<> for these. * to use std::atomic<> for these.
*/ */
struct Header { struct Header {
std::atomic<uint32_t> mAllocated; // Space allocated from this block; std::atomic<uint32_t> mAllocated; // Space allocated from this block;
// must be first field in Header // must be first field in Header
uint32_t mGeneration; // Font-list generation ID uint32_t mGeneration; // Font-list generation ID
uint32_t mFamilyCount; // Number of font families in the list uint32_t mFamilyCount; // Number of font families in the list
std::atomic<uint32_t> mBlockCount; // Total number of blocks that exist std::atomic<uint32_t> mBlockCount; // Total number of blocks that exist
std::atomic<uint32_t> mAliasCount; // Number of family aliases std::atomic<uint32_t> mAliasCount; // Number of family aliases
std::atomic<uint32_t> mLocalFaceCount; // Number of local face names std::atomic<uint32_t> mLocalFaceCount; // Number of local face names
Pointer mFamilies; // Pointer to array of |mFamilyCount| families Pointer mFamilies; // Pointer to array of |mFamilyCount| families
Pointer mAliases; // Pointer to array of |mAliasCount| aliases Pointer mAliases; // Pointer to array of |mAliasCount| aliases
@ -254,9 +254,9 @@ class FontList {
} }
RefPtr<mozilla::ipc::SharedMemoryBasic> mShmem; RefPtr<mozilla::ipc::SharedMemoryBasic> mShmem;
void* mAddr; // Address where the shared memory block is mapped in this void* mAddr; // Address where the shared memory block is mapped in this
// process; avoids virtual call to mShmem->memory() each time // process; avoids virtual call to mShmem->memory() each time
// we need to convert between Pointer and a real C++ pointer. // we need to convert between Pointer and a real C++ pointer.
}; };
Header& GetHeader() { Header& GetHeader() {

View file

@ -112,7 +112,7 @@ void Family::AddFaces(FontList* aList, const nsTArray<Face::InitData>& aFaces) {
// of the full CSS font-matching algorithm) if there is at maximum one normal, // of the full CSS font-matching algorithm) if there is at maximum one normal,
// bold, italic, and bold-italic face; in this case, they are stored at known // bold, italic, and bold-italic face; in this case, they are stored at known
// positions in the mFaces array. // positions in the mFaces array.
const Face::InitData* slots[4] = {nullptr, nullptr, nullptr, nullptr}; const Face::InitData* slots[4] = { nullptr, nullptr, nullptr, nullptr };
if (count >= 2 && count <= 4) { if (count >= 2 && count <= 4) {
// Check if this can be treated as a "simple" family // Check if this can be treated as a "simple" family
isSimple = true; isSimple = true;
@ -308,7 +308,7 @@ void Family::SearchAllFontsForChar(FontList* aList,
} }
} }
uint32_t numFaces = NumFaces(); uint32_t numFaces = NumFaces();
uint32_t charMapsLoaded = 0; // number of faces whose charmap is loaded uint32_t charMapsLoaded = 0; // number of faces whose charmap is loaded
Pointer* facePtrs = Faces(aList); Pointer* facePtrs = Faces(aList);
for (uint32_t i = 0; i < numFaces; i++) { for (uint32_t i = 0; i < numFaces; i++) {
Face* face = static_cast<Face*>(facePtrs[i].ToPtr(aList)); Face* face = static_cast<Face*>(facePtrs[i].ToPtr(aList));
@ -332,9 +332,8 @@ void Family::SearchAllFontsForChar(FontList* aList,
// already checked character coverage, do it now (note that // already checked character coverage, do it now (note that
// HasCharacter() will trigger loading the fontEntry's cmap, if // HasCharacter() will trigger loading the fontEntry's cmap, if
// needed). // needed).
RefPtr<gfxFontEntry> fe = RefPtr<gfxFontEntry> fe = gfxPlatformFontList::PlatformFontList()
gfxPlatformFontList::PlatformFontList()->GetOrCreateFontEntry(face, ->GetOrCreateFontEntry(face, this);
this);
if (!fe) { if (!fe) {
continue; continue;
} }
@ -359,8 +358,9 @@ void Family::SetFacePtrs(FontList* aList, nsTArray<Pointer>& aFaces) {
// them at the appropriate slots in mFaces and set the mIsSimple flag to // them at the appropriate slots in mFaces and set the mIsSimple flag to
// accelerate font-matching. // accelerate font-matching.
bool isSimple = true; bool isSimple = true;
Pointer slots[4] = {Pointer::Null(), Pointer::Null(), Pointer::Null(), Pointer slots[4] = {
Pointer::Null()}; Pointer::Null(), Pointer::Null(), Pointer::Null(), Pointer::Null()
};
for (const Pointer& fp : aFaces) { for (const Pointer& fp : aFaces) {
const Face* f = static_cast<const Face*>(fp.ToPtr(aList)); const Face* f = static_cast<const Face*>(fp.ToPtr(aList));
if (!f->mWeight.IsSingle() || !f->mStyle.IsSingle() || if (!f->mWeight.IsSingle() || !f->mStyle.IsSingle() ||
@ -438,7 +438,7 @@ void Family::SetupFamilyCharMap(FontList* aList) {
} }
if (merged) { if (merged) {
mCharacterMap = mCharacterMap =
gfxPlatformFontList::PlatformFontList()->GetShmemCharMap(&familyMap); gfxPlatformFontList::PlatformFontList()->GetShmemCharMap(&familyMap);
} else { } else {
mCharacterMap = firstMapShmPointer; mCharacterMap = firstMapShmPointer;
} }

View file

@ -124,13 +124,13 @@ struct String {
struct Face { struct Face {
// Data required to initialize a Face // Data required to initialize a Face
struct InitData { struct InitData {
nsCString mDescriptor; // descriptor that can be used to instantiate a nsCString mDescriptor; // descriptor that can be used to instantiate a
// platform font reference // platform font reference
uint16_t mIndex; // an index used with descriptor (on some platforms) uint16_t mIndex; // an index used with descriptor (on some platforms)
bool mFixedPitch; // is the face fixed-pitch (monospaced)? bool mFixedPitch; // is the face fixed-pitch (monospaced)?
mozilla::WeightRange mWeight; // CSS font-weight value mozilla::WeightRange mWeight; // CSS font-weight value
mozilla::StretchRange mStretch; // CSS font-stretch value mozilla::StretchRange mStretch; // CSS font-stretch value
mozilla::SlantStyleRange mStyle; // CSS font-style value mozilla::SlantStyleRange mStyle; // CSS font-style value
}; };
Face(FontList* aList, const InitData& aData) Face(FontList* aList, const InitData& aData)
@ -167,15 +167,15 @@ struct Face {
struct Family { struct Family {
// Data required to initialize a Family // Data required to initialize a Family
struct InitData { struct InitData {
InitData(const nsACString& aKey, // lookup key (lowercased) InitData(const nsACString& aKey, // lookup key (lowercased)
const nsACString& aName, // display name const nsACString& aName, // display name
uint32_t aIndex = 0, // [win] index in the system font collection uint32_t aIndex = 0, // [win] index in the system font collection
bool aHidden = false, // [mac] hidden font (e.g. .SFNSText)? bool aHidden = false, // [mac] hidden font (e.g. .SFNSText)?
bool aBundled = false, // [win] font was bundled with the app bool aBundled = false, // [win] font was bundled with the app
// rather than system-installed // rather than system-installed
bool aBadUnderline = false, // underline-position in font is bad bool aBadUnderline = false, // underline-position in font is bad
bool aForceClassic = false // [win] use "GDI classic" rendering bool aForceClassic = false // [win] use "GDI classic" rendering
) )
: mKey(aKey), : mKey(aKey),
mName(aName), mName(aName),
mIndex(aIndex), mIndex(aIndex),
@ -261,15 +261,15 @@ struct Family {
std::atomic<uint32_t> mFaceCount; std::atomic<uint32_t> mFaceCount;
String mKey; String mKey;
String mName; String mName;
Pointer mCharacterMap; // If non-null, union of character coverage of all Pointer mCharacterMap; // If non-null, union of character coverage of all
// faces in the family // faces in the family
Pointer mFaces; // Pointer to array of |mFaceCount| face pointers Pointer mFaces; // Pointer to array of |mFaceCount| face pointers
uint32_t mIndex; // [win] Top bit set indicates app-bundled font family uint32_t mIndex; // [win] Top bit set indicates app-bundled font family
bool mIsHidden; bool mIsHidden;
bool mIsBadUnderlineFamily; bool mIsBadUnderlineFamily;
bool mIsForceClassic; bool mIsForceClassic;
bool mIsSimple; // family allows simplified style matching: mFaces contains bool mIsSimple; // family allows simplified style matching: mFaces contains
// exactly 4 entries [Regular, Bold, Italic, BoldItalic]. // exactly 4 entries [Regular, Bold, Italic, BoldItalic].
}; };
/** /**
@ -325,7 +325,7 @@ struct ParamTraits<mozilla::fontlist::Pointer> {
} // namespace IPC } // namespace IPC
#undef ERROR // This is defined via Windows.h, but conflicts with some bindings #undef ERROR // This is defined via Windows.h, but conflicts with some bindings
// code when this gets included in the same compilation unit. // code when this gets included in the same compilation unit.
#endif /* SharedFontList_h */ #endif /* SharedFontList_h */

View file

@ -525,7 +525,7 @@ nsresult gfxDWriteFontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList(); gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
fontlist::FontList* sharedFontList = pfl->SharedFontList(); fontlist::FontList* sharedFontList = pfl->SharedFontList();
if (!IsUserFont() && mShmemFace) { if (!IsUserFont() && mShmemFace) {
mShmemFace->SetCharacterMap(sharedFontList, charmap); // async mShmemFace->SetCharacterMap(sharedFontList, charmap); // async
if (!TrySetShmemCharacterMap()) { if (!TrySetShmemCharacterMap()) {
// Temporarily retain charmap, until the shared version is // Temporarily retain charmap, until the shared version is
// ready for use. // ready for use.

View file

@ -140,7 +140,8 @@ gfxFontEntry::~gfxFontEntry() {
MOZ_ASSERT(!mGrFaceInitialized); MOZ_ASSERT(!mGrFaceInitialized);
} }
bool gfxFontEntry::TrySetShmemCharacterMap() { bool gfxFontEntry::TrySetShmemCharacterMap()
{
MOZ_ASSERT(mShmemFace); MOZ_ASSERT(mShmemFace);
auto list = gfxPlatformFontList::PlatformFontList()->SharedFontList(); auto list = gfxPlatformFontList::PlatformFontList()->SharedFontList();
mShmemCharacterMap = mShmemCharacterMap =

View file

@ -487,8 +487,7 @@ inline void gfxSparseBitSet::Union(const SharedBitSet& aBitset) {
mBlockIndex.AppendElement(NO_BLOCK); mBlockIndex.AppendElement(NO_BLOCK);
} }
auto blockIndex = reinterpret_cast<const uint16_t*>(&aBitset + 1); auto blockIndex = reinterpret_cast<const uint16_t*>(&aBitset + 1);
auto blocks = auto blocks = reinterpret_cast<const Block*>(blockIndex + aBitset.mBlockIndexCount);
reinterpret_cast<const Block*>(blockIndex + aBitset.mBlockIndexCount);
for (uint32_t i = 0; i < aBitset.mBlockIndexCount; ++i) { for (uint32_t i = 0; i < aBitset.mBlockIndexCount; ++i) {
// if it is missing (implicitly empty) in source, just skip // if it is missing (implicitly empty) in source, just skip
if (blockIndex[i] == NO_BLOCK) { if (blockIndex[i] == NO_BLOCK) {
@ -502,9 +501,10 @@ inline void gfxSparseBitSet::Union(const SharedBitSet& aBitset) {
continue; continue;
} }
// else set existing target block to the union of both // else set existing target block to the union of both
uint32_t* dst = reinterpret_cast<uint32_t*>(&mBlocks[mBlockIndex[i]].mBits); uint32_t* dst = reinterpret_cast<uint32_t*>(
const uint32_t* src = &mBlocks[mBlockIndex[i]].mBits);
reinterpret_cast<const uint32_t*>(&blocks[blockIndex[i]].mBits); const uint32_t* src = reinterpret_cast<const uint32_t*>(
&blocks[blockIndex[i]].mBits);
for (uint32_t j = 0; j < BLOCK_SIZE / 4; ++j) { for (uint32_t j = 0; j < BLOCK_SIZE / 4; ++j) {
dst[j] |= src[j]; dst[j] |= src[j];
} }

View file

@ -239,7 +239,7 @@ nsresult MacOSFontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList(); gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
fontlist::FontList* sharedFontList = pfl->SharedFontList(); fontlist::FontList* sharedFontList = pfl->SharedFontList();
if (!IsUserFont() && mShmemFace) { if (!IsUserFont() && mShmemFace) {
mShmemFace->SetCharacterMap(sharedFontList, charmap); // async mShmemFace->SetCharacterMap(sharedFontList, charmap); // async
if (!TrySetShmemCharacterMap()) { if (!TrySetShmemCharacterMap()) {
// Temporarily retain charmap, until the shared version is // Temporarily retain charmap, until the shared version is
// ready for use. // ready for use.
@ -1763,7 +1763,8 @@ void gfxMacPlatformFontList::ActivateFontsFromDir(nsIFile* aDir) {
} }
void gfxMacPlatformFontList::GetFacesInitDataForFamily( void gfxMacPlatformFontList::GetFacesInitDataForFamily(
const fontlist::Family* aFamily, nsTArray<fontlist::Face::InitData>& aFaces) const { const fontlist::Family* aFamily,
nsTArray<fontlist::Face::InitData>& aFaces) const {
nsAutoreleasePool localPool; nsAutoreleasePool localPool;
NS_ConvertUTF8toUTF16 name(aFamily->Key().AsString(SharedFontList())); NS_ConvertUTF8toUTF16 name(aFamily->Key().AsString(SharedFontList()));
@ -1859,7 +1860,8 @@ void gfxMacPlatformFontList::ReadFaceNamesForFamily(fontlist::Family* aFamily,
// of the macOS UI font; see MacOSFontEntry::GetFontRef(). We pass 16.0 in // of the macOS UI font; see MacOSFontEntry::GetFontRef(). We pass 16.0 in
// order to get a standard text-size face in this case, although it's // order to get a standard text-size face in this case, although it's
// unlikely to matter for the purpose of just reading family names. // unlikely to matter for the purpose of just reading family names.
auto fe = MakeUnique<MacOSFontEntry>(name, WeightRange(FontWeight::Normal()), false, 16.0); auto fe = MakeUnique<MacOSFontEntry>(name, WeightRange(FontWeight::Normal()),
false, 16.0);
if (!fe) { if (!fe) {
continue; continue;
} }
@ -1870,8 +1872,8 @@ void gfxMacPlatformFontList::ReadFaceNamesForFamily(fontlist::Family* aFamily,
uint32_t dataLength; uint32_t dataLength;
const char* nameData = hb_blob_get_data(nameTable, &dataLength); const char* nameData = hb_blob_get_data(nameTable, &dataLength);
AutoTArray<nsCString, 4> otherFamilyNames; AutoTArray<nsCString, 4> otherFamilyNames;
gfxFontUtils::ReadOtherFamilyNamesForFace(canonicalName, nameData, dataLength, otherFamilyNames, gfxFontUtils::ReadOtherFamilyNamesForFace(canonicalName, nameData, dataLength,
false); otherFamilyNames, false);
for (const auto& alias : otherFamilyNames) { for (const auto& alias : otherFamilyNames) {
auto af = mAliasTable.LookupOrAdd(alias); auto af = mAliasTable.LookupOrAdd(alias);
af->AppendElement(facePtrs[i]); af->AppendElement(facePtrs[i]);

View file

@ -410,7 +410,7 @@ NS_IMPL_ISUPPORTS(SRGBOverrideObserver, nsIObserver, nsISupportsWeakReference)
#define GFX_PREF_GRAPHITE_SHAPING "gfx.font_rendering.graphite.enabled" #define GFX_PREF_GRAPHITE_SHAPING "gfx.font_rendering.graphite.enabled"
#if defined(XP_MACOSX) #if defined(XP_MACOSX)
# define GFX_PREF_CORETEXT_SHAPING "gfx.font_rendering.coretext.enabled" #define GFX_PREF_CORETEXT_SHAPING "gfx.font_rendering.coretext.enabled"
#endif #endif
#define BIDI_NUMERAL_PREF "bidi.numeral" #define BIDI_NUMERAL_PREF "bidi.numeral"

View file

@ -1756,8 +1756,8 @@ bool gfxPlatformFontList::LoadFontInfo() {
uint32_t i, endIndex = mNumFamilies; uint32_t i, endIndex = mNumFamilies;
fontlist::FontList* list = SharedFontList(); fontlist::FontList* list = SharedFontList();
bool loadCmaps = bool loadCmaps =
!list && (!UsesSystemFallback() || !list && (!UsesSystemFallback() ||
gfxPlatform::GetPlatform()->UseCmapsDuringSystemFallback()); gfxPlatform::GetPlatform()->UseCmapsDuringSystemFallback());
// for each font family, load in various font info // for each font family, load in various font info
for (i = mStartIndex; i < endIndex; i++) { for (i = mStartIndex; i < endIndex; i++) {

View file

@ -129,7 +129,8 @@ bool RendererOGL::UpdateAndRender(const Maybe<gfx::IntSize>& aReadbackSize,
MOZ_ASSERT(aReadbackSize.isSome()); MOZ_ASSERT(aReadbackSize.isSome());
MOZ_ASSERT(aReadbackFormat.isSome()); MOZ_ASSERT(aReadbackFormat.isSome());
wr_renderer_readback(mRenderer, aReadbackSize.ref().width, wr_renderer_readback(mRenderer, aReadbackSize.ref().width,
aReadbackSize.ref().height, aReadbackFormat.ref(), aReadbackSize.ref().height,
aReadbackFormat.ref(),
&aReadbackBuffer.ref()[0], &aReadbackBuffer.ref()[0],
aReadbackBuffer.ref().length()); aReadbackBuffer.ref().length());
} }

View file

@ -430,10 +430,7 @@ void WebRenderAPI::Readback(const TimeStamp& aStartTime, gfx::IntSize size,
explicit Readback(layers::SynchronousTask* aTask, TimeStamp aStartTime, explicit Readback(layers::SynchronousTask* aTask, TimeStamp aStartTime,
gfx::IntSize aSize, const gfx::SurfaceFormat& aFormat, gfx::IntSize aSize, const gfx::SurfaceFormat& aFormat,
const Range<uint8_t>& aBuffer) const Range<uint8_t>& aBuffer)
: mTask(aTask), : mTask(aTask), mStartTime(aStartTime), mSize(aSize), mFormat(aFormat),
mStartTime(aStartTime),
mSize(aSize),
mFormat(aFormat),
mBuffer(aBuffer) { mBuffer(aBuffer) {
MOZ_COUNT_CTOR(Readback); MOZ_COUNT_CTOR(Readback);
} }
@ -1164,7 +1161,8 @@ void DisplayListBuilder::PushShadow(const wr::LayoutRect& aRect,
// being re-enabled mid-shadow. The optimization is restored in PopAllShadows. // being re-enabled mid-shadow. The optimization is restored in PopAllShadows.
SuspendClipLeafMerging(); SuspendClipLeafMerging();
wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible, wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible,
&mCurrentSpaceAndClipChain, aShadow, aShouldInflate); &mCurrentSpaceAndClipChain, aShadow,
aShouldInflate);
} }
void DisplayListBuilder::PopAllShadows() { void DisplayListBuilder::PopAllShadows() {

View file

@ -114,7 +114,7 @@ void GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration) {
screen->GetColorDepth(&colorDepth); screen->GetColorDepth(&colorDepth);
screen->GetPixelDepth(&pixelDepth); screen->GetPixelDepth(&pixelDepth);
orientation = orientation =
static_cast<hal::ScreenOrientation>(bridge->GetScreenOrientation()); static_cast<hal::ScreenOrientation>(bridge->GetScreenOrientation());
angle = bridge->GetScreenAngle(); angle = bridge->GetScreenAngle();
*aScreenConfiguration = *aScreenConfiguration =

View file

@ -25,8 +25,8 @@ class nsHyphenator {
private: private:
~nsHyphenator(); ~nsHyphenator();
void HyphenateWord(const nsAString& aString, uint32_t aStart, uint32_t aLimit, void HyphenateWord(const nsAString& aString, uint32_t aStart,
nsTArray<bool>& aHyphens); uint32_t aLimit, nsTArray<bool>& aHyphens);
void* mDict; void* mDict;
bool mHyphenateCapitalized; bool mHyphenateCapitalized;

View file

@ -69,7 +69,7 @@ ProcessRuntime::ProcessRuntime(GeckoProcessType aProcessType)
} }
nsAutoHandle curThreadImpToken(rawCurThreadImpToken); nsAutoHandle curThreadImpToken(rawCurThreadImpToken);
# if defined(DEBUG) #if defined(DEBUG)
// Ensure that our current token is still an impersonation token (ie, we // Ensure that our current token is still an impersonation token (ie, we
// have not yet called RevertToSelf() on this thread). // have not yet called RevertToSelf() on this thread).
DWORD len; DWORD len;
@ -77,7 +77,7 @@ ProcessRuntime::ProcessRuntime(GeckoProcessType aProcessType)
MOZ_ASSERT(::GetTokenInformation(rawCurThreadImpToken, TokenType, MOZ_ASSERT(::GetTokenInformation(rawCurThreadImpToken, TokenType,
&tokenType, sizeof(tokenType), &len) && &tokenType, sizeof(tokenType), &len) &&
len == sizeof(tokenType) && tokenType == TokenImpersonation); len == sizeof(tokenType) && tokenType == TokenImpersonation);
# endif // defined(DEBUG) #endif // defined(DEBUG)
// Create an impersonation token based on the current thread's token // Create an impersonation token based on the current thread's token
HANDLE rawMtaThreadImpToken = nullptr; HANDLE rawMtaThreadImpToken = nullptr;
@ -89,26 +89,22 @@ ProcessRuntime::ProcessRuntime(GeckoProcessType aProcessType)
nsAutoHandle mtaThreadImpToken(rawMtaThreadImpToken); nsAutoHandle mtaThreadImpToken(rawMtaThreadImpToken);
SandboxTarget::Instance()->RegisterSandboxStartCallback([]() -> void { SandboxTarget::Instance()->RegisterSandboxStartCallback([]() -> void {
EnsureMTA( EnsureMTA([]() -> void {
[]() -> void { // This is a security risk if it fails, so we release assert
// This is a security risk if it fails, so we release assert MOZ_RELEASE_ASSERT(::RevertToSelf(),
MOZ_RELEASE_ASSERT(::RevertToSelf(), "mscom::ProcessRuntime RevertToSelf failed");
"mscom::ProcessRuntime RevertToSelf failed"); }, EnsureMTA::Option::ForceDispatch);
},
EnsureMTA::Option::ForceDispatch);
}); });
// Impersonate and initialize. // Impersonate and initialize.
EnsureMTA( EnsureMTA([this, rawMtaThreadImpToken]() -> void {
[this, rawMtaThreadImpToken]() -> void { if (!::SetThreadToken(nullptr, rawMtaThreadImpToken)) {
if (!::SetThreadToken(nullptr, rawMtaThreadImpToken)) { mInitResult = HRESULT_FROM_WIN32(::GetLastError());
mInitResult = HRESULT_FROM_WIN32(::GetLastError()); return;
return; }
}
InitInsideApartment(); InitInsideApartment();
}, }, EnsureMTA::Option::ForceDispatch);
EnsureMTA::Option::ForceDispatch);
return; return;
} }

View file

@ -35,8 +35,7 @@ class AllocPolicyBase {
return js_pod_arena_calloc<T>(arenaId, numElems); return js_pod_arena_calloc<T>(arenaId, numElems);
} }
template <typename T> template <typename T>
T* maybe_pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, T* maybe_pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, size_t newSize) {
size_t newSize) {
return js_pod_arena_realloc<T>(arenaId, p, oldSize, newSize); return js_pod_arena_realloc<T>(arenaId, p, oldSize, newSize);
} }
template <typename T> template <typename T>
@ -48,8 +47,7 @@ class AllocPolicyBase {
return maybe_pod_arena_calloc<T>(arenaId, numElems); return maybe_pod_arena_calloc<T>(arenaId, numElems);
} }
template <typename T> template <typename T>
T* pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, T* pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, size_t newSize) {
size_t newSize) {
return maybe_pod_arena_realloc<T>(arenaId, p, oldSize, newSize); return maybe_pod_arena_realloc<T>(arenaId, p, oldSize, newSize);
} }
@ -145,8 +143,7 @@ class TempAllocPolicy : public AllocPolicyBase {
} }
template <typename T> template <typename T>
T* pod_arena_realloc(arena_id_t arenaId, T* prior, size_t oldSize, T* pod_arena_realloc(arena_id_t arenaId, T* prior, size_t oldSize, size_t newSize) {
size_t newSize) {
T* p2 = this->maybe_pod_arena_realloc<T>(arenaId, prior, oldSize, newSize); T* p2 = this->maybe_pod_arena_realloc<T>(arenaId, prior, oldSize, newSize);
if (MOZ_UNLIKELY(!p2)) { if (MOZ_UNLIKELY(!p2)) {
p2 = onOutOfMemoryTyped<T>(arenaId, AllocFunction::Realloc, newSize, p2 = onOutOfMemoryTyped<T>(arenaId, AllocFunction::Realloc, newSize,

View file

@ -1030,13 +1030,12 @@ class MOZ_RAII Rooted : public js::RootedBase<T, Rooted<T>> {
// empty T. // empty T.
template <typename RootingContext> template <typename RootingContext>
Rooted(const RootingContext& cx, CtorDispatcher, detail::FallbackOverload) Rooted(const RootingContext& cx, CtorDispatcher, detail::FallbackOverload)
: Rooted(cx, SafelyInitialized<T>()) {} : Rooted(cx, SafelyInitialized<T>()) {}
// If T can be constructed with a cx, then define another constructor for it // If T can be constructed with a cx, then define another constructor for it
// that will be preferred. // that will be preferred.
template <typename RootingContext, template <typename RootingContext,
typename = typename std::enable_if< typename = typename std::enable_if<std::is_constructible<T, RootingContext>::value>::type>
std::is_constructible<T, RootingContext>::value>::type>
Rooted(const RootingContext& cx, CtorDispatcher, detail::PreferredOverload) Rooted(const RootingContext& cx, CtorDispatcher, detail::PreferredOverload)
: Rooted(cx, T(cx)) {} : Rooted(cx, T(cx)) {}

View file

@ -94,6 +94,6 @@ extern JS_FRIEND_API void SetSourceHook(JSContext* cx,
extern JS_FRIEND_API mozilla::UniquePtr<SourceHook> ForgetSourceHook( extern JS_FRIEND_API mozilla::UniquePtr<SourceHook> ForgetSourceHook(
JSContext* cx); JSContext* cx);
} // namespace js } // namespace js
#endif // js_experimental_SourceHook_h #endif // js_experimental_SourceHook_h

View file

@ -554,23 +554,25 @@ const jsid* SliceRootedIdVector(const JS::PersistentRootedIdVector* v,
void DestroyRootedIdVector(JS::PersistentRootedIdVector* v) { delete v; } void DestroyRootedIdVector(JS::PersistentRootedIdVector* v) { delete v; }
JS::MutableHandleIdVector GetMutableHandleIdVector( JS::MutableHandleIdVector GetMutableHandleIdVector(JS::PersistentRootedIdVector* v) {
JS::PersistentRootedIdVector* v) {
return JS::MutableHandleIdVector(v); return JS::MutableHandleIdVector(v);
} }
JS::PersistentRootedObjectVector* CreateRootedObjectVector(JSContext* aCx) { JS::PersistentRootedObjectVector* CreateRootedObjectVector(
JSContext* aCx) {
JS::PersistentRootedObjectVector* vec = JS::PersistentRootedObjectVector* vec =
new JS::PersistentRootedObjectVector(aCx); new JS::PersistentRootedObjectVector(aCx);
return vec; return vec;
} }
bool AppendToRootedObjectVector(JS::PersistentRootedObjectVector* v, bool AppendToRootedObjectVector(JS::PersistentRootedObjectVector* v,
JSObject* obj) { JSObject* obj) {
return v->append(obj); return v->append(obj);
} }
void DeleteRootedObjectVector(JS::PersistentRootedObjectVector* v) { delete v; } void DeleteRootedObjectVector(JS::PersistentRootedObjectVector* v) {
delete v;
}
#if defined(__linux__) #if defined(__linux__)
# include <malloc.h> # include <malloc.h>

View file

@ -162,7 +162,7 @@ struct ArrayOps<int64_t> {
} }
static JS::Result<int64_t> convertValue(JSContext* cx, HandleValue v, static JS::Result<int64_t> convertValue(JSContext* cx, HandleValue v,
MutableHandleValue result) { MutableHandleValue result) {
BigInt* bi = ToBigInt(cx, v); BigInt* bi = ToBigInt(cx, v);
if (!bi) { if (!bi) {
return cx->alreadyReportedError(); return cx->alreadyReportedError();
@ -193,7 +193,7 @@ struct ArrayOps<uint64_t> {
} }
static JS::Result<uint64_t> convertValue(JSContext* cx, HandleValue v, static JS::Result<uint64_t> convertValue(JSContext* cx, HandleValue v,
MutableHandleValue result) { MutableHandleValue result) {
BigInt* bi = ToBigInt(cx, v); BigInt* bi = ToBigInt(cx, v);
if (!bi) { if (!bi) {
return cx->alreadyReportedError(); return cx->alreadyReportedError();

View file

@ -1057,8 +1057,9 @@ bool ModuleObject::execute(JSContext* cx, HandleModuleObject self,
// The top-level script if a module is only ever executed once. Clear the // The top-level script if a module is only ever executed once. Clear the
// reference at exit to prevent us keeping this alive unnecessarily. This is // reference at exit to prevent us keeping this alive unnecessarily. This is
// kept while executing so it is available to the debugger. // kept while executing so it is available to the debugger.
auto guardA = mozilla::MakeScopeExit( auto guardA = mozilla::MakeScopeExit([&] {
[&] { self->setReservedSlot(ScriptSlot, UndefinedValue()); }); self->setReservedSlot(ScriptSlot, UndefinedValue());
});
RootedModuleEnvironmentObject scope(cx, self->environment()); RootedModuleEnvironmentObject scope(cx, self->environment());
if (!scope) { if (!scope) {

View file

@ -2650,8 +2650,8 @@ bool ASTSerializer::expression(ParseNode* pn, MutableHandleValue dst) {
switch (pn->getKind()) { switch (pn->getKind()) {
case ParseNodeKind::Function: { case ParseNodeKind::Function: {
FunctionNode* funNode = &pn->as<FunctionNode>(); FunctionNode* funNode = &pn->as<FunctionNode>();
ASTType type = ASTType type = funNode->funbox()->isArrow() ? AST_ARROW_EXPR
funNode->funbox()->isArrow() ? AST_ARROW_EXPR : AST_FUNC_EXPR; : AST_FUNC_EXPR;
return function(funNode, type, dst); return function(funNode, type, dst);
} }
@ -3144,9 +3144,9 @@ bool ASTSerializer::property(ParseNode* pn, MutableHandleValue dst) {
ParseNode* valNode = node->right(); ParseNode* valNode = node->right();
bool isShorthand = node->isKind(ParseNodeKind::Shorthand); bool isShorthand = node->isKind(ParseNodeKind::Shorthand);
bool isMethod = bool isMethod = valNode->is<FunctionNode>() &&
valNode->is<FunctionNode>() && valNode->as<FunctionNode>().funbox()->kind() ==
valNode->as<FunctionNode>().funbox()->kind() == JSFunction::Method; JSFunction::Method;
RootedValue key(cx), val(cx); RootedValue key(cx), val(cx);
return propertyName(keyNode, &key) && expression(valNode, &val) && return propertyName(keyNode, &key) && expression(valNode, &val) &&
builder.propertyInitializer(key, val, kind, isShorthand, isMethod, builder.propertyInitializer(key, val, kind, isShorthand, isMethod,

View file

@ -3484,7 +3484,9 @@ class MOZ_RAII AutoClearUnderlyingSource {
} }
} }
void reset() { controller_ = nullptr; } void reset() {
controller_ = nullptr;
}
}; };
/** /**

View file

@ -3227,7 +3227,8 @@ JS::Result<Ok> BinASTParser<Tok>::parseInterfaceFunctionExpressionContents(
// Per spec, isFunctionNameCaptured can be true for anonymous // Per spec, isFunctionNameCaptured can be true for anonymous
// function. Check isFunctionNameCaptured only for named // function. Check isFunctionNameCaptured only for named
// function. // function.
if (pc_->functionBox()->isNamedLambda() && isFunctionNameCaptured) { if (pc_->functionBox()->isNamedLambda() &&
isFunctionNameCaptured) {
captureFunctionName(); captureFunctionName();
} }
BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool(fieldContext++)); BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool(fieldContext++));

View file

@ -275,7 +275,7 @@ JS::Result<FunctionBox*> BinASTParserPerTokenizer<Tok>::buildFunctionBox(
traceListHead_ = funbox; traceListHead_ = funbox;
if (pc_) { if (pc_) {
funbox->initWithEnclosingParseContext(pc_, fun, syntax); funbox->initWithEnclosingParseContext(pc_, fun,syntax);
} else { } else {
funbox->initFromLazyFunction(fun); funbox->initFromLazyFunction(fun);
} }

View file

@ -104,6 +104,7 @@ struct CGResumeOffsetList {
void finish(mozilla::Span<uint32_t> array); void finish(mozilla::Span<uint32_t> array);
}; };
static constexpr size_t MaxBytecodeLength = INT32_MAX; static constexpr size_t MaxBytecodeLength = INT32_MAX;
static constexpr size_t MaxSrcNotesLength = INT32_MAX; static constexpr size_t MaxSrcNotesLength = INT32_MAX;

View file

@ -475,7 +475,8 @@ bool FunctionScriptEmitter::prepareForBody() {
} }
} }
if (funbox_->kind() == JSFunction::FunctionKind::ClassConstructor) { if (funbox_->kind() ==
JSFunction::FunctionKind::ClassConstructor) {
if (!funbox_->isDerivedClassConstructor()) { if (!funbox_->isDerivedClassConstructor()) {
if (!bce_->emitInitializeInstanceFields()) { if (!bce_->emitInitializeInstanceFields()) {
// [stack] // [stack]

View file

@ -296,7 +296,8 @@ bool ParseContext::annexBAppliesToLexicalFunctionInInnermostScope(
FunctionBox* funbox) { FunctionBox* funbox) {
MOZ_ASSERT(!sc()->strict()); MOZ_ASSERT(!sc()->strict());
RootedPropertyName name(sc()->cx_, funbox->explicitName()->asPropertyName()); RootedPropertyName name(sc()->cx_,
funbox->explicitName()->asPropertyName());
Maybe<DeclarationKind> redeclaredKind = isVarRedeclaredInInnermostScope( Maybe<DeclarationKind> redeclaredKind = isVarRedeclaredInInnermostScope(
name, DeclarationKind::VarForAnnexBLexicalFunction); name, DeclarationKind::VarForAnnexBLexicalFunction);

View file

@ -623,8 +623,9 @@ class ParseContext : public Nestable<ParseContext> {
} }
bool isGetterOrSetter() const { bool isGetterOrSetter() const {
return sc_->isFunctionBox() && (sc_->asFunctionBox()->isGetter() || return sc_->isFunctionBox() &&
sc_->asFunctionBox()->isSetter()); (sc_->asFunctionBox()->isGetter() ||
sc_->asFunctionBox()->isSetter());
} }
uint32_t scriptId() const { return scriptId_; } uint32_t scriptId() const { return scriptId_; }

View file

@ -163,7 +163,8 @@ FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
isSetter_(fun->isSetter()), isSetter_(fun->isSetter()),
isMethod_(fun->isMethod()), isMethod_(fun->isMethod()),
kind_(fun->kind()), kind_(fun->kind()),
explicitName_(fun->explicitName()) { explicitName_(fun->explicitName())
{
// Functions created at parse time may be set singleton after parsing and // Functions created at parse time may be set singleton after parsing and
// baked into JIT code, so they must be allocated tenured. They are held by // baked into JIT code, so they must be allocated tenured. They are held by
// the JSScript so cannot be collected during a minor GC anyway. // the JSScript so cannot be collected during a minor GC anyway.
@ -194,8 +195,7 @@ void FunctionBox::initStandaloneFunction(Scope* enclosingScope) {
thisBinding_ = ThisBinding::Function; thisBinding_ = ThisBinding::Function;
} }
void FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing, void FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun,
JSFunction* fun,
FunctionSyntaxKind kind) { FunctionSyntaxKind kind) {
SharedContext* sc = enclosing->sc(); SharedContext* sc = enclosing->sc();
useAsm = sc->isFunctionBox() && sc->asFunctionBox()->useAsmOrInsideUseAsm(); useAsm = sc->isFunctionBox() && sc->asFunctionBox()->useAsmOrInsideUseAsm();

View file

@ -435,8 +435,7 @@ class FunctionBox : public ObjectBox, public SharedContext {
void initStandaloneFunction(Scope* enclosingScope); void initStandaloneFunction(Scope* enclosingScope);
void initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun, void initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun,
FunctionSyntaxKind kind); FunctionSyntaxKind kind);
void initFieldInitializer(ParseContext* enclosing, JSFunction* fun, void initFieldInitializer(ParseContext* enclosing, JSFunction* fun, HasHeritage hasHeritage);
HasHeritage hasHeritage);
inline bool isLazyFunctionWithoutEnclosingScope() const { inline bool isLazyFunctionWithoutEnclosingScope() const {
return function()->isInterpretedLazy() && return function()->isInterpretedLazy() &&

View file

@ -425,8 +425,9 @@ class MOZ_NON_MEMMOVABLE BarrieredBase {
// Base class for barriered pointer types that intercept only writes. // Base class for barriered pointer types that intercept only writes.
template <class T> template <class T>
class WriteBarriered : public BarrieredBase<T>, class WriteBarriered
public WrappedPtrOperations<T, WriteBarriered<T>> { : public BarrieredBase<T>,
public WrappedPtrOperations<T, WriteBarriered<T>> {
protected: protected:
using BarrieredBase<T>::value; using BarrieredBase<T>::value;

View file

@ -42,6 +42,6 @@ inline void FreeOp::freeLater(void* p) {
} }
} }
} // namespace js } // namespace js
#endif // gc_FreeOp_inl_h #endif // gc_FreeOp_inl_h

View file

@ -110,7 +110,10 @@ class ArenaCellIter {
traceKind(JS::TraceKind::Null), traceKind(JS::TraceKind::Null),
initialized(false) {} initialized(false) {}
explicit ArenaCellIter(Arena* arena) : initialized(false) { init(arena); } explicit ArenaCellIter(Arena* arena)
: initialized(false) {
init(arena);
}
void init(Arena* arena) { void init(Arena* arena) {
MOZ_ASSERT(!initialized); MOZ_ASSERT(!initialized);
@ -392,7 +395,9 @@ class ZoneCellIter : protected ZoneAllCellIter<T> {
return cell; return cell;
} }
T* get() const { return reinterpret_cast<T*>(getCell()); } T* get() const {
return reinterpret_cast<T*>(getCell());
}
TenuredCell* unbarrieredGetCell() const { return Base::getCell(); } TenuredCell* unbarrieredGetCell() const { return Base::getCell(); }
T* unbarrieredGet() const { return Base::get(); } T* unbarrieredGet() const { return Base::get(); }

View file

@ -441,9 +441,9 @@ FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(INSTANTIATE_PUBLIC_TRACE_FUNCTIONS)
namespace js { namespace js {
namespace gc { namespace gc {
#define INSTANTIATE_INTERNAL_TRACE_FUNCTIONS(type) \ #define INSTANTIATE_INTERNAL_TRACE_FUNCTIONS(type) \
template void TraceEdgeInternal<type>(JSTracer*, type*, const char*); \ template void TraceEdgeInternal<type>(JSTracer*, type*, const char*); \
template void TraceRangeInternal<type>(JSTracer*, size_t len, type*, \ template void TraceRangeInternal<type>(JSTracer*, size_t len, type*, \
const char*); const char*);
#define INSTANTIATE_INTERNAL_TRACE_FUNCTIONS_FROM_TRACEKIND(_1, type, _2, _3) \ #define INSTANTIATE_INTERNAL_TRACE_FUNCTIONS_FROM_TRACEKIND(_1, type, _2, _3) \
@ -738,10 +738,10 @@ JS_PUBLIC_API void js::gc::PerformIncrementalReadBarrier(JS::GCCellPtr thing) {
// Mark the argument, as DoMarking above. // Mark the argument, as DoMarking above.
ApplyGCThingTyped(thing, [gcmarker](auto thing) { ApplyGCThingTyped(thing, [gcmarker](auto thing) {
MOZ_ASSERT(ShouldMark(gcmarker, thing)); MOZ_ASSERT(ShouldMark(gcmarker, thing));
CheckTracedThing(gcmarker, thing); CheckTracedThing(gcmarker, thing);
gcmarker->traverse(thing); gcmarker->traverse(thing);
}); });
} }
// The simplest traversal calls out to the fully generic traceChildren function // The simplest traversal calls out to the fully generic traceChildren function
@ -3104,7 +3104,8 @@ size_t js::TenuringTracer::moveStringToTenured(JSString* dst, JSString* src,
} }
if (dst->isFlat() && !dst->isInline()) { if (dst->isFlat() && !dst->isInline()) {
AddCellMemory(dst, dst->asFlat().allocSize(), MemoryUse::StringContents); AddCellMemory(dst, dst->asFlat().allocSize(),
MemoryUse::StringContents);
} }
return size; return size;

View file

@ -22,7 +22,8 @@ namespace detail {
template <typename T> template <typename T>
class UnsafeBareWeakHeapPtr : public ReadBarriered<T> { class UnsafeBareWeakHeapPtr : public ReadBarriered<T> {
public: public:
UnsafeBareWeakHeapPtr() : ReadBarriered<T>(JS::SafelyInitialized<T>()) {} UnsafeBareWeakHeapPtr()
: ReadBarriered<T>(JS::SafelyInitialized<T>()) {}
MOZ_IMPLICIT UnsafeBareWeakHeapPtr(const T& v) : ReadBarriered<T>(v) {} MOZ_IMPLICIT UnsafeBareWeakHeapPtr(const T& v) : ReadBarriered<T>(v) {}
explicit UnsafeBareWeakHeapPtr(const UnsafeBareWeakHeapPtr& v) explicit UnsafeBareWeakHeapPtr(const UnsafeBareWeakHeapPtr& v)
: ReadBarriered<T>(v) {} : ReadBarriered<T>(v) {}
@ -180,7 +181,8 @@ class NurseryAwareHashMap {
namespace JS { namespace JS {
template <typename T> template <typename T>
struct GCPolicy<js::detail::UnsafeBareWeakHeapPtr<T>> { struct GCPolicy<js::detail::UnsafeBareWeakHeapPtr<T>> {
static void trace(JSTracer* trc, js::detail::UnsafeBareWeakHeapPtr<T>* thingp, static void trace(JSTracer* trc,
js::detail::UnsafeBareWeakHeapPtr<T>* thingp,
const char* name) { const char* name) {
js::TraceEdge(trc, thingp, name); js::TraceEdge(trc, thingp, name);
} }

View file

@ -20,14 +20,16 @@ namespace gc {
class ArenaCellIterUnderGC : public ArenaCellIter { class ArenaCellIterUnderGC : public ArenaCellIter {
public: public:
explicit ArenaCellIterUnderGC(Arena* arena) : ArenaCellIter(arena) { explicit ArenaCellIterUnderGC(Arena* arena)
: ArenaCellIter(arena) {
MOZ_ASSERT(CurrentThreadIsPerformingGC()); MOZ_ASSERT(CurrentThreadIsPerformingGC());
} }
}; };
class ArenaCellIterUnderFinalize : public ArenaCellIter { class ArenaCellIterUnderFinalize : public ArenaCellIter {
public: public:
explicit ArenaCellIterUnderFinalize(Arena* arena) : ArenaCellIter(arena) { explicit ArenaCellIterUnderFinalize(Arena* arena)
: ArenaCellIter(arena) {
MOZ_ASSERT(CurrentThreadIsGCSweeping()); MOZ_ASSERT(CurrentThreadIsGCSweeping());
} }
}; };

View file

@ -314,12 +314,12 @@
namespace js { namespace js {
#define JS_FOR_EACH_INTERNAL_MEMORY_USE(_) \ #define JS_FOR_EACH_INTERNAL_MEMORY_USE(_) \
_(ArrayBufferContents) \ _(ArrayBufferContents) \
_(StringContents) _(StringContents)
#define JS_FOR_EACH_MEMORY_USE(_) \ #define JS_FOR_EACH_MEMORY_USE(_) \
JS_FOR_EACH_PUBLIC_MEMORY_USE(_) \ JS_FOR_EACH_PUBLIC_MEMORY_USE(_) \
JS_FOR_EACH_INTERNAL_MEMORY_USE(_) JS_FOR_EACH_INTERNAL_MEMORY_USE(_)
enum class MemoryUse : uint8_t { enum class MemoryUse : uint8_t {

View file

@ -126,7 +126,8 @@ inline void TraceEdge(JSTracer* trc, WriteBarriered<T>* thingp,
} }
template <typename T> template <typename T>
inline void TraceEdge(JSTracer* trc, WeakHeapPtr<T>* thingp, const char* name) { inline void TraceEdge(JSTracer* trc, WeakHeapPtr<T>* thingp,
const char* name) {
gc::TraceEdgeInternal(trc, gc::ConvertToBase(thingp->unsafeGet()), name); gc::TraceEdgeInternal(trc, gc::ConvertToBase(thingp->unsafeGet()), name);
} }
@ -160,7 +161,8 @@ inline void TraceRoot(JSTracer* trc, T* thingp, const char* name) {
} }
template <typename T> template <typename T>
inline void TraceRoot(JSTracer* trc, WeakHeapPtr<T>* thingp, const char* name) { inline void TraceRoot(JSTracer* trc, WeakHeapPtr<T>* thingp,
const char* name) {
TraceRoot(trc, thingp->unsafeGet(), name); TraceRoot(trc, thingp->unsafeGet(), name);
} }
@ -211,7 +213,8 @@ void TraceRootRange(JSTracer* trc, size_t len, T* vec, const char* name) {
// Trace an edge that crosses compartment boundaries. If the compartment of the // Trace an edge that crosses compartment boundaries. If the compartment of the
// destination thing is not being GC'd, then the edge will not be traced. // destination thing is not being GC'd, then the edge will not be traced.
void TraceCrossCompartmentEdge(JSTracer* trc, JSObject* src, void TraceCrossCompartmentEdge(JSTracer* trc, JSObject* src,
WriteBarriered<Value>* dst, const char* name); WriteBarriered<Value>* dst,
const char* name);
// As above but with manual barriers. // As above but with manual barriers.
template <typename T> template <typename T>

View file

@ -24,11 +24,13 @@ enum class CellColor : uint8_t {
Black = uint8_t(MarkColor::Black) Black = uint8_t(MarkColor::Black)
}; };
static constexpr CellColor AllCellColors[] = {CellColor::White, CellColor::Gray, static constexpr CellColor AllCellColors[] = {
CellColor::Black}; CellColor::White, CellColor::Gray, CellColor::Black
};
static constexpr CellColor MarkedCellColors[] = {CellColor::Gray, static constexpr CellColor MarkedCellColors[] = {
CellColor::Black}; CellColor::Gray, CellColor::Black
};
inline CellColor GetCellColor(Cell* cell) { inline CellColor GetCellColor(Cell* cell) {
if (cell->isMarkedBlack()) { if (cell->isMarkedBlack()) {
@ -57,7 +59,7 @@ inline CellColor ExpectedKeyAndDelegateColor(CellColor keyColor,
return Max(keyColor, delegateColor); return Max(keyColor, delegateColor);
} }
} // namespace gc } // namespace gc
} // namespace js } // namespace js
#endif /* gc_Verifier_h */ #endif /* gc_Verifier_h */

View file

@ -30,7 +30,9 @@ void MacroAssembler::move16SignExtend(Register src, Register dest) {
ma_seh(dest, src); ma_seh(dest, src);
} }
void MacroAssembler::loadAbiReturnAddress(Register dest) { movePtr(ra, dest); } void MacroAssembler::loadAbiReturnAddress(Register dest) {
movePtr(ra, dest);
}
// =============================================================== // ===============================================================
// Logical instructions // Logical instructions

View file

@ -162,14 +162,15 @@ enum MarkKeyOrDelegate : bool { MarkKey = true, MarkDelegate = false };
bool TestJSWeakMaps() { bool TestJSWeakMaps() {
for (auto keyOrDelegateColor : MarkedCellColors) { for (auto keyOrDelegateColor : MarkedCellColors) {
for (auto mapColor : MarkedCellColors) { for (auto mapColor : MarkedCellColors) {
for (auto markKeyOrDelegate : {MarkKey, MarkDelegate}) { for (auto markKeyOrDelegate : { MarkKey, MarkDelegate }) {
CellColor expected = CellColor expected = ExpectedWeakMapValueColor(keyOrDelegateColor,
ExpectedWeakMapValueColor(keyOrDelegateColor, mapColor); mapColor);
CHECK(TestJSWeakMap(markKeyOrDelegate, keyOrDelegateColor, mapColor, CHECK(TestJSWeakMap(markKeyOrDelegate, keyOrDelegateColor, mapColor,
expected)); expected));
#ifdef JS_GC_ZEAL #ifdef JS_GC_ZEAL
CHECK(TestJSWeakMapWithGrayUnmarking( CHECK(TestJSWeakMapWithGrayUnmarking(markKeyOrDelegate,
markKeyOrDelegate, keyOrDelegateColor, mapColor, expected)); keyOrDelegateColor, mapColor,
expected));
#endif #endif
} }
} }
@ -188,13 +189,14 @@ bool TestInternalWeakMaps() {
CellColor keyOrDelegateColor = CellColor keyOrDelegateColor =
ExpectedKeyAndDelegateColor(keyMarkColor, delegateMarkColor); ExpectedKeyAndDelegateColor(keyMarkColor, delegateMarkColor);
CellColor expected = CellColor expected = ExpectedWeakMapValueColor(keyOrDelegateColor,
ExpectedWeakMapValueColor(keyOrDelegateColor, CellColor::Black); CellColor::Black);
CHECK(TestInternalWeakMap(keyMarkColor, delegateMarkColor, expected)); CHECK(TestInternalWeakMap(keyMarkColor, delegateMarkColor, expected));
#ifdef JS_GC_ZEAL #ifdef JS_GC_ZEAL
CHECK(TestInternalWeakMapWithGrayUnmarking(keyMarkColor, CHECK(TestInternalWeakMapWithGrayUnmarking(keyMarkColor,
delegateMarkColor, expected)); delegateMarkColor,
expected));
#endif #endif
} }
} }
@ -308,11 +310,11 @@ bool TestJSWeakMapWithGrayUnmarking(MarkKeyOrDelegate markKey,
static void MaybeExposeObject(JSObject* object, CellColor color) { static void MaybeExposeObject(JSObject* object, CellColor color) {
if (color == CellColor::Black) { if (color == CellColor::Black) {
JS::ExposeObjectToActiveJS(object); JS::ExposeObjectToActiveJS(object);
} }
} }
#endif // JS_GC_ZEAL #endif // JS_GC_ZEAL
bool CreateJSWeakMapObjects(JSObject** weakMapOut, JSObject** keyOut, bool CreateJSWeakMapObjects(JSObject** weakMapOut, JSObject** keyOut,
JSObject** valueOut) { JSObject** valueOut) {
@ -431,7 +433,7 @@ bool TestInternalWeakMapWithGrayUnmarking(CellColor keyMarkColor,
return true; return true;
} }
#endif // JS_GC_ZEAL #endif // JS_GC_ZEAL
bool CreateInternalWeakMapObjects(UniquePtr<GCManagedObjectWeakMap>* weakMapOut, bool CreateInternalWeakMapObjects(UniquePtr<GCManagedObjectWeakMap>* weakMapOut,
JSObject** keyOut, JSObject** valueOut) { JSObject** keyOut, JSObject** valueOut) {

View file

@ -8,7 +8,7 @@
#include "mozilla/Utf8.h" // mozilla::Utf8Unit #include "mozilla/Utf8.h" // mozilla::Utf8Unit
#include "js/CompilationAndEvaluation.h" // JS::Compile{,{,Utf8{File,Path}}DontInflate} #include "js/CompilationAndEvaluation.h" // JS::Compile{,{,Utf8{File,Path}}DontInflate}
#include "js/SourceText.h" // JS::Source{Ownership,Text} #include "js/SourceText.h" // JS::Source{Ownership,Text}
#include "jsapi-tests/tests.h" #include "jsapi-tests/tests.h"
struct ScriptObjectFixture : public JSAPITest { struct ScriptObjectFixture : public JSAPITest {

View file

@ -956,7 +956,8 @@ void ArrayBufferObject::releaseData(FreeOp* fop) {
break; break;
case MAPPED: case MAPPED:
gc::DeallocateMappedContent(dataPointer(), byteLength()); gc::DeallocateMappedContent(dataPointer(), byteLength());
RemoveCellMemory(this, associatedBytes(), MemoryUse::ArrayBufferContents); RemoveCellMemory(this, associatedBytes(),
MemoryUse::ArrayBufferContents);
break; break;
case WASM: case WASM:
WasmArrayRawBuffer::Release(dataPointer()); WasmArrayRawBuffer::Release(dataPointer());

View file

@ -46,8 +46,8 @@ struct AtomHasher {
const Lookup& lookup); const Lookup& lookup);
}; };
using AtomSet = using AtomSet = JS::GCHashSet<WeakHeapPtr<JSAtom*>, AtomHasher,
JS::GCHashSet<WeakHeapPtr<JSAtom*>, AtomHasher, SystemAllocPolicy>; SystemAllocPolicy>;
// This class is a wrapper for AtomSet that is used to ensure the AtomSet is // This class is a wrapper for AtomSet that is used to ensure the AtomSet is
// not modified. It should only expose read-only methods from AtomSet. // not modified. It should only expose read-only methods from AtomSet.

View file

@ -563,9 +563,8 @@ JS_PUBLIC_API bool JS::Evaluate(JSContext* cx,
size_t length = srcBuf.length(); size_t length = srcBuf.length();
auto chars = UniqueTwoByteChars( auto chars = UniqueTwoByteChars(
UTF8CharsToNewTwoByteCharsZ(cx, UTF8Chars(srcBuf.get(), length), &length, UTF8CharsToNewTwoByteCharsZ(cx, UTF8Chars(srcBuf.get(), length),
js::MallocArena) &length, js::MallocArena).get());
.get());
if (!chars) { if (!chars) {
return false; return false;
} }

View file

@ -56,8 +56,8 @@
return slowPathCheckNoExecute(cx, script); return slowPathCheckNoExecute(cx, script);
} }
/* static */ inline js::ResumeMode js::Debugger::onEnterFrame( /* static */ inline js::ResumeMode js::Debugger::onEnterFrame(JSContext* cx,
JSContext* cx, AbstractFramePtr frame) { AbstractFramePtr frame) {
MOZ_ASSERT_IF(frame.hasScript() && frame.script()->isDebuggee(), MOZ_ASSERT_IF(frame.hasScript() && frame.script()->isDebuggee(),
frame.isDebuggee()); frame.isDebuggee());
if (!frame.isDebuggee()) { if (!frame.isDebuggee()) {
@ -99,8 +99,8 @@
} }
} }
/* static */ inline void js::Debugger::onNewPromise( /* static */ inline void js::Debugger::onNewPromise(JSContext* cx,
JSContext* cx, Handle<PromiseObject*> promise) { Handle<PromiseObject*> promise) {
if (MOZ_UNLIKELY(cx->realm()->isDebuggee())) { if (MOZ_UNLIKELY(cx->realm()->isDebuggee())) {
slowPathPromiseHook(cx, Debugger::OnNewPromise, promise); slowPathPromiseHook(cx, Debugger::OnNewPromise, promise);
} }

View file

@ -1787,8 +1787,7 @@ class DebugEnvironmentProxyHandler : public BaseProxyHandler {
return env.as<CallObject>().callee().nonLazyScript()->bodyScope(); return env.as<CallObject>().callee().nonLazyScript()->bodyScope();
} }
if (env.is<ModuleEnvironmentObject>()) { if (env.is<ModuleEnvironmentObject>()) {
JSScript* script = JSScript* script = env.as<ModuleEnvironmentObject>().module().maybeScript();
env.as<ModuleEnvironmentObject>().module().maybeScript();
return script ? script->bodyScope() : nullptr; return script ? script->bodyScope() : nullptr;
} }
if (isNonExtensibleLexicalEnvironment(env)) { if (isNonExtensibleLexicalEnvironment(env)) {

View file

@ -964,7 +964,8 @@ class DebugEnvironments {
* environments. * environments.
*/ */
typedef GCHashMap<WeakHeapPtr<JSObject*>, LiveEnvironmentVal, typedef GCHashMap<WeakHeapPtr<JSObject*>, LiveEnvironmentVal,
MovableCellHasher<WeakHeapPtr<JSObject*>>, ZoneAllocPolicy> MovableCellHasher<WeakHeapPtr<JSObject*>>,
ZoneAllocPolicy>
LiveEnvironmentMap; LiveEnvironmentMap;
LiveEnvironmentMap liveEnvs; LiveEnvironmentMap liveEnvs;

View file

@ -132,8 +132,7 @@ class AbstractGeneratorObject : public NativeObject {
// Note: also update Baseline's IsSuspendedGenerator code if this // Note: also update Baseline's IsSuspendedGenerator code if this
// changes. // changes.
Value resumeIndex = getFixedSlot(RESUME_INDEX_SLOT); Value resumeIndex = getFixedSlot(RESUME_INDEX_SLOT);
return resumeIndex.isInt32() && return resumeIndex.isInt32() && resumeIndex.toInt32() < RESUME_INDEX_RUNNING;
resumeIndex.toInt32() < RESUME_INDEX_RUNNING;
} }
void setRunning() { void setRunning() {
MOZ_ASSERT(isSuspended()); MOZ_ASSERT(isSuspended());

View file

@ -84,7 +84,7 @@ class ModuleSharedContext;
namespace gc { namespace gc {
void SweepLazyScripts(GCParallelTask* task); void SweepLazyScripts(GCParallelTask* task);
} // namespace gc } // namespace gc
namespace detail { namespace detail {

View file

@ -535,7 +535,9 @@ struct JSRuntime : public js::MallocProvider<JSRuntime> {
void incrementNumDebuggeeRealms(); void incrementNumDebuggeeRealms();
void decrementNumDebuggeeRealms(); void decrementNumDebuggeeRealms();
size_t numDebuggeeRealms() const { return numDebuggeeRealms_; } size_t numDebuggeeRealms() const {
return numDebuggeeRealms_;
}
void incrementNumDebuggeeRealmsObservingCoverage(); void incrementNumDebuggeeRealmsObservingCoverage();
void decrementNumDebuggeeRealmsObservingCoverage(); void decrementNumDebuggeeRealmsObservingCoverage();

View file

@ -106,7 +106,8 @@ class SavedFrame : public NativeObject {
struct Lookup; struct Lookup;
struct HashPolicy; struct HashPolicy;
typedef JS::GCHashSet<WeakHeapPtr<SavedFrame*>, HashPolicy, SystemAllocPolicy> typedef JS::GCHashSet<WeakHeapPtr<SavedFrame*>, HashPolicy,
SystemAllocPolicy>
Set; Set;
private: private:

View file

@ -1095,9 +1095,8 @@ static bool AssignProperty(JSContext* cx, HandleObject dst, HandleObject src,
JS_DefineProperty(cx, dst, property, v, JSPROP_ENUMERATE); JS_DefineProperty(cx, dst, property, v, JSPROP_ENUMERATE);
} }
JS_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject( JS_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject
JSContext* cx, HandleObject savedFrameArg, (JSContext* cx, HandleObject savedFrameArg, SavedFrameSelfHosted selfHosted) {
SavedFrameSelfHosted selfHosted) {
MOZ_ASSERT(savedFrameArg); MOZ_ASSERT(savedFrameArg);
RootedObject savedFrame(cx, savedFrameArg); RootedObject savedFrame(cx, savedFrameArg);
@ -1120,7 +1119,7 @@ JS_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject(
return nullptr; return nullptr;
} }
const char* parentProperties[] = {"parent", "asyncParent"}; const char* parentProperties[] = { "parent", "asyncParent" };
foundParent = false; foundParent = false;
for (const char* prop : parentProperties) { for (const char* prop : parentProperties) {
if (!JS_GetProperty(cx, savedFrame, prop, &v)) { if (!JS_GetProperty(cx, savedFrame, prop, &v)) {

View file

@ -896,8 +896,8 @@ struct DefaultHasher<jsid> {
namespace js { namespace js {
using BaseShapeSet = using BaseShapeSet =
JS::WeakCache<JS::GCHashSet<WeakHeapPtr<UnownedBaseShape*>, StackBaseShape, JS::WeakCache<JS::GCHashSet<WeakHeapPtr<UnownedBaseShape*>,
SystemAllocPolicy>>; StackBaseShape, SystemAllocPolicy>>;
class Shape : public gc::TenuredCell { class Shape : public gc::TenuredCell {
friend class ::JSObject; friend class ::JSObject;

View file

@ -437,8 +437,8 @@ inline void JSFlatString::finalize(js::FreeOp* fop) {
inline size_t JSFlatString::allocSize() const { inline size_t JSFlatString::allocSize() const {
MOZ_ASSERT(!isInline()); MOZ_ASSERT(!isInline());
size_t charSize = size_t charSize = hasLatin1Chars() ? sizeof(JS::Latin1Char)
hasLatin1Chars() ? sizeof(JS::Latin1Char) : sizeof(char16_t); : sizeof(char16_t);
size_t count = isExtensible() ? asExtensible().capacity() : length(); size_t count = isExtensible() ? asExtensible().capacity() : length();
return (count + 1) * charSize; return (count + 1) * charSize;
} }

Some files were not shown because too many files have changed in this diff Show more