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;
// Ordinal XUL textboxes don't support autocomplete.
if (!BindingOrWidgetParent() &&
Preferences::GetBool("browser.formfill.enable")) {
if (!BindingOrWidgetParent() && Preferences::GetBool("browser.formfill.enable")) {
// 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
// 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".
*/
nsIContent* BindingOrWidgetParent() const {
nsIContent* el = mContent->GetBindingParent();
nsIContent * el = mContent->GetBindingParent();
if (el) {
return el;
}

View File

@ -176,11 +176,11 @@ static mozilla::Maybe<bool> RunAsLauncherProcess(int& argc, wchar_t** argv) {
bool runAsLauncher = DoLauncherProcessChecks(argc, argv);
#if defined(MOZ_LAUNCHER_PROCESS)
bool forceLauncher =
runAsLauncher &&
mozilla::CheckArg(argc, argv, L"force-launcher",
static_cast<const wchar_t**>(nullptr),
mozilla::CheckArgFlag::RemoveArg) == mozilla::ARG_FOUND;
bool forceLauncher = runAsLauncher &&
mozilla::CheckArg(argc, argv, L"force-launcher",
static_cast<const wchar_t**>(nullptr),
mozilla::CheckArgFlag::RemoveArg) ==
mozilla::ARG_FOUND;
mozilla::LauncherRegistryInfo::ProcessType desiredType =
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() {}
ContentPrincipal::~ContentPrincipal() {
}
nsresult ContentPrincipal::Init(nsIURI* aCodebase,
const OriginAttributes& aOriginAttributes,

View File

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

View File

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

View File

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

View File

@ -280,7 +280,7 @@ void ResizeObserverEntry::SetContentRectAndSize(const nsSize& aSize) {
nsIFrame* frame = mTarget->GetPrimaryFrame();
// 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
// our contentRect.
nsRect rect(nsPoint(padding.left, padding.top), aSize);

View File

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

View File

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

View File

@ -59,8 +59,8 @@ UniquePtr<SerializedStackHolder> GetCurrentStackForNetMonitor(JSContext* aCx);
// thread. This call is synchronous, and aChannel and aStackHolder will not be
// used afterward. aChannel is an nsISupports object because this can be used
// with either nsIChannel or nsIWebSocketChannel.
void NotifyNetworkMonitorAlternateStack(
nsISupports* aChannel, UniquePtr<SerializedStackHolder> aStackHolder);
void NotifyNetworkMonitorAlternateStack(nsISupports* aChannel,
UniquePtr<SerializedStackHolder> aStackHolder);
// Read back the saved frame stack and store it in a string as JSON.
// 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++) {
TaskCategory category = static_cast<TaskCategory>(i);
if (category == TaskCategory::Worker) {
mEventTargets[i] = ThrottledEventQueue::Create(mEventTargets[i],
"TabGroup worker queue");
mEventTargets[i] =
ThrottledEventQueue::Create(mEventTargets[i],
"TabGroup worker queue");
} else if (category == TaskCategory::Timer) {
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;
bool defaultAction = true;
if (aCanRaise) {
DispatchEventOnlyToChrome(
target->OwnerDoc(), target, NS_LITERAL_STRING("framefocusrequested"),
CanBubble::eYes, Cancelable::eYes, &defaultAction);
DispatchEventOnlyToChrome(target->OwnerDoc(), target,
NS_LITERAL_STRING("framefocusrequested"),
CanBubble::eYes, Cancelable::eYes,
&defaultAction);
}
if (!defaultAction) {
return;

View File

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

View File

@ -617,20 +617,19 @@ nsresult nsDocumentEncoder::SerializeNodeStart(nsINode& aOriginalNode,
return rv;
}
Element* originalElement = aOriginalNode.AsElement();
rv = mSerializer->AppendElementStart(node->AsElement(), originalElement,
aStr);
rv = mSerializer->AppendElementStart(node->AsElement(), originalElement, aStr);
return rv;
}
switch (node->NodeType()) {
case nsINode::TEXT_NODE: {
rv = mSerializer->AppendText(static_cast<nsIContent*>(node), aStartOffset,
aEndOffset, aStr);
aEndOffset, aStr);
break;
}
case nsINode::CDATA_SECTION_NODE: {
rv = mSerializer->AppendCDATASection(static_cast<nsIContent*>(node),
aStartOffset, aEndOffset, aStr);
aStartOffset, aEndOffset, aStr);
break;
}
case nsINode::PROCESSING_INSTRUCTION_NODE: {
@ -641,7 +640,7 @@ nsresult nsDocumentEncoder::SerializeNodeStart(nsINode& aOriginalNode,
}
case nsINode::COMMENT_NODE: {
rv = mSerializer->AppendComment(static_cast<Comment*>(node), aStartOffset,
aEndOffset, aStr);
aEndOffset, aStr);
break;
}
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
// browsing context and use it when creating our new FrameLoader.
if (!aOptions.mReplaceBrowsingContext && !isChromeRemoteToLocal &&
mozilla::Preferences::GetBool("fission.preserve_browsing_contexts",
false)) {
mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", false)) {
bc = mFrameLoader->GetBrowsingContext();
mFrameLoader->SkipBrowsingContextDetach();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -66,7 +66,9 @@ struct GCPolicy<nsJSObjWrapper*> {
(*wrapper)->trace(trc);
}
static bool isValid(const nsJSObjWrapper*& wrapper) { return true; }
static bool isValid(const nsJSObjWrapper *&wrapper) {
return true;
}
};
} // 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
* 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
* one.
* case we need to update the existing OriginInfo rather than create a new one.
*/
void NoteOriginDirectoryCreated(PersistenceType aPersistenceType,
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
// the window's one.
if (!StorageUtils::PrincipalsEqual(
aEvent->GetPrincipal(), observer->GetEffectiveStoragePrincipal())) {
if (!StorageUtils::PrincipalsEqual(aEvent->GetPrincipal(),
observer->GetEffectiveStoragePrincipal())) {
continue;
}

View File

@ -165,11 +165,9 @@ class SVGPathData {
* which is generated by cbindgen from Rust (see ServoStyleConsts.h).
* Basically, this is a variant of the above BuildPath() functions.
*/
static already_AddRefed<Path> BuildPath(Span<const StylePathCommand> aPath,
PathBuilder* aBuilder,
uint8_t aStrokeLineCap,
Float aStrokeWidth,
float aZoomFactor = 1.0);
static already_AddRefed<Path> BuildPath(
Span<const StylePathCommand> aPath, PathBuilder* aBuilder,
uint8_t aStrokeLineCap, Float aStrokeWidth, float aZoomFactor = 1.0);
const_iterator begin() const { return mData.Elements(); }
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;
}
nsresult WebSocketImpl::AsyncOpen(
nsIPrincipal* aPrincipal, uint64_t aInnerWindowID,
nsITransportProvider* aTransportProvider,
const nsACString& aNegotiatedExtensions,
UniquePtr<SerializedStackHolder> aOriginStack) {
nsresult WebSocketImpl::AsyncOpen(nsIPrincipal* aPrincipal,
uint64_t aInnerWindowID,
nsITransportProvider* aTransportProvider,
const nsACString& aNegotiatedExtensions,
UniquePtr<SerializedStackHolder> aOriginStack) {
MOZ_ASSERT(NS_IsMainThread(), "Not running on main thread");
MOZ_ASSERT_IF(!aTransportProvider, aNegotiatedExtensions.IsEmpty());

View File

@ -72,7 +72,7 @@
#include "xpcpublic.h"
#if defined(XP_MACOSX)
# include "nsMacUtilsImpl.h"
# include "nsMacUtilsImpl.h"
#endif
#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
// monitor about every script we load.
if (mOriginStack) {
ConvertSerializedStackToJSON(std::move(mOriginStack), mOriginStackJSON);
ConvertSerializedStackToJSON(std::move(mOriginStack),
mOriginStackJSON);
}
if (!mWorkerPrivate->IsServiceWorker() || IsDebuggerScript()) {
@ -2124,8 +2125,8 @@ void LoadAllScripts(WorkerPrivate* aWorkerPrivate,
}
RefPtr<ScriptLoaderRunnable> loader = new ScriptLoaderRunnable(
aWorkerPrivate, std::move(aOriginStack), syncLoopTarget, aLoadInfos,
clientInfo, controller, aIsMainScript, aWorkerScriptType, aRv);
aWorkerPrivate, std::move(aOriginStack), syncLoopTarget, aLoadInfos, clientInfo,
controller, aIsMainScript, aWorkerScriptType, aRv);
NS_ASSERTION(aLoadInfos.IsEmpty(), "Should have swapped!");

View File

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

View File

@ -766,7 +766,9 @@ class WorkerPrivate : public RelativeTimeline {
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.
bool IsLoadingWorkerScript() const { return mLoadingWorkerScript; }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -76,7 +76,7 @@ class FontList {
* 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
* list is shared to content processes and used.
*
*
* Only used in the parent process.
*/
void SetFamilyNames(const nsTArray<Family::InitData>& aFamilies);
@ -182,12 +182,12 @@ class FontList {
* to use std::atomic<> for these.
*/
struct Header {
std::atomic<uint32_t> mAllocated; // Space allocated from this block;
// must be first field in Header
uint32_t mGeneration; // Font-list generation ID
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> mAliasCount; // Number of family aliases
std::atomic<uint32_t> mAllocated; // Space allocated from this block;
// must be first field in Header
uint32_t mGeneration; // Font-list generation ID
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> mAliasCount; // Number of family aliases
std::atomic<uint32_t> mLocalFaceCount; // Number of local face names
Pointer mFamilies; // Pointer to array of |mFamilyCount| families
Pointer mAliases; // Pointer to array of |mAliasCount| aliases
@ -254,9 +254,9 @@ class FontList {
}
RefPtr<mozilla::ipc::SharedMemoryBasic> mShmem;
void* mAddr; // Address where the shared memory block is mapped in this
// process; avoids virtual call to mShmem->memory() each time
// we need to convert between Pointer and a real C++ pointer.
void* mAddr; // Address where the shared memory block is mapped in this
// process; avoids virtual call to mShmem->memory() each time
// we need to convert between Pointer and a real C++ pointer.
};
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,
// bold, italic, and bold-italic face; in this case, they are stored at known
// 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) {
// Check if this can be treated as a "simple" family
isSimple = true;
@ -308,7 +308,7 @@ void Family::SearchAllFontsForChar(FontList* aList,
}
}
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);
for (uint32_t i = 0; i < numFaces; i++) {
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
// HasCharacter() will trigger loading the fontEntry's cmap, if
// needed).
RefPtr<gfxFontEntry> fe =
gfxPlatformFontList::PlatformFontList()->GetOrCreateFontEntry(face,
this);
RefPtr<gfxFontEntry> fe = gfxPlatformFontList::PlatformFontList()
->GetOrCreateFontEntry(face, this);
if (!fe) {
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
// accelerate font-matching.
bool isSimple = true;
Pointer slots[4] = {Pointer::Null(), Pointer::Null(), Pointer::Null(),
Pointer::Null()};
Pointer slots[4] = {
Pointer::Null(), Pointer::Null(), Pointer::Null(), Pointer::Null()
};
for (const Pointer& fp : aFaces) {
const Face* f = static_cast<const Face*>(fp.ToPtr(aList));
if (!f->mWeight.IsSingle() || !f->mStyle.IsSingle() ||
@ -438,7 +438,7 @@ void Family::SetupFamilyCharMap(FontList* aList) {
}
if (merged) {
mCharacterMap =
gfxPlatformFontList::PlatformFontList()->GetShmemCharMap(&familyMap);
gfxPlatformFontList::PlatformFontList()->GetShmemCharMap(&familyMap);
} else {
mCharacterMap = firstMapShmPointer;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -239,7 +239,7 @@ nsresult MacOSFontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
gfxPlatformFontList* pfl = gfxPlatformFontList::PlatformFontList();
fontlist::FontList* sharedFontList = pfl->SharedFontList();
if (!IsUserFont() && mShmemFace) {
mShmemFace->SetCharacterMap(sharedFontList, charmap); // async
mShmemFace->SetCharacterMap(sharedFontList, charmap); // async
if (!TrySetShmemCharacterMap()) {
// Temporarily retain charmap, until the shared version is
// ready for use.
@ -1763,7 +1763,8 @@ void gfxMacPlatformFontList::ActivateFontsFromDir(nsIFile* aDir) {
}
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;
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
// 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.
auto fe = MakeUnique<MacOSFontEntry>(name, WeightRange(FontWeight::Normal()), false, 16.0);
auto fe = MakeUnique<MacOSFontEntry>(name, WeightRange(FontWeight::Normal()),
false, 16.0);
if (!fe) {
continue;
}
@ -1870,8 +1872,8 @@ void gfxMacPlatformFontList::ReadFaceNamesForFamily(fontlist::Family* aFamily,
uint32_t dataLength;
const char* nameData = hb_blob_get_data(nameTable, &dataLength);
AutoTArray<nsCString, 4> otherFamilyNames;
gfxFontUtils::ReadOtherFamilyNamesForFace(canonicalName, nameData, dataLength, otherFamilyNames,
false);
gfxFontUtils::ReadOtherFamilyNamesForFace(canonicalName, nameData, dataLength,
otherFamilyNames, false);
for (const auto& alias : otherFamilyNames) {
auto af = mAliasTable.LookupOrAdd(alias);
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"
#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
#define BIDI_NUMERAL_PREF "bidi.numeral"

View File

@ -1756,8 +1756,8 @@ bool gfxPlatformFontList::LoadFontInfo() {
uint32_t i, endIndex = mNumFamilies;
fontlist::FontList* list = SharedFontList();
bool loadCmaps =
!list && (!UsesSystemFallback() ||
gfxPlatform::GetPlatform()->UseCmapsDuringSystemFallback());
!list && (!UsesSystemFallback() ||
gfxPlatform::GetPlatform()->UseCmapsDuringSystemFallback());
// for each font family, load in various font info
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(aReadbackFormat.isSome());
wr_renderer_readback(mRenderer, aReadbackSize.ref().width,
aReadbackSize.ref().height, aReadbackFormat.ref(),
aReadbackSize.ref().height,
aReadbackFormat.ref(),
&aReadbackBuffer.ref()[0],
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,
gfx::IntSize aSize, const gfx::SurfaceFormat& aFormat,
const Range<uint8_t>& aBuffer)
: mTask(aTask),
mStartTime(aStartTime),
mSize(aSize),
mFormat(aFormat),
: mTask(aTask), mStartTime(aStartTime), mSize(aSize), mFormat(aFormat),
mBuffer(aBuffer) {
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.
SuspendClipLeafMerging();
wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible,
&mCurrentSpaceAndClipChain, aShadow, aShouldInflate);
&mCurrentSpaceAndClipChain, aShadow,
aShouldInflate);
}
void DisplayListBuilder::PopAllShadows() {

View File

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

View File

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

View File

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

View File

@ -35,8 +35,7 @@ class AllocPolicyBase {
return js_pod_arena_calloc<T>(arenaId, numElems);
}
template <typename T>
T* maybe_pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize,
size_t newSize) {
T* maybe_pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, size_t newSize) {
return js_pod_arena_realloc<T>(arenaId, p, oldSize, newSize);
}
template <typename T>
@ -48,8 +47,7 @@ class AllocPolicyBase {
return maybe_pod_arena_calloc<T>(arenaId, numElems);
}
template <typename T>
T* pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize,
size_t newSize) {
T* pod_arena_realloc(arena_id_t arenaId, T* p, size_t oldSize, size_t newSize) {
return maybe_pod_arena_realloc<T>(arenaId, p, oldSize, newSize);
}
@ -145,8 +143,7 @@ class TempAllocPolicy : public AllocPolicyBase {
}
template <typename T>
T* pod_arena_realloc(arena_id_t arenaId, T* prior, size_t oldSize,
size_t newSize) {
T* pod_arena_realloc(arena_id_t arenaId, T* prior, size_t oldSize, size_t newSize) {
T* p2 = this->maybe_pod_arena_realloc<T>(arenaId, prior, oldSize, newSize);
if (MOZ_UNLIKELY(!p2)) {
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.
template <typename RootingContext>
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
// that will be preferred.
template <typename RootingContext,
typename = typename std::enable_if<
std::is_constructible<T, RootingContext>::value>::type>
typename = typename std::enable_if<std::is_constructible<T, RootingContext>::value>::type>
Rooted(const RootingContext& cx, CtorDispatcher, detail::PreferredOverload)
: 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(
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; }
JS::MutableHandleIdVector GetMutableHandleIdVector(
JS::PersistentRootedIdVector* v) {
JS::MutableHandleIdVector GetMutableHandleIdVector(JS::PersistentRootedIdVector* v) {
return JS::MutableHandleIdVector(v);
}
JS::PersistentRootedObjectVector* CreateRootedObjectVector(JSContext* aCx) {
JS::PersistentRootedObjectVector* CreateRootedObjectVector(
JSContext* aCx) {
JS::PersistentRootedObjectVector* vec =
new JS::PersistentRootedObjectVector(aCx);
return vec;
}
bool AppendToRootedObjectVector(JS::PersistentRootedObjectVector* v,
JSObject* obj) {
JSObject* obj) {
return v->append(obj);
}
void DeleteRootedObjectVector(JS::PersistentRootedObjectVector* v) { delete v; }
void DeleteRootedObjectVector(JS::PersistentRootedObjectVector* v) {
delete v;
}
#if defined(__linux__)
# include <malloc.h>

View File

@ -162,7 +162,7 @@ struct ArrayOps<int64_t> {
}
static JS::Result<int64_t> convertValue(JSContext* cx, HandleValue v,
MutableHandleValue result) {
MutableHandleValue result) {
BigInt* bi = ToBigInt(cx, v);
if (!bi) {
return cx->alreadyReportedError();
@ -193,7 +193,7 @@ struct ArrayOps<uint64_t> {
}
static JS::Result<uint64_t> convertValue(JSContext* cx, HandleValue v,
MutableHandleValue result) {
MutableHandleValue result) {
BigInt* bi = ToBigInt(cx, v);
if (!bi) {
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
// reference at exit to prevent us keeping this alive unnecessarily. This is
// kept while executing so it is available to the debugger.
auto guardA = mozilla::MakeScopeExit(
[&] { self->setReservedSlot(ScriptSlot, UndefinedValue()); });
auto guardA = mozilla::MakeScopeExit([&] {
self->setReservedSlot(ScriptSlot, UndefinedValue());
});
RootedModuleEnvironmentObject scope(cx, self->environment());
if (!scope) {

View File

@ -2650,8 +2650,8 @@ bool ASTSerializer::expression(ParseNode* pn, MutableHandleValue dst) {
switch (pn->getKind()) {
case ParseNodeKind::Function: {
FunctionNode* funNode = &pn->as<FunctionNode>();
ASTType type =
funNode->funbox()->isArrow() ? AST_ARROW_EXPR : AST_FUNC_EXPR;
ASTType type = funNode->funbox()->isArrow() ? AST_ARROW_EXPR
: AST_FUNC_EXPR;
return function(funNode, type, dst);
}
@ -3144,9 +3144,9 @@ bool ASTSerializer::property(ParseNode* pn, MutableHandleValue dst) {
ParseNode* valNode = node->right();
bool isShorthand = node->isKind(ParseNodeKind::Shorthand);
bool isMethod =
valNode->is<FunctionNode>() &&
valNode->as<FunctionNode>().funbox()->kind() == JSFunction::Method;
bool isMethod = valNode->is<FunctionNode>() &&
valNode->as<FunctionNode>().funbox()->kind() ==
JSFunction::Method;
RootedValue key(cx), val(cx);
return propertyName(keyNode, &key) && expression(valNode, &val) &&
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
// function. Check isFunctionNameCaptured only for named
// function.
if (pc_->functionBox()->isNamedLambda() && isFunctionNameCaptured) {
if (pc_->functionBox()->isNamedLambda() &&
isFunctionNameCaptured) {
captureFunctionName();
}
BINJS_MOZ_TRY_DECL(isThisCaptured, tokenizer_->readBool(fieldContext++));

View File

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

View File

@ -104,6 +104,7 @@ struct CGResumeOffsetList {
void finish(mozilla::Span<uint32_t> array);
};
static constexpr size_t MaxBytecodeLength = 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 (!bce_->emitInitializeInstanceFields()) {
// [stack]

View File

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

View File

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

View File

@ -163,7 +163,8 @@ FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
isSetter_(fun->isSetter()),
isMethod_(fun->isMethod()),
kind_(fun->kind()),
explicitName_(fun->explicitName()) {
explicitName_(fun->explicitName())
{
// 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
// the JSScript so cannot be collected during a minor GC anyway.
@ -194,8 +195,7 @@ void FunctionBox::initStandaloneFunction(Scope* enclosingScope) {
thisBinding_ = ThisBinding::Function;
}
void FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing,
JSFunction* fun,
void FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun,
FunctionSyntaxKind kind) {
SharedContext* sc = enclosing->sc();
useAsm = sc->isFunctionBox() && sc->asFunctionBox()->useAsmOrInsideUseAsm();

View File

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

View File

@ -425,8 +425,9 @@ class MOZ_NON_MEMMOVABLE BarrieredBase {
// Base class for barriered pointer types that intercept only writes.
template <class T>
class WriteBarriered : public BarrieredBase<T>,
public WrappedPtrOperations<T, WriteBarriered<T>> {
class WriteBarriered
: public BarrieredBase<T>,
public WrappedPtrOperations<T, WriteBarriered<T>> {
protected:
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),
initialized(false) {}
explicit ArenaCellIter(Arena* arena) : initialized(false) { init(arena); }
explicit ArenaCellIter(Arena* arena)
: initialized(false) {
init(arena);
}
void init(Arena* arena) {
MOZ_ASSERT(!initialized);
@ -392,7 +395,9 @@ class ZoneCellIter : protected ZoneAllCellIter<T> {
return cell;
}
T* get() const { return reinterpret_cast<T*>(getCell()); }
T* get() const {
return reinterpret_cast<T*>(getCell());
}
TenuredCell* unbarrieredGetCell() const { return Base::getCell(); }
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 gc {
#define INSTANTIATE_INTERNAL_TRACE_FUNCTIONS(type) \
template void TraceEdgeInternal<type>(JSTracer*, type*, const char*); \
template void TraceRangeInternal<type>(JSTracer*, size_t len, type*, \
#define INSTANTIATE_INTERNAL_TRACE_FUNCTIONS(type) \
template void TraceEdgeInternal<type>(JSTracer*, type*, const char*); \
template void TraceRangeInternal<type>(JSTracer*, size_t len, type*, \
const char*);
#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.
ApplyGCThingTyped(thing, [gcmarker](auto thing) {
MOZ_ASSERT(ShouldMark(gcmarker, thing));
CheckTracedThing(gcmarker, thing);
gcmarker->traverse(thing);
});
MOZ_ASSERT(ShouldMark(gcmarker, thing));
CheckTracedThing(gcmarker, thing);
gcmarker->traverse(thing);
});
}
// 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()) {
AddCellMemory(dst, dst->asFlat().allocSize(), MemoryUse::StringContents);
AddCellMemory(dst, dst->asFlat().allocSize(),
MemoryUse::StringContents);
}
return size;

View File

@ -22,7 +22,8 @@ namespace detail {
template <typename T>
class UnsafeBareWeakHeapPtr : public ReadBarriered<T> {
public:
UnsafeBareWeakHeapPtr() : ReadBarriered<T>(JS::SafelyInitialized<T>()) {}
UnsafeBareWeakHeapPtr()
: ReadBarriered<T>(JS::SafelyInitialized<T>()) {}
MOZ_IMPLICIT UnsafeBareWeakHeapPtr(const T& v) : ReadBarriered<T>(v) {}
explicit UnsafeBareWeakHeapPtr(const UnsafeBareWeakHeapPtr& v)
: ReadBarriered<T>(v) {}
@ -180,7 +181,8 @@ class NurseryAwareHashMap {
namespace JS {
template <typename 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) {
js::TraceEdge(trc, thingp, name);
}

View File

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

View File

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

View File

@ -126,7 +126,8 @@ inline void TraceEdge(JSTracer* trc, WriteBarriered<T>* thingp,
}
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);
}
@ -160,7 +161,8 @@ inline void TraceRoot(JSTracer* trc, T* thingp, const char* name) {
}
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);
}
@ -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
// destination thing is not being GC'd, then the edge will not be traced.
void TraceCrossCompartmentEdge(JSTracer* trc, JSObject* src,
WriteBarriered<Value>* dst, const char* name);
WriteBarriered<Value>* dst,
const char* name);
// As above but with manual barriers.
template <typename T>

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
#include "mozilla/Utf8.h" // mozilla::Utf8Unit
#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"
struct ScriptObjectFixture : public JSAPITest {

View File

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

View File

@ -46,8 +46,8 @@ struct AtomHasher {
const Lookup& lookup);
};
using AtomSet =
JS::GCHashSet<WeakHeapPtr<JSAtom*>, AtomHasher, SystemAllocPolicy>;
using AtomSet = JS::GCHashSet<WeakHeapPtr<JSAtom*>, AtomHasher,
SystemAllocPolicy>;
// 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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -106,7 +106,8 @@ class SavedFrame : public NativeObject {
struct Lookup;
struct HashPolicy;
typedef JS::GCHashSet<WeakHeapPtr<SavedFrame*>, HashPolicy, SystemAllocPolicy>
typedef JS::GCHashSet<WeakHeapPtr<SavedFrame*>, HashPolicy,
SystemAllocPolicy>
Set;
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_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject(
JSContext* cx, HandleObject savedFrameArg,
SavedFrameSelfHosted selfHosted) {
JS_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject
(JSContext* cx, HandleObject savedFrameArg, SavedFrameSelfHosted selfHosted) {
MOZ_ASSERT(savedFrameArg);
RootedObject savedFrame(cx, savedFrameArg);
@ -1120,7 +1119,7 @@ JS_PUBLIC_API JSObject* ConvertSavedFrameToPlainObject(
return nullptr;
}
const char* parentProperties[] = {"parent", "asyncParent"};
const char* parentProperties[] = { "parent", "asyncParent" };
foundParent = false;
for (const char* prop : parentProperties) {
if (!JS_GetProperty(cx, savedFrame, prop, &v)) {

View File

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

View File

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

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