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 &&
bool forceLauncher = runAsLauncher &&
mozilla::CheckArg(argc, argv, L"force-launcher",
static_cast<const wchar_t**>(nullptr),
mozilla::CheckArgFlag::RemoveArg) == mozilla::ARG_FOUND;
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,8 +814,8 @@ void BrowsingContext::Transaction::Apply(BrowsingContext* aBrowsingContext,
}
BrowsingContext::IPCInitializer BrowsingContext::GetIPCInitializer() {
MOZ_ASSERT(!mozilla::Preferences::GetBool(
"fission.preserve_browsing_contexts", false) ||
MOZ_ASSERT(
!mozilla::Preferences::GetBool("fission.preserve_browsing_contexts", false) ||
IsContent());
IPCInitializer init;

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,8 +59,7 @@ void ResizeObserverNotificationHelper::Unregister() {
}
nsRefreshDriver* refreshDriver = GetRefreshDriver();
MOZ_RELEASE_ASSERT(
refreshDriver,
MOZ_RELEASE_ASSERT(refreshDriver,
"We should not leave a dangling reference to the observer around");
bool rv = refreshDriver->RemoveRefreshObserver(this, FlushType::Display);

View file

@ -15,8 +15,7 @@ namespace dom {
SerializedStackHolder::SerializedStackHolder()
: mHolder(StructuredCloneHolder::CloningSupported,
StructuredCloneHolder::TransferringNotSupported,
StructuredCloneHolder::StructuredCloneScope::
SameProcessDifferentThread) {}
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],
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,8 +617,7 @@ 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;
}

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

@ -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,8 +1649,8 @@ nsresult WebSocketImpl::Init(JSContext* aCx, nsIPrincipal* aLoadingPrincipal,
return NS_OK;
}
nsresult WebSocketImpl::AsyncOpen(
nsIPrincipal* aPrincipal, uint64_t aInnerWindowID,
nsresult WebSocketImpl::AsyncOpen(nsIPrincipal* aPrincipal,
uint64_t aInnerWindowID,
nsITransportProvider* aTransportProvider,
const nsACString& aNegotiatedExtensions,
UniquePtr<SerializedStackHolder> aOriginStack) {

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,8 +2178,9 @@ 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",
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

@ -141,7 +141,9 @@ static void NotifySubdocumentInvalidation(
}
static void SetChildrenChangedRecursive(Layer* aLayer) {
ForEachNode<ForwardIterator>(aLayer, [](Layer* layer) {
ForEachNode<ForwardIterator>(
aLayer,
[](Layer* layer) {
ContainerLayer* container = layer->AsContainerLayer();
if (container) {
container->SetChildrenChanged(true);

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

@ -485,8 +485,8 @@ void WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize) {
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

@ -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;
@ -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() ||

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

@ -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

@ -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

@ -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 {
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::Option::ForceDispatch);
});
// Impersonate and initialize.
EnsureMTA(
[this, rawMtaThreadImpToken]() -> void {
EnsureMTA([this, rawMtaThreadImpToken]() -> void {
if (!::SetThreadToken(nullptr, rawMtaThreadImpToken)) {
mInitResult = HRESULT_FROM_WIN32(::GetLastError());
return;
}
InitInsideApartment();
},
EnsureMTA::Option::ForceDispatch);
}, 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

@ -1035,8 +1035,7 @@ class MOZ_RAII Rooted : public js::RootedBase<T, Rooted<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

@ -554,12 +554,12 @@ 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;
@ -570,7 +570,9 @@ bool AppendToRootedObjectVector(JS::PersistentRootedObjectVector* v,
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

@ -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,7 +623,8 @@ class ParseContext : public Nestable<ParseContext> {
}
bool isGetterOrSetter() const {
return sc_->isFunctionBox() && (sc_->asFunctionBox()->isGetter() ||
return sc_->isFunctionBox() &&
(sc_->asFunctionBox()->isGetter() ||
sc_->asFunctionBox()->isSetter());
}

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

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

@ -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

@ -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()) {

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
}
}

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

@ -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;
}

View file

@ -577,7 +577,8 @@ JSFlatString* JSRope::flattenInternal(JSContext* maybecx) {
// Remove memory association for left node we're about to make into a
// dependent string.
if (left.isTenured()) {
RemoveCellMemory(&left, left.allocSize(), MemoryUse::StringContents);
RemoveCellMemory(&left, left.allocSize(),
MemoryUse::StringContents);
}
if (IsSame<CharT, char16_t>::value) {
@ -664,7 +665,8 @@ finish_node : {
str->d.s.u3.capacity = wholeCapacity;
if (str->isTenured()) {
AddCellMemory(str, str->asFlat().allocSize(), MemoryUse::StringContents);
AddCellMemory(str, str->asFlat().allocSize(),
MemoryUse::StringContents);
}
return &this->asFlat();
@ -1474,7 +1476,8 @@ JSFlatString* JSExternalString::ensureFlat(JSContext* cx) {
finalize(cx->runtime()->defaultFreeOp());
MOZ_ASSERT(isTenured());
AddCellMemory(this, (n + 1) * sizeof(char16_t), MemoryUse::StringContents);
AddCellMemory(this, (n + 1) * sizeof(char16_t),
MemoryUse::StringContents);
// Transform the string into a non-external, flat string. Note that the
// resulting string will still be in an AllocKind::EXTERNAL_STRING arena,

View file

@ -572,6 +572,7 @@ static ParseNode* ElemIndex(ParseNode* pn) {
return &pn->as<PropertyByValue>().key();
}
static inline PropertyName* FunctionName(FunctionNode* funNode) {
if (JSAtom* name = funNode->funbox()->explicitName()) {
return name->asPropertyName();
@ -6033,8 +6034,7 @@ static bool ParseFunction(ModuleValidator<Unit>& m, FunctionNode** funNodeOut,
if (!funbox) {
return false;
}
funbox->initWithEnclosingParseContext(outerpc, fun,
FunctionSyntaxKind::Statement);
funbox->initWithEnclosingParseContext(outerpc, fun, FunctionSyntaxKind::Statement);
Directives newDirectives = directives;
SourceParseContext funpc(&m.parser(), funbox, &newDirectives);

View file

@ -292,10 +292,9 @@ class WasmMemoryObject : public NativeObject {
static bool grow(JSContext* cx, unsigned argc, Value* vp);
static uint32_t growShared(HandleWasmMemoryObject memory, uint32_t delta);
using InstanceSet =
JS::WeakCache<GCHashSet<WeakHeapPtrWasmInstanceObject,
MovableCellHasher<WeakHeapPtrWasmInstanceObject>,
SystemAllocPolicy>>;
using InstanceSet = JS::WeakCache<GCHashSet<
WeakHeapPtrWasmInstanceObject,
MovableCellHasher<WeakHeapPtrWasmInstanceObject>, SystemAllocPolicy>>;
bool hasObservers() const;
InstanceSet& observers() const;
InstanceSet* getOrCreateObservers(JSContext* cx);

View file

@ -41,10 +41,9 @@ STATIC_ASSERT_ANYREF_IS_JSOBJECT;
typedef GCVector<HeapPtr<JSObject*>, 0, SystemAllocPolicy> TableAnyRefVector;
class Table : public ShareableBase<Table> {
using InstanceSet =
JS::WeakCache<GCHashSet<WeakHeapPtrWasmInstanceObject,
MovableCellHasher<WeakHeapPtrWasmInstanceObject>,
SystemAllocPolicy>>;
using InstanceSet = JS::WeakCache<GCHashSet<
WeakHeapPtrWasmInstanceObject,
MovableCellHasher<WeakHeapPtrWasmInstanceObject>, SystemAllocPolicy>>;
using UniqueFuncRefArray = UniquePtr<FunctionTableElem[], JS::FreePolicy>;
WeakHeapPtrWasmTableObject maybeObject_;

View file

@ -1827,7 +1827,8 @@ static void ReportRealmStats(const JS::RealmStats& realmStats,
realmStats.ionData,
"The IonMonkey JIT's compilation data (IonScripts).");
ZRREPORT_BYTES(realmJSPathPrefix + NS_LITERAL_CSTRING("jit-scripts"),
ZRREPORT_BYTES(
realmJSPathPrefix + NS_LITERAL_CSTRING("jit-scripts"),
realmStats.jitScripts,
"JIT and Type Inference data associated with scripts.");

View file

@ -3642,8 +3642,8 @@ static bool DescendIntoChild(nsDisplayListBuilder* aBuilder,
}
nsDisplayTableBackgroundSet* tableBGs = aBuilder->GetTableBackgroundSet();
if (tableBGs && tableBGs->GetDirtyRect().Intersects(
normalPositionOverflowRelativeToTable)) {
if (tableBGs &&
tableBGs->GetDirtyRect().Intersects(normalPositionOverflowRelativeToTable)) {
return true;
}
}

View file

@ -130,8 +130,7 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
// list build if we hit them.
static const uint32_t kMaxEdgeRatio = 5;
const bool initializeDAG = !aList->mDAG.Length();
if (!aKeepLinked && !initializeDAG &&
aList->mDAG.mDirectPredecessorList.Length() >
if (!aKeepLinked && !initializeDAG && aList->mDAG.mDirectPredecessorList.Length() >
(aList->mDAG.mNodesInfo.Length() * kMaxEdgeRatio)) {
return false;
}
@ -228,9 +227,7 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
if (!PreProcessDisplayList(
item->GetChildren(), SelectAGRForFrame(f, aAGR), aUpdated,
item->GetPerFrameKey(), aNestingDepth + 1, keepLinked)) {
MOZ_RELEASE_ASSERT(
!aKeepLinked,
"Can't early return since we need to move the out list back");
MOZ_RELEASE_ASSERT(!aKeepLinked, "Can't early return since we need to move the out list back");
return false;
}
}
@ -1204,7 +1201,8 @@ static void AddFramesForContainingBlock(nsIFrame* aBlock,
// ancestors must also be visited).
static void FindContainingBlocks(nsIFrame* aFrame,
nsTArray<nsIFrame*>& aExtraFrames) {
for (nsIFrame* f = aFrame; f; f = nsLayoutUtils::GetDisplayListParent(f)) {
for (nsIFrame* f = aFrame; f;
f = nsLayoutUtils::GetDisplayListParent(f)) {
if (f->ForceDescendIntoIfVisible()) return;
f->SetForceDescendIntoIfVisible(true);
CRR_LOG("Considering OOFs for %p\n", f);

View file

@ -3753,8 +3753,7 @@ nsCSSBorderImageRenderer::nsCSSBorderImageRenderer(
const auto& width = aStyleBorder.mBorderImageWidth.Get(s);
switch (width.tag) {
case StyleBorderImageSideWidth::Tag::LengthPercentage:
value =
std::max(0, width.AsLengthPercentage().Resolve(borderDimension));
value = std::max(0, width.AsLengthPercentage().Resolve(borderDimension));
break;
case StyleBorderImageSideWidth::Tag::Number:
value = width.AsNumber() * borderWidths.Side(s);

View file

@ -1153,7 +1153,8 @@ bool CustomCounterStyle::IsBullet() {
void CustomCounterStyle::GetNegative(NegativeType& aResult) {
if (!(mFlags & FLAG_NEGATIVE_INITED)) {
mFlags |= FLAG_NEGATIVE_INITED;
if (!Servo_CounterStyleRule_GetNegative(mRule, &mNegative.before,
if (!Servo_CounterStyleRule_GetNegative(mRule,
&mNegative.before,
&mNegative.after)) {
if (IsExtendsSystem()) {
GetExtends()->GetNegative(mNegative);

View file

@ -315,7 +315,8 @@ void FontFace::SetDisplay(const nsAString& aValue, ErrorResult& aRv) {
}
}
void FontFace::DescriptorUpdated() {
void FontFace::DescriptorUpdated()
{
// If we haven't yet initialized mUserFontEntry, no need to do anything here;
// we'll respect the updated descriptor when the time comes to create it.
if (!mUserFontEntry) {

View file

@ -1032,9 +1032,10 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace(
if (existingEntry) {
// aFontFace already has a user font entry, so we update its attributes
// rather than creating a new one.
existingEntry->UpdateAttributes(
weight, stretch, italicStyle, featureSettings, variationSettings,
languageOverride, unicodeRanges, fontDisplay, rangeFlags);
existingEntry->UpdateAttributes(weight, stretch, italicStyle,
featureSettings, variationSettings,
languageOverride, unicodeRanges,
fontDisplay, rangeFlags);
// If the family name has changed, remove the entry from its current family
// and clear the mFamilyName field so it can be reset when added to a new
// family.

View file

@ -80,7 +80,7 @@ class WritingMode;
class ServoElementSnapshotTable;
enum class StyleContentType : uint8_t;
template <typename T>
template<typename T>
struct StyleForgottenArcSlicePtr;
struct AnimationPropertySegment;

View file

@ -171,8 +171,7 @@ enum class StyleScrollbarWidth : uint8_t {
// Shape source type
enum class StyleShapeSourceType : uint8_t {
None,
Image, // shape-outside / clip-path only, and clip-path only uses it for
// <url>s
Image, // shape-outside / clip-path only, and clip-path only uses it for <url>s
Shape,
Box,
Path, // SVG path function

View file

@ -29,7 +29,7 @@ class FontSlantStyle;
namespace dom {
class Document;
class Element;
} // namespace dom
}
} // namespace mozilla
// Style utility functions

View file

@ -55,13 +55,11 @@ void SVGImageContext::MaybeStoreContextPaint(Maybe<SVGImageContext>& aContext,
haveContextPaint = true;
contextPaint->SetStroke(style->mStroke.GetColor(aFromComputedStyle));
}
if (style->mMozContextProperties.bits &
StyleContextPropertyBits_FILL_OPACITY) {
if (style->mMozContextProperties.bits & StyleContextPropertyBits_FILL_OPACITY) {
haveContextPaint = true;
contextPaint->SetFillOpacity(style->mFillOpacity);
}
if (style->mMozContextProperties.bits &
StyleContextPropertyBits_STROKE_OPACITY) {
if (style->mMozContextProperties.bits & StyleContextPropertyBits_STROKE_OPACITY) {
haveContextPaint = true;
contextPaint->SetStrokeOpacity(style->mStrokeOpacity);
}

View file

@ -1174,8 +1174,7 @@ static nsSVGPaintingProperty* GetOrCreateClipPathObserver(
if (svgStyleReset->mClipPath.GetType() != StyleShapeSourceType::Image) {
return nullptr;
}
const css::URLValue* url =
svgStyleReset->mClipPath.ShapeImage().GetURLValue();
const css::URLValue* url = svgStyleReset->mClipPath.ShapeImage().GetURLValue();
MOZ_ASSERT(url);
RefPtr<URLAndReferrerInfo> pathURI =
ResolveURLUsingLocalRef(aClippedFrame, url);

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