Bug 1519636 - First reformat with clang-format 13.0.0. r=firefox-build-system-reviewers,sylvestre,mhentges
Updated with clang-format version 13.0.0 (taskcluster-OgjH5lasS5K_fvefdRcJVg) Depends on D131114 Differential Revision: https://phabricator.services.mozilla.com/D129119
This commit is contained in:
@@ -143,7 +143,8 @@ void HyperTextAccessibleBase::TextSubstring(int32_t aStartOffset,
|
||||
}
|
||||
|
||||
bool HyperTextAccessibleBase::CharAt(int32_t aOffset, nsAString& aChar,
|
||||
int32_t* aStartOffset, int32_t* aEndOffset) {
|
||||
int32_t* aStartOffset,
|
||||
int32_t* aEndOffset) {
|
||||
MOZ_ASSERT(!aStartOffset == !aEndOffset,
|
||||
"Offsets should be both defined or both undefined!");
|
||||
|
||||
|
||||
@@ -110,9 +110,9 @@ using namespace mozilla::a11y;
|
||||
|
||||
static const uint64_t kCachedStates =
|
||||
states::CHECKED | states::PRESSED | states::MIXED | states::EXPANDED |
|
||||
states::EXPANDABLE | states::CURRENT | states::SELECTED | states::TRAVERSED |
|
||||
states::LINKED | states::HASPOPUP | states::BUSY | states::MULTI_LINE |
|
||||
states::CHECKABLE;
|
||||
states::EXPANDABLE | states::CURRENT | states::SELECTED |
|
||||
states::TRAVERSED | states::LINKED | states::HASPOPUP | states::BUSY |
|
||||
states::MULTI_LINE | states::CHECKABLE;
|
||||
static const uint64_t kCacheInitialized = ((uint64_t)0x1) << 63;
|
||||
|
||||
- (uint64_t)state {
|
||||
|
||||
@@ -123,7 +123,6 @@ class FlattenedChildIterator : public ExplicitChildIterator {
|
||||
const nsIContent* Parent() const { return mOriginalContent; }
|
||||
|
||||
protected:
|
||||
|
||||
const nsIContent* mOriginalContent;
|
||||
|
||||
private:
|
||||
|
||||
@@ -80,8 +80,7 @@ class ProducerView {
|
||||
public:
|
||||
using Producer = _Producer;
|
||||
|
||||
explicit ProducerView(Producer* aProducer)
|
||||
: mProducer(aProducer) {}
|
||||
explicit ProducerView(Producer* aProducer) : mProducer(aProducer) {}
|
||||
|
||||
template <typename T>
|
||||
bool WriteFromRange(const Range<const T>& src) {
|
||||
@@ -133,8 +132,7 @@ class ConsumerView {
|
||||
public:
|
||||
using Consumer = _Consumer;
|
||||
|
||||
explicit ConsumerView(Consumer* aConsumer)
|
||||
: mConsumer(aConsumer) {}
|
||||
explicit ConsumerView(Consumer* aConsumer) : mConsumer(aConsumer) {}
|
||||
|
||||
/**
|
||||
* Read bytes from the consumer if there is enough data. aBuffer may
|
||||
@@ -223,8 +221,7 @@ struct QueueParamTraits<bool> {
|
||||
using ParamType = bool;
|
||||
|
||||
template <typename U>
|
||||
static auto Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static auto Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
uint8_t temp = aArg ? 1 : 0;
|
||||
return aProducerView.WriteParam(temp);
|
||||
}
|
||||
@@ -251,8 +248,7 @@ struct EnumSerializer {
|
||||
using DataType = typename std::underlying_type<E>::type;
|
||||
|
||||
template <typename U>
|
||||
static auto Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aValue) {
|
||||
static auto Write(ProducerView<U>& aProducerView, const ParamType& aValue) {
|
||||
MOZ_RELEASE_ASSERT(
|
||||
EnumValidator::IsLegalValue(static_cast<DataType>(aValue)));
|
||||
return aProducerView.WriteParam(DataType(aValue));
|
||||
@@ -372,8 +368,7 @@ struct QueueParamTraits<nsACString> {
|
||||
using ParamType = nsACString;
|
||||
|
||||
template <typename U>
|
||||
static bool Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static bool Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
if ((!aProducerView.WriteParam(aArg.IsVoid())) || aArg.IsVoid()) {
|
||||
return false;
|
||||
}
|
||||
@@ -425,8 +420,7 @@ struct QueueParamTraits<nsAString> {
|
||||
using ParamType = nsAString;
|
||||
|
||||
template <typename U>
|
||||
static bool Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static bool Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
if ((!aProducerView.WriteParam(aArg.IsVoid())) || (aArg.IsVoid())) {
|
||||
return false;
|
||||
}
|
||||
@@ -503,8 +497,7 @@ struct NSArrayQueueParamTraits<nsTArray<_ElementType>, false> {
|
||||
using ParamType = nsTArray<ElementType>;
|
||||
|
||||
template <typename U>
|
||||
static bool Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static bool Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
aProducerView.WriteParam(aArg.Length());
|
||||
for (auto& elt : aArg) {
|
||||
aProducerView.WriteParam(elt);
|
||||
@@ -539,8 +532,7 @@ struct NSArrayQueueParamTraits<nsTArray<_ElementType>, true> {
|
||||
|
||||
// TODO: Are there alignment issues?
|
||||
template <typename U>
|
||||
static bool Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static bool Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
size_t arrayLen = aArg.Length();
|
||||
aProducerView.WriteParam(arrayLen);
|
||||
return aProducerView.Write(&aArg[0], aArg.Length() * sizeof(ElementType));
|
||||
@@ -581,8 +573,7 @@ struct ArrayQueueParamTraits<Array<_ElementType, Length>, false> {
|
||||
using ParamType = Array<ElementType, Length>;
|
||||
|
||||
template <typename U>
|
||||
static auto Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static auto Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
for (const auto& elt : aArg) {
|
||||
aProducerView.WriteParam(elt);
|
||||
}
|
||||
@@ -605,8 +596,7 @@ struct ArrayQueueParamTraits<Array<_ElementType, Length>, true> {
|
||||
using ParamType = Array<ElementType, Length>;
|
||||
|
||||
template <typename U>
|
||||
static auto Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static auto Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
return aProducerView.Write(aArg.begin(), sizeof(ElementType[Length]));
|
||||
}
|
||||
|
||||
@@ -629,8 +619,7 @@ struct QueueParamTraits<Maybe<ElementType>> {
|
||||
using ParamType = Maybe<ElementType>;
|
||||
|
||||
template <typename U>
|
||||
static bool Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static bool Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
aProducerView.WriteParam(static_cast<bool>(aArg));
|
||||
if (aArg) {
|
||||
aProducerView.WriteParam(aArg.ref());
|
||||
@@ -662,8 +651,7 @@ struct QueueParamTraits<std::pair<TypeA, TypeB>> {
|
||||
using ParamType = std::pair<TypeA, TypeB>;
|
||||
|
||||
template <typename U>
|
||||
static bool Write(ProducerView<U>& aProducerView,
|
||||
const ParamType& aArg) {
|
||||
static bool Write(ProducerView<U>& aProducerView, const ParamType& aArg) {
|
||||
aProducerView.WriteParam(aArg.first());
|
||||
return aProducerView.WriteParam(aArg.second());
|
||||
}
|
||||
|
||||
@@ -25,9 +25,7 @@ class RangeConsumerView final : public webgl::ConsumerView<RangeConsumerView> {
|
||||
auto Remaining() const { return *MaybeAs<size_t>(mSrcEnd - mSrcItr); }
|
||||
|
||||
explicit RangeConsumerView(const Range<const uint8_t> range)
|
||||
: ConsumerView(this),
|
||||
mSrcItr(range.begin()),
|
||||
mSrcEnd(range.end()) {
|
||||
: ConsumerView(this), mSrcItr(range.begin()), mSrcEnd(range.end()) {
|
||||
(void)Remaining(); // assert size non-negative
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,8 @@ void DesktopDeviceInfoImpl::InitializeWindowList() {
|
||||
_snprintf_s(idStr, sizeof(idStr), sizeof(idStr) - 1, "%ld",
|
||||
static_cast<long>(pWinDevice->getScreenId()));
|
||||
#else
|
||||
SprintfLiteral(idStr, "%ld", static_cast<long>(pWinDevice->getScreenId()));
|
||||
SprintfLiteral(idStr, "%ld",
|
||||
static_cast<long>(pWinDevice->getScreenId()));
|
||||
#endif
|
||||
pWinDevice->setUniqueIdName(idStr);
|
||||
desktop_window_list_[pWinDevice->getScreenId()] = pWinDevice;
|
||||
|
||||
@@ -242,8 +242,8 @@ void AnalyserNode::GetByteFrequencyData(const Uint8Array& aArray) {
|
||||
WebAudioUtils::ConvertLinearToDecibels(mOutputBuffer[i], mMinDecibels);
|
||||
// scale down the value to the range of [0, UCHAR_MAX]
|
||||
const double scaled = std::max(
|
||||
0.0, std::min(double(UCHAR_MAX),
|
||||
UCHAR_MAX*(decibels - mMinDecibels) * rangeScaleFactor));
|
||||
0.0, std::min(double(UCHAR_MAX), UCHAR_MAX * (decibels - mMinDecibels) *
|
||||
rangeScaleFactor));
|
||||
buffer[i] = static_cast<unsigned char>(scaled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,17 +64,17 @@ nsresult AudioWorkletImpl::SendControlMessage(
|
||||
|
||||
void AudioWorkletImpl::OnAddModuleStarted() const {
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
profiler_add_marker(
|
||||
ProfilerStringView("AudioWorklet.addModule"),
|
||||
geckoprofiler::category::MEDIA_RT, {MarkerTiming::IntervalStart()});
|
||||
profiler_add_marker(ProfilerStringView("AudioWorklet.addModule"),
|
||||
geckoprofiler::category::MEDIA_RT,
|
||||
{MarkerTiming::IntervalStart()});
|
||||
#endif
|
||||
}
|
||||
|
||||
void AudioWorkletImpl::OnAddModulePromiseSettled() const {
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
profiler_add_marker(
|
||||
ProfilerStringView("AudioWorklet.addModule"),
|
||||
geckoprofiler::category::MEDIA_RT, {MarkerTiming::IntervalEnd()});
|
||||
profiler_add_marker(ProfilerStringView("AudioWorklet.addModule"),
|
||||
geckoprofiler::category::MEDIA_RT,
|
||||
{MarkerTiming::IntervalEnd()});
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2420,8 +2420,7 @@ RecordedFillGlyphs::RecordedFillGlyphs(S& aStream)
|
||||
|
||||
mGlyphs = new (fallible) Glyph[mNumGlyphs];
|
||||
if (!mGlyphs) {
|
||||
gfxCriticalNote
|
||||
<< "RecordedFillGlyphs failed to allocate glyphs of size "
|
||||
gfxCriticalNote << "RecordedFillGlyphs failed to allocate glyphs of size "
|
||||
<< mNumGlyphs;
|
||||
aStream.SetIsBad();
|
||||
} else {
|
||||
|
||||
@@ -50,12 +50,9 @@ namespace gl {
|
||||
|
||||
// should match the order of EGLExtensions, and be null-terminated.
|
||||
static const char* sEGLLibraryExtensionNames[] = {
|
||||
"EGL_ANDROID_get_native_client_buffer",
|
||||
"EGL_ANGLE_device_creation",
|
||||
"EGL_ANGLE_device_creation_d3d11",
|
||||
"EGL_ANGLE_platform_angle",
|
||||
"EGL_ANGLE_platform_angle_d3d",
|
||||
"EGL_EXT_device_query"};
|
||||
"EGL_ANDROID_get_native_client_buffer", "EGL_ANGLE_device_creation",
|
||||
"EGL_ANGLE_device_creation_d3d11", "EGL_ANGLE_platform_angle",
|
||||
"EGL_ANGLE_platform_angle_d3d", "EGL_EXT_device_query"};
|
||||
|
||||
// should match the order of EGLExtensions, and be null-terminated.
|
||||
static const char* sEGLExtensionNames[] = {
|
||||
|
||||
@@ -121,8 +121,7 @@ bool AnimationInfo::StartPendingAnimations(const TimeStamp& aReadyTime) {
|
||||
return updated;
|
||||
}
|
||||
|
||||
void AnimationInfo::TransferMutatedFlagToLayer(Layer* aLayer) {
|
||||
}
|
||||
void AnimationInfo::TransferMutatedFlagToLayer(Layer* aLayer) {}
|
||||
|
||||
bool AnimationInfo::ApplyPendingUpdatesForThisTransaction() {
|
||||
if (mPendingAnimations) {
|
||||
|
||||
@@ -34,7 +34,8 @@ class APZTaskRunnable final : public Runnable {
|
||||
// Queue a RepaintRequest.
|
||||
// If there's already a RepaintRequest having the same scroll id, the old
|
||||
// one will be discarded.
|
||||
void QueueRequest(const RepaintRequest& aRequest);
|
||||
void
|
||||
QueueRequest(const RepaintRequest& aRequest);
|
||||
void QueueFlushCompleteNotification();
|
||||
void Revoke() {
|
||||
mController = nullptr;
|
||||
|
||||
@@ -422,9 +422,10 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
||||
float(aPipeline->mCurrentTexture->GetSize().width),
|
||||
float(aPipeline->mCurrentTexture->GetSize().height)};
|
||||
computedTransform.rotation = ToWrRotation(aPipeline->mRotation);
|
||||
// We don't have a frame / per-frame key here, but we can use the pipeline id and
|
||||
// the key kind to create a unique stable key.
|
||||
computedTransform.key = wr::SpatialKey(aPipelineId.mNamespace, aPipelineId.mHandle, wr::SpatialKeyKind::APZ);
|
||||
// We don't have a frame / per-frame key here, but we can use the pipeline id
|
||||
// and the key kind to create a unique stable key.
|
||||
computedTransform.key = wr::SpatialKey(
|
||||
aPipelineId.mNamespace, aPipelineId.mHandle, wr::SpatialKeyKind::APZ);
|
||||
params.computed_transform = &computedTransform;
|
||||
|
||||
Maybe<wr::WrSpatialId> referenceFrameId =
|
||||
|
||||
@@ -99,7 +99,8 @@ ID3D11Device* RenderCompositorANGLE::GetDeviceOfEGLDisplay(nsACString& aError) {
|
||||
const auto& gle = gl::GLContextEGL::Cast(gl);
|
||||
const auto& egl = gle->mEgl;
|
||||
MOZ_ASSERT(egl);
|
||||
if (!egl || !egl->mLib->IsExtensionSupported(gl::EGLLibExtension::EXT_device_query)) {
|
||||
if (!egl ||
|
||||
!egl->mLib->IsExtensionSupported(gl::EGLLibExtension::EXT_device_query)) {
|
||||
aError.Assign("RcANGLE(no EXT_device_query support)"_ns);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -103,10 +103,10 @@ inline gfx::SurfaceFormat ImageFormatToSurfaceFormat(ImageFormat aFormat) {
|
||||
}
|
||||
|
||||
// This extra piece of data is used to differentiate when spatial nodes that are
|
||||
// created by Gecko that have the same mFrame and PerFrameKey. This currently only
|
||||
// occurs with sticky display list items that are also zoomable, which results in
|
||||
// Gecko creating both a sticky spatial node, and then a property animated reference
|
||||
// frame for APZ
|
||||
// created by Gecko that have the same mFrame and PerFrameKey. This currently
|
||||
// only occurs with sticky display list items that are also zoomable, which
|
||||
// results in Gecko creating both a sticky spatial node, and then a property
|
||||
// animated reference frame for APZ
|
||||
enum class SpatialKeyKind : uint32_t {
|
||||
Transform,
|
||||
Perspective,
|
||||
@@ -116,9 +116,10 @@ enum class SpatialKeyKind : uint32_t {
|
||||
APZ,
|
||||
};
|
||||
|
||||
// Construct a unique, persistent spatial key based on the frame tree pointer, per-frame key
|
||||
// and a spatial key kind. For now, this covers all the ways Gecko creates spatial nodes.
|
||||
// In future, we may need to be more clever with the SpatialKeyKind.
|
||||
// Construct a unique, persistent spatial key based on the frame tree pointer,
|
||||
// per-frame key and a spatial key kind. For now, this covers all the ways Gecko
|
||||
// creates spatial nodes. In future, we may need to be more clever with the
|
||||
// SpatialKeyKind.
|
||||
inline wr::SpatialTreeItemKey SpatialKey(uint64_t aFrame, uint32_t aPerFrameKey,
|
||||
SpatialKeyKind aKind) {
|
||||
return wr::SpatialTreeItemKey{
|
||||
|
||||
@@ -42,14 +42,13 @@
|
||||
#endif
|
||||
|
||||
#define DEFINE_COMPILERRT_FUNCTION(name) \
|
||||
.globl SYMBOL_NAME(name) SEPARATOR DECLARE_SYMBOL_VISIBILITY(name) \
|
||||
SYMBOL_NAME(name) \
|
||||
:
|
||||
.globl SYMBOL_NAME(name) \
|
||||
SEPARATOR DECLARE_SYMBOL_VISIBILITY(name) SYMBOL_NAME(name) :
|
||||
|
||||
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
|
||||
.globl SYMBOL_NAME(name) SEPARATOR HIDDEN_DIRECTIVE SYMBOL_NAME(name) \
|
||||
SEPARATOR SYMBOL_NAME(name) \
|
||||
:
|
||||
.globl SYMBOL_NAME(name) \
|
||||
SEPARATOR HIDDEN_DIRECTIVE SYMBOL_NAME(name) \
|
||||
SEPARATOR SYMBOL_NAME(name) :
|
||||
|
||||
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
|
||||
.globl name SEPARATOR HIDDEN_DIRECTIVE name SEPARATOR name:
|
||||
|
||||
@@ -3623,8 +3623,8 @@ void PresShell::DoScrollContentIntoView() {
|
||||
// Reuse the same line iterator across calls to AccumulateFrameBounds.
|
||||
// We set it every time we detect a new block (stored in prevBlock).
|
||||
nsAutoLineIterator lines;
|
||||
// The last line we found a continuation on in |lines|. We assume that later
|
||||
// continuations cannot come on earlier lines.
|
||||
// The last line we found a continuation on in |lines|. We assume that
|
||||
// later continuations cannot come on earlier lines.
|
||||
int32_t curLine = 0;
|
||||
do {
|
||||
AccumulateFrameBounds(container, frame, useWholeLineHeightForInlines,
|
||||
|
||||
@@ -244,8 +244,7 @@ bool nsProgressFrame::ShouldUseNativeStyle() const {
|
||||
// background.
|
||||
return StyleDisplay()->EffectiveAppearance() ==
|
||||
StyleAppearance::ProgressBar &&
|
||||
!Style()->HasAuthorSpecifiedBorderOrBackground() &&
|
||||
barFrame &&
|
||||
!Style()->HasAuthorSpecifiedBorderOrBackground() && barFrame &&
|
||||
barFrame->StyleDisplay()->EffectiveAppearance() ==
|
||||
StyleAppearance::Progresschunk &&
|
||||
!barFrame->Style()->HasAuthorSpecifiedBorderOrBackground();
|
||||
|
||||
@@ -1641,9 +1641,7 @@ class nsLineIterator final : public nsILineIterator {
|
||||
mIndex = 0;
|
||||
}
|
||||
}
|
||||
~nsLineIterator() {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mMutationGuard.Mutated(0));
|
||||
};
|
||||
~nsLineIterator() { MOZ_DIAGNOSTIC_ASSERT(!mMutationGuard.Mutated(0)); };
|
||||
|
||||
void DisposeLineIterator() final { delete this; }
|
||||
|
||||
|
||||
@@ -275,8 +275,8 @@ void SVGForeignObjectFrame::PaintSVG(gfxContext& aContext,
|
||||
if (aImgParams.imageFlags & imgIContainer::FLAG_HIGH_QUALITY_SCALING) {
|
||||
flags |= PaintFrameFlags::UseHighQualityScaling;
|
||||
}
|
||||
nsLayoutUtils::PaintFrame(
|
||||
&aContext, kid, nsRegion(kidDirtyRect), NS_RGBA(0, 0, 0, 0),
|
||||
nsLayoutUtils::PaintFrame(&aContext, kid, nsRegion(kidDirtyRect),
|
||||
NS_RGBA(0, 0, 0, 0),
|
||||
nsDisplayListBuilderMode::Painting, flags);
|
||||
|
||||
aContext.Restore();
|
||||
|
||||
@@ -366,9 +366,7 @@ NS_IMETHODIMP FuzzySecurityInfo::GetIsBuiltCertChainRootBuiltInRoot(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP FuzzySecurityInfo::DisableEarlyData(void) {
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP FuzzySecurityInfo::DisableEarlyData(void) { return NS_OK; }
|
||||
|
||||
NS_IMETHODIMP FuzzySecurityInfo::SetHandshakeCallbackListener(
|
||||
nsITlsHandshakeCallbackListener* callback) {
|
||||
|
||||
@@ -2311,7 +2311,6 @@ nsresult HttpBaseChannel::ProcessCrossOriginResourcePolicyHeader() {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// See https://gist.github.com/annevk/6f2dd8c79c77123f39797f6bdac43f3e
|
||||
// This method runs steps 1-4 of the algorithm to compare
|
||||
// cross-origin-opener policies
|
||||
|
||||
Reference in New Issue
Block a user