Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
This commit is contained in:
Sylvestre Ledru 2022-06-07 12:32:55 +00:00
Родитель 1d3eabcafc
Коммит 42f6811d95
50 изменённых файлов: 171 добавлений и 154 удалений

Просмотреть файл

@ -12,7 +12,6 @@
#include "nsMai.h"
#include "nsIAccessibleTypes.h"
using namespace mozilla;
using namespace mozilla::a11y;

Просмотреть файл

@ -53,11 +53,10 @@ struct AtkStateMap {
};
// Map array from cross platform states to ATK states
static const AtkStateMap
gAtkStateMap[] =
{
// Cross Platform States
// clang-format off
static const AtkStateMap gAtkStateMap[] =
{
// Cross Platform States
// clang-format off
{ kNone, kMapOpposite }, // states::UNAVAILABLE = 1 << 0
{ ATK_STATE_SELECTED, kMapDirectly }, // states::SELECTED = 1 << 1
{ ATK_STATE_FOCUSED, kMapDirectly }, // states::FOCUSED = 1 << 2
@ -107,7 +106,7 @@ static const AtkStateMap
{ ATK_STATE_EXPANDABLE, kMapDirectly }, // states::EXPANDABLE = 1 << 46
{ kNone, kMapDirectly }, // states::PINNED = 1 << 47
{ ATK_STATE_ACTIVE, kMapDirectly } // states::CURRENT = 1 << 48
// clang-format on
// clang-format on
};
static const auto gAtkStateMapLen = std::extent<decltype(gAtkStateMap)>::value;

Просмотреть файл

@ -28,8 +28,8 @@ class SystemPrincipal;
} // namespace mozilla
namespace JS {
enum class RuntimeCode;
} // namespace JS
enum class RuntimeCode;
} // namespace JS
/////////////////////////////
// nsScriptSecurityManager //

Просмотреть файл

@ -470,8 +470,7 @@ Element* DocumentOrShadowRoot::ElementFromPoint(float aX, float aY) {
void DocumentOrShadowRoot::ElementsFromPoint(
float aX, float aY, nsTArray<RefPtr<Element>>& aElements) {
QueryNodesFromPoint(*this, aX, aY, {}, FlushLayout::Yes, Multiple::Yes,
ViewportType::Layout, PerformRetargeting::Yes,
aElements);
ViewportType::Layout, PerformRetargeting::Yes, aElements);
}
void DocumentOrShadowRoot::NodesFromPoint(float aX, float aY,

Просмотреть файл

@ -1061,7 +1061,8 @@ bool WebGLContext::DoFakeVertexAttrib0(const uint64_t totalVertCount) {
////
const auto bytesPerVert = sizeof(mFakeVertexAttrib0Data);
const auto checked_dataSize = CheckedInt<intptr_t>(totalVertCount) * bytesPerVert;
const auto checked_dataSize =
CheckedInt<intptr_t>(totalVertCount) * bytesPerVert;
if (!checked_dataSize.isValid()) {
ErrorOutOfMemory(
"Integer overflow trying to construct a fake vertex attrib 0"
@ -1081,7 +1082,8 @@ bool WebGLContext::DoFakeVertexAttrib0(const uint64_t totalVertCount) {
const auto err = errorScope.GetError();
if (err) {
ErrorOutOfMemory("Failed to allocate fake vertex attrib 0 data: %zi bytes", dataSize);
ErrorOutOfMemory(
"Failed to allocate fake vertex attrib 0 data: %zi bytes", dataSize);
return false;
}

Просмотреть файл

@ -339,7 +339,8 @@ nsresult ChannelMediaResource::OnStopRequest(nsIRequest* aRequest,
NS_ASSERTION(NS_SUCCEEDED(rv), "GetLoadFlags() failed!");
if (loadFlags & nsIRequest::LOAD_BACKGROUND) {
Unused << NS_WARN_IF(NS_FAILED(ModifyLoadFlags(loadFlags & ~nsIRequest::LOAD_BACKGROUND)));
Unused << NS_WARN_IF(
NS_FAILED(ModifyLoadFlags(loadFlags & ~nsIRequest::LOAD_BACKGROUND)));
}
// Note that aStatus might have succeeded --- this might be a normal close

Просмотреть файл

@ -57,13 +57,13 @@ uint32_t PreferredSampleRate();
// Initialize a cubeb stream. A pass through wrapper for cubeb_stream_init,
// that can simulate streams that are very slow to start, by setting the pref
// media.cubeb.slow_stream_init_ms.
int CubebStreamInit(cubeb * context, cubeb_stream ** stream,
char const * stream_name, cubeb_devid input_device,
cubeb_stream_params * input_stream_params,
int CubebStreamInit(cubeb* context, cubeb_stream** stream,
char const* stream_name, cubeb_devid input_device,
cubeb_stream_params* input_stream_params,
cubeb_devid output_device,
cubeb_stream_params * output_stream_params,
cubeb_stream_params* output_stream_params,
uint32_t latency_frames, cubeb_data_callback data_callback,
cubeb_state_callback state_callback, void * user_ptr);
cubeb_state_callback state_callback, void* user_ptr);
enum Side { Input, Output };

Просмотреть файл

@ -6,7 +6,6 @@
#include "cdm-test-storage.h"
#include <vector>
using namespace cdm;
class WriteRecordClient : public FileIOClient {

Просмотреть файл

@ -576,12 +576,12 @@ void GeckoMediaPluginServiceParent::UpdateContentProcessGMPCapabilities(
const uint32_t NO_H264_DIR_IN_PROGRESS = 4;
uint32_t hasH264 = NO_H264;
if (mDirectoriesAdded == 1) {
hasH264 = NO_H264_1_DIR;
hasH264 = NO_H264_1_DIR;
} else if (mDirectoriesAdded > 1) {
hasH264 = NO_H264_2_PLUS_DIRS;
hasH264 = NO_H264_2_PLUS_DIRS;
}
if (mDirectoriesInProgress) {
hasH264 = NO_H264_DIR_IN_PROGRESS;
hasH264 = NO_H264_DIR_IN_PROGRESS;
}
nsTArray<GMPCapabilityData> caps;
{

Просмотреть файл

@ -21,7 +21,7 @@ FFmpegAudioDecoder<LIBAV_VER>::FFmpegAudioDecoder(FFmpegLibWrapper* aLib,
if (mCodecID == AV_CODEC_ID_AAC &&
aConfig.mCodecSpecificConfig.is<AacCodecSpecificData>()) {
const AacCodecSpecificData& aacCodecSpecificData =
aConfig.mCodecSpecificConfig.as<AacCodecSpecificData>();
aConfig.mCodecSpecificConfig.as<AacCodecSpecificData>();
mExtraData = new MediaByteBuffer;
// Ffmpeg expects the DecoderConfigDescriptor blob.
mExtraData->AppendElements(

Просмотреть файл

@ -94,19 +94,22 @@ WMFAudioMFTManager::WMFAudioMFTManager(const AudioInfo& aConfig)
uint32_t configLength;
if (aConfig.mCodecSpecificConfig.is<AacCodecSpecificData>()) {
const AacCodecSpecificData& aacCodecSpecificData =
aConfig.mCodecSpecificConfig.as<AacCodecSpecificData>();
audioSpecConfig = aacCodecSpecificData.mDecoderConfigDescriptorBinaryBlob->Elements();
configLength = aacCodecSpecificData.mDecoderConfigDescriptorBinaryBlob->Length();
aConfig.mCodecSpecificConfig.as<AacCodecSpecificData>();
audioSpecConfig =
aacCodecSpecificData.mDecoderConfigDescriptorBinaryBlob->Elements();
configLength =
aacCodecSpecificData.mDecoderConfigDescriptorBinaryBlob->Length();
} else {
// Gracefully handle failure to cover all codec specific cases above. Once
// we're confident there is no fall through from these cases above, we should
// remove this code.
// we're confident there is no fall through from these cases above, we
// should remove this code.
RefPtr<MediaByteBuffer> audioCodecSpecificBinaryBlob =
GetAudioCodecSpecificBlob(aConfig.mCodecSpecificConfig);
GetAudioCodecSpecificBlob(aConfig.mCodecSpecificConfig);
audioSpecConfig = audioCodecSpecificBinaryBlob->Elements();
configLength = audioCodecSpecificBinaryBlob->Length();
}
AACAudioSpecificConfigToUserData(aConfig.mExtendedProfile, audioSpecConfig, configLength, mUserData);
AACAudioSpecificConfigToUserData(aConfig.mExtendedProfile, audioSpecConfig,
configLength, mUserData);
}
}

Просмотреть файл

@ -14,7 +14,6 @@
#include "mozilla/RefPtr.h"
#include "mozilla/dom/MediaStreamTrackBinding.h"
namespace mozilla {
class MediaEngineWebRTC : public MediaEngine {

Просмотреть файл

@ -377,8 +377,8 @@ nsTArray<RefPtr<dom::RTCStatsPromise>> RTCRtpSender::GetStatsInternal() {
local.mFrameHeight.Construct(streamStats->height);
local.mFramesSent.Construct(streamStats->frames_encoded);
local.mHugeFramesSent.Construct(streamStats->huge_frames_sent);
local.mTotalEncodeTime.Construct(double(streamStats->total_encode_time_ms) /
1000.);
local.mTotalEncodeTime.Construct(
double(streamStats->total_encode_time_ms) / 1000.);
/*
* Potential new stats that are now available upstream.
local.mTargetBitrate.Construct(videoStats->target_media_bitrate_bps);

Просмотреть файл

@ -464,12 +464,11 @@ int32_t WebrtcGmpVideoEncoder::SetRates(
}
WebrtcVideoEncoder::EncoderInfo WebrtcGmpVideoEncoder::GetEncoderInfo() const {
WebrtcVideoEncoder::EncoderInfo info;
info.supports_native_handle = false;
info.implementation_name = "GMPOpenH264";
info.scaling_settings =
WebrtcVideoEncoder::ScalingSettings(kLowH264QpThreshold, kHighH264QpThreshold);
info.scaling_settings = WebrtcVideoEncoder::ScalingSettings(
kLowH264QpThreshold, kHighH264QpThreshold);
info.is_hardware_accelerated = false;
info.supports_simulcast = false;
return info;

Просмотреть файл

@ -18,7 +18,6 @@ extern "C" {
#include "nr_socket_multi_tcp.h"
}
#include "stunserver.h"
#include "nricectx.h"

Просмотреть файл

@ -73,6 +73,7 @@ class WorkletGlobalScope : public nsIGlobalObject, public nsWrapperCache {
~WorkletGlobalScope();
const RefPtr<WorkletImpl> mImpl;
private:
TimeStamp mCreationTimeStamp;
RefPtr<Console> mConsole;

Просмотреть файл

@ -135,9 +135,7 @@ struct BaseMargin {
return Sub(top - aMargin.top, right - aMargin.right,
bottom - aMargin.bottom, left - aMargin.left);
}
Sub operator-() const {
return Sub(-top, -right, -bottom, -left);
}
Sub operator-() const { return Sub(-top, -right, -bottom, -left); }
Sub& operator+=(const Sub& aMargin) {
top += aMargin.top;
right += aMargin.right;

Просмотреть файл

@ -292,12 +292,16 @@ static sk_sp<SkImage> GetSkImageForSurface(SourceSurface* aSurface,
}
DrawTargetSkia::DrawTargetSkia()
: mCanvas(nullptr), mSnapshot(nullptr), mSnapshotLock {
"DrawTargetSkia::mSnapshotLock"
}
: mCanvas(nullptr),
mSnapshot(nullptr),
mSnapshotLock{"DrawTargetSkia::mSnapshotLock"}
#ifdef MOZ_WIDGET_COCOA
, mCG(nullptr), mColorSpace(nullptr), mCanvasData(nullptr), mCGSize(0, 0),
mNeedLayer(false)
,
mCG(nullptr),
mColorSpace(nullptr),
mCanvasData(nullptr),
mCGSize(0, 0),
mNeedLayer(false)
#endif
{
}

Просмотреть файл

@ -93,13 +93,11 @@ bool WGLLibrary::EnsureInitialized() {
}
}
#define SYMBOL(X) \
{ \
(PRFuncPtr*)&mSymbols.f##X, { \
{ "wgl" #X } \
} \
#define SYMBOL(X) {(PRFuncPtr*)&mSymbols.f##X, {{"wgl" #X}}}
#define END_OF_SYMBOLS \
{ \
nullptr, {} \
}
#define END_OF_SYMBOLS {nullptr, {}}
{
const auto loader = SymbolLoader(*mOGLLibrary);

Просмотреть файл

@ -10,7 +10,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/RLBoxUtils.h"
#include "mozilla/ScopeExit.h"
#include "opentype-sanitiser.h" // For ots_ntohl
#include "opentype-sanitiser.h" // For ots_ntohl
using namespace rlbox;
using namespace mozilla;
@ -49,7 +49,8 @@ tainted_woff2<BrotliDecoderResult> RLBoxBrotliDecoderDecompressCallback(
return res;
}
UniquePtr<RLBoxSandboxDataBase> RLBoxWOFF2SandboxPool::CreateSandboxData(uint64_t aSize) {
UniquePtr<RLBoxSandboxDataBase> RLBoxWOFF2SandboxPool::CreateSandboxData(
uint64_t aSize) {
// Create woff2 sandbox
auto sandbox = MakeUnique<rlbox_sandbox_woff2>();
@ -80,10 +81,9 @@ void RLBoxWOFF2SandboxPool::Initalize(size_t aDelaySeconds) {
ClearOnShutdown(&RLBoxWOFF2SandboxPool::sSingleton);
}
RLBoxWOFF2SandboxData::RLBoxWOFF2SandboxData(uint64_t aSize,
mozilla::UniquePtr<rlbox_sandbox_woff2> aSandbox)
: mozilla::RLBoxSandboxDataBase(aSize),
mSandbox(std::move(aSandbox)) {
RLBoxWOFF2SandboxData::RLBoxWOFF2SandboxData(
uint64_t aSize, mozilla::UniquePtr<rlbox_sandbox_woff2> aSandbox)
: mozilla::RLBoxSandboxDataBase(aSize), mSandbox(std::move(aSandbox)) {
MOZ_COUNT_CTOR(RLBoxWOFF2SandboxData);
}
@ -125,14 +125,13 @@ static uint32_t ComputeWOFF2FinalSize(const uint8_t* aData, size_t aLength) {
std::memcpy(&decompressedSize, location, sizeof(decompressedSize));
decompressedSize = ots_ntohl(decompressedSize);
if(!Woff2SizeValidator(aLength, decompressedSize)) {
if (!Woff2SizeValidator(aLength, decompressedSize)) {
return 0;
}
return decompressedSize;
}
template <typename T>
using TransferBufferToWOFF2 =
mozilla::RLBoxTransferBufferToSandbox<T, rlbox_woff2_sandbox_type>;
@ -159,8 +158,10 @@ bool RLBoxProcessWOFF2(ots::FontFile* aHeader, ots::OTSStream* aOutput,
// To account for misc allocations, we'll set the sandbox size to:
// twice the size of (input + output)
const uint64_t expectedSandboxSize = static_cast<uint64_t>(2 * (aLength + expectedSize));
auto sandboxPoolData = RLBoxWOFF2SandboxPool::sSingleton->PopOrCreate(expectedSandboxSize);
const uint64_t expectedSandboxSize =
static_cast<uint64_t>(2 * (aLength + expectedSize));
auto sandboxPoolData =
RLBoxWOFF2SandboxPool::sSingleton->PopOrCreate(expectedSandboxSize);
NS_ENSURE_TRUE(sandboxPoolData, false);
const auto* sandboxData =
@ -202,17 +203,19 @@ bool RLBoxProcessWOFF2(ots::FontFile* aHeader, ots::OTSStream* aOutput,
// the computed size (with ComputeWOFF2FinalSize) is wrong, so we can't
// trust the expectedSize to be the same as size sizep.
bool validateOK = false;
unsigned long actualSize = (*sizep.get()).copy_and_verify([&](unsigned long val){
validateOK = Woff2SizeValidator(aLength, val);
return val;
});
unsigned long actualSize =
(*sizep.get()).copy_and_verify([&](unsigned long val) {
validateOK = Woff2SizeValidator(aLength, val);
return val;
});
NS_ENSURE_TRUE(validateOK, false);
const uint8_t* decompressed = reinterpret_cast<const uint8_t*>(
(*bufp.get())
.unverified_safe_pointer_because(
actualSize, "Only care that the buffer is within sandbox boundary."));
actualSize,
"Only care that the buffer is within sandbox boundary."));
// Since ProcessTT* memcpy from the buffer, make sure it's not null.
NS_ENSURE_TRUE(decompressed, false);

Просмотреть файл

@ -33,7 +33,8 @@ class RLBoxWOFF2SandboxData : public mozilla::RLBoxSandboxDataBase {
friend class RLBoxWOFF2SandboxPool;
public:
RLBoxWOFF2SandboxData(uint64_t aSize, mozilla::UniquePtr<rlbox_sandbox_woff2> aSandbox);
RLBoxWOFF2SandboxData(uint64_t aSize,
mozilla::UniquePtr<rlbox_sandbox_woff2> aSandbox);
~RLBoxWOFF2SandboxData();
rlbox_sandbox_woff2* Sandbox() const { return mSandbox.get(); }

Просмотреть файл

@ -29,8 +29,8 @@ class RLBoxWOFF2SandboxPool : public mozilla::RLBoxSandboxPool {
static void Initalize(size_t aDelaySeconds = 10);
protected:
mozilla::UniquePtr<mozilla::RLBoxSandboxDataBase> CreateSandboxData(uint64_t aSize)
override;
mozilla::UniquePtr<mozilla::RLBoxSandboxDataBase> CreateSandboxData(
uint64_t aSize) override;
~RLBoxWOFF2SandboxPool() = default;
};

Просмотреть файл

@ -168,13 +168,16 @@ RefPtr<GenericNonExclusivePromise> UtilityProcessManager::LaunchProcess(
GetMainThreadSerialEventTarget(), __func__,
[self, p, aSandbox](bool) {
if (self->IsShutdown()) {
NS_WARNING("Reject LaunchProcess() after LaunchPromise() for Shutdown");
NS_WARNING(
"Reject LaunchProcess() after LaunchPromise() for Shutdown");
return GenericNonExclusivePromise::CreateAndReject(
NS_ERROR_NOT_AVAILABLE, __func__);
}
if (self->IsProcessDestroyed(aSandbox)) {
NS_WARNING("Reject LaunchProcess() after LaunchPromise() for destroyed process");
NS_WARNING(
"Reject LaunchProcess() after LaunchPromise() for destroyed "
"process");
return GenericNonExclusivePromise::CreateAndReject(
NS_ERROR_NOT_AVAILABLE, __func__);
}
@ -303,7 +306,8 @@ UtilityProcessManager::StartAudioDecoding(base::ProcessId aOtherProcess) {
MOZ_ASSERT_UNREACHABLE(
"PUtilityAudioDecoder: failure when starting actor");
}
NS_WARNING("Reject StartAudioDecoding() for StartUtility() rejection");
NS_WARNING(
"Reject StartAudioDecoding() for StartUtility() rejection");
return AudioDecodingPromise::CreateAndReject(aError, __func__);
});
}

Просмотреть файл

@ -261,25 +261,25 @@ class JS_PUBLIC_API TransitiveCompileOptions {
bool mutedErrors() const { return mutedErrors_; }
bool forceFullParse() const {
return eagerDelazificationIsOneOf<
DelazificationOption::ParseEverythingEagerly>();
DelazificationOption::ParseEverythingEagerly>();
}
bool forceStrictMode() const { return forceStrictMode_; }
bool consumeDelazificationCache() const {
return eagerDelazificationIsOneOf<
DelazificationOption::ConcurrentDepthFirst>();
DelazificationOption::ConcurrentDepthFirst>();
}
bool populateDelazificationCache() const {
return eagerDelazificationIsOneOf<
DelazificationOption::CheckConcurrentWithOnDemand,
DelazificationOption::ConcurrentDepthFirst>();
DelazificationOption::CheckConcurrentWithOnDemand,
DelazificationOption::ConcurrentDepthFirst>();
}
bool waitForDelazificationCache() const {
return eagerDelazificationIsOneOf<
DelazificationOption::CheckConcurrentWithOnDemand>();
DelazificationOption::CheckConcurrentWithOnDemand>();
}
bool checkDelazificationCache() const {
return eagerDelazificationIsOneOf<
DelazificationOption::CheckConcurrentWithOnDemand>();
DelazificationOption::CheckConcurrentWithOnDemand>();
}
DelazificationOption eagerDelazificationStrategy() const {
return eagerDelazificationStrategy_;

Просмотреть файл

@ -1084,10 +1084,10 @@ class JS_PUBLIC_API AutoCheckCannotGC : public AutoAssertNoGC {
AutoCheckCannotGC(const AutoCheckCannotGC& other) : AutoCheckCannotGC() {}
# endif
#else
class JS_PUBLIC_API AutoCheckCannotGC : public AutoRequireNoGC{
public :
explicit AutoCheckCannotGC(JSContext* cx = nullptr){} AutoCheckCannotGC(
const AutoCheckCannotGC& other) : AutoCheckCannotGC(){}
class JS_PUBLIC_API AutoCheckCannotGC : public AutoRequireNoGC {
public:
explicit AutoCheckCannotGC(JSContext* cx = nullptr) {}
AutoCheckCannotGC(const AutoCheckCannotGC& other) : AutoCheckCannotGC() {}
#endif
} JS_HAZ_GC_INVALIDATED;

Просмотреть файл

@ -231,7 +231,8 @@ template <typename Unit>
if (input.options.populateDelazificationCache() &&
!cx->isHelperThreadContext()) {
BorrowingCompilationStencil borrowingStencil(*extensibleStencil);
if (!StartOffThreadDelazification(cx, input.options, borrowingStencil)) {
if (!StartOffThreadDelazification(cx, input.options,
borrowingStencil)) {
return false;
}
@ -1208,11 +1209,15 @@ static bool CompileLazyFunctionToStencilMaybeInstantiate(
// Cached results might be removed by GCs.
if (res == GetCachedResult::Found) {
auto& concurrentSharedData = cached.as<OutputType>().get()->sharedData;
auto concurrentData = concurrentSharedData.isSingle() ?
concurrentSharedData.asSingle()->get()->immutableData() :
concurrentSharedData.asBorrow()->asSingle()->get()->immutableData();
auto concurrentData =
concurrentSharedData.isSingle()
? concurrentSharedData.asSingle()->get()->immutableData()
: concurrentSharedData.asBorrow()
->asSingle()
->get()
->immutableData();
auto ondemandData =
compilationState.sharedData.asSingle()->get()->immutableData();
compilationState.sharedData.asSingle()->get()->immutableData();
MOZ_RELEASE_ASSERT(concurrentData.Length() == ondemandData.Length(),
"Non-deterministic stencils");
for (size_t i = 0; i < concurrentData.Length(); i++) {

Просмотреть файл

@ -1239,8 +1239,7 @@ class ListNode : public ParseNode {
void checkConsistency() const
#ifndef DEBUG
{
}
{}
#endif
;

Просмотреть файл

@ -4523,12 +4523,10 @@ static void WorkerMain(UniquePtr<WorkerInput> input) {
}
JS::CompileOptions options(cx);
options
.setFileAndLine("<string>", 1)
options.setFileAndLine("<string>", 1)
.setIsRunOnce(true)
.setEagerDelazificationStrategy(defaultDelazificationMode);
AutoReportException are(cx);
JS::SourceText<char16_t> srcBuf;
if (!srcBuf.init(cx, input->chars.get(), input->length,
@ -10911,8 +10909,8 @@ static bool OptionFailure(const char* option, const char* str) {
const char* code = codeChunks.front();
JS::CompileOptions opts(cx);
opts.setFileAndLine("-e", 1)
.setEagerDelazificationStrategy(defaultDelazificationMode);
opts.setFileAndLine("-e", 1).setEagerDelazificationStrategy(
defaultDelazificationMode);
JS::SourceText<Utf8Unit> srcBuf;
if (!srcBuf.init(cx, code, strlen(code), JS::SourceOwnership::Borrowed)) {

Просмотреть файл

@ -675,8 +675,7 @@ struct DelazifyTask : public mozilla::LinkedListElement<DelazifyTask>,
// Create a new DelazifyTask and initialize it.
static UniquePtr<DelazifyTask> Create(
JSContext* cx,
JSRuntime* runtime,
JSContext* cx, JSRuntime* runtime,
const JS::ContextOptions& contextOptions,
const JS::ReadOnlyCompileOptions& options,
const frontend::CompilationStencil& stencil);

Просмотреть файл

@ -654,8 +654,8 @@ void ParseTask::scheduleDelazifyTask(AutoLockHelperThreadState& lock) {
JSContext* cx = TlsContext.get();
AutoSetContextRuntime ascr(runtime);
task = DelazifyTask::Create(cx, runtime, contextOptions, options,
*stencil_);
task =
DelazifyTask::Create(cx, runtime, contextOptions, options, *stencil_);
if (!task) {
return;
}
@ -840,7 +840,6 @@ void MultiStencilsDecodeTask::parse(JSContext* cx) {
bool js::StartOffThreadDelazification(
JSContext* cx, const ReadOnlyCompileOptions& options,
const frontend::CompilationStencil& stencil) {
// Skip delazify tasks if we parse everything on-demand or ahead.
auto strategy = options.eagerDelazificationStrategy();
if (strategy == JS::DelazificationOption::OnDemandOnly ||
@ -919,12 +918,9 @@ bool DepthFirstDelazification::add(JSContext* cx,
}
UniquePtr<DelazifyTask> DelazifyTask::Create(
JSContext* cx,
JSRuntime* runtime,
const JS::ContextOptions& contextOptions,
JSContext* cx, JSRuntime* runtime, const JS::ContextOptions& contextOptions,
const JS::ReadOnlyCompileOptions& options,
const frontend::CompilationStencil& stencil)
{
const frontend::CompilationStencil& stencil) {
// DelazifyTask are capturing errors. This is created here to capture errors
// as-if they were part of the to-be constructed DelazifyTask. This is also
// the reason why we move this structure to the DelazifyTask once created.

Просмотреть файл

@ -23,9 +23,8 @@ static inline bool IsTearoffClass(const JSClass* clazz) {
XPCCallContext::XPCCallContext(
JSContext* cx, HandleObject obj /* = nullptr */,
HandleObject funobj /* = nullptr */,
HandleId name /* = JSID_VOID */,
unsigned argc /* = NO_ARGS */, Value* argv /* = nullptr */,
Value* rval /* = nullptr */)
HandleId name /* = JSID_VOID */, unsigned argc /* = NO_ARGS */,
Value* argv /* = nullptr */, Value* rval /* = nullptr */)
: mState(INIT_FAILED),
mXPC(nsXPConnect::XPConnect()),
mXPCJSContext(nullptr),

Просмотреть файл

@ -95,13 +95,13 @@ struct
already_AddRefed(already_AddRefed<T>&& aOther)
#ifdef DEBUG
: mRawPtr(aOther.take()) {
}
: mRawPtr(aOther.take()){}
#else
= default;
#endif
already_AddRefed<T>& operator=(already_AddRefed<T>&& aOther) {
already_AddRefed<T> &
operator=(already_AddRefed<T>&& aOther) {
mRawPtr = aOther.take();
return *this;
}

Просмотреть файл

@ -50,6 +50,9 @@ TEST(PrefsBasics, Serialize)
ASSERT_NE(nullptr, strstr(str.Data(), "I--:"));
ASSERT_NE(nullptr, strstr(str.Data(), "S--:"));
// Assert that something was sanitized
ASSERT_NE(nullptr,
strstr(str.Data(), "I-S:56/datareporting.policy.dataSubmissionPolicyAcceptedVersion"));
ASSERT_NE(
nullptr,
strstr(
str.Data(),
"I-S:56/datareporting.policy.dataSubmissionPolicyAcceptedVersion"));
}

Просмотреть файл

@ -883,7 +883,8 @@ static void DoFramePointerStackWalk(MozWalkStackCallback aCallback,
// code is not using frame pointers when returning, it might actually
// recover just fine.
static const uintptr_t kMaxStackSize = 8 * 1024 * 1024;
if (uintptr_t(aBp) < uintptr_t(aStackEnd) - std::min(kMaxStackSize, uintptr_t(aStackEnd)) ||
if (uintptr_t(aBp) < uintptr_t(aStackEnd) -
std::min(kMaxStackSize, uintptr_t(aStackEnd)) ||
aBp >= aStackEnd || (uintptr_t(aBp) & 3)) {
return;
}

Просмотреть файл

@ -104,7 +104,8 @@ class BaseWebSocketChannel : public nsIWebSocketChannel,
nsCOMPtr<nsITransportProvider> mServerTransportProvider;
// Used to ensure atomicity of mTargetThread.
// Set before AsyncOpen via RetargetDeliveryTo or in AsyncOpen, never changed after AsyncOpen
// Set before AsyncOpen via RetargetDeliveryTo or in AsyncOpen, never changed
// after AsyncOpen
DataMutex<nsCOMPtr<nsIEventTarget>> mTargetThread{
"BaseWebSocketChannel::EventTargetMutex"};

Просмотреть файл

@ -1143,7 +1143,7 @@ class SandboxPolicyCommon : public SandboxPolicyBase {
Arg<unsigned long> request(1);
#ifdef MOZ_ASAN
Arg<int> fd(0);
#endif // MOZ_ASAN
#endif // MOZ_ASAN
// Make isatty() return false, because none of the terminal
// ioctls will be allowed; libraries sometimes call this for
// various reasons (e.g., to decide whether to emit ANSI/VT
@ -1156,7 +1156,7 @@ class SandboxPolicyCommon : public SandboxPolicyBase {
#ifdef MOZ_ASAN
// ASAN's error reporter wants to know if stderr is a tty.
.ElseIf(fd == STDERR_FILENO, Error(ENOTTY))
#endif // MOZ_ASAN
#endif // MOZ_ASAN
.Else(SandboxPolicyBase::EvaluateSyscall(sysno));
}
@ -1177,7 +1177,7 @@ class SandboxPolicyCommon : public SandboxPolicyBase {
// (See also bug 1081242 comment #7.)
CASES_FOR_stat:
return Error(ENOENT);
#endif // MOZ_ASAN
#endif // MOZ_ASAN
default:
return SandboxPolicyBase::EvaluateSyscall(sysno);

Просмотреть файл

@ -5,7 +5,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef MOZ_WIDGET_GTK
# ifdef MOZ_ENABLE_DBUS
# include "nsDBusRemoteServer.h"

Просмотреть файл

@ -22,14 +22,14 @@ namespace system {
static void NormalizeAddr(const nsACString& aAddr, nsCString& aNormalized) {
nsTArray<nsCString> addr;
ParseString(aAddr, '.', addr);
aNormalized = StringJoin("."_ns, IntegerRange(4),
[&addr](nsACString& dst, size_t i) {
if (i < addr.Length()) {
dst.Append(addr[i]);
} else {
dst.Append('0');
}
});
aNormalized =
StringJoin("."_ns, IntegerRange(4), [&addr](nsACString& dst, size_t i) {
if (i < addr.Length()) {
dst.Append(addr[i]);
} else {
dst.Append('0');
}
});
}
static PRUint32 MaskIPv4Addr(PRUint32 aAddr, uint16_t aMaskLen) {

Просмотреть файл

@ -41,12 +41,14 @@ class ModuleLoadCounter final {
for (size_t i = 0; i < N; ++i) {
auto entry = mCounters.Lookup(aNames[i]);
if (!entry) {
wprintf(L"%s is not registered.\n", static_cast<const wchar_t*>(aNames[i].get()));
wprintf(L"%s is not registered.\n",
static_cast<const wchar_t*>(aNames[i].get()));
result = false;
} else if (*entry != aCounts[i]) {
// We can return false, but let's print out all unmet modules
// which may be helpful to investigate test failures.
wprintf(L"%s:%4d\n", static_cast<const wchar_t*>(aNames[i].get()), *entry);
wprintf(L"%s:%4d\n", static_cast<const wchar_t*>(aNames[i].get()),
*entry);
result = false;
}
}

Просмотреть файл

@ -62,9 +62,7 @@ mozilla::StaticRefPtr<nsITransferable> nsClipboard::sSelectionCache;
nsClipboard::nsClipboard() : nsBaseClipboard(), mCachedClipboard(-1), mChangeCount(0) {}
nsClipboard::~nsClipboard() {
ClearSelectionCache();
}
nsClipboard::~nsClipboard() { ClearSelectionCache(); }
NS_IMPL_ISUPPORTS_INHERITED0(nsClipboard, nsBaseClipboard)

Просмотреть файл

@ -59,7 +59,7 @@ class nsMenuItemIconX final : public mozilla::widget::IconLoader::Listener {
// GetIconURI returns null if the item should not have any icon.
already_AddRefed<nsIURI> GetIconURI(nsIContent* aContent);
Listener* mListener; // [weak]
Listener* mListener; // [weak]
nsIntRect mImageRegionRect;
RefPtr<const mozilla::ComputedStyle> mComputedStyle;
RefPtr<nsPresContext> mPresContext;

Просмотреть файл

@ -13,7 +13,8 @@
@end
typedef NSString* NSTouchBarItemIdentifier;
__attribute__((weak_import)) @interface NSTouchBarItem : NSObject
__attribute__((weak_import))
@interface NSTouchBarItem : NSObject
@property(readonly) NSView* view;
@property(readonly) NSString* customizationLabel;
- (instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)aIdentifier;
@ -22,12 +23,14 @@ __attribute__((weak_import)) @interface NSTouchBarItem : NSObject
@protocol NSSharingServicePickerTouchBarItemDelegate
@end
__attribute__((weak_import)) @interface NSSharingServicePickerTouchBarItem : NSTouchBarItem
__attribute__((weak_import))
@interface NSSharingServicePickerTouchBarItem : NSTouchBarItem
@property(strong) id<NSSharingServicePickerTouchBarItemDelegate> delegate;
@property(strong) NSImage* buttonImage;
@end
__attribute__((weak_import)) @interface NSCustomTouchBarItem : NSTouchBarItem
__attribute__((weak_import))
@interface NSCustomTouchBarItem : NSTouchBarItem
@property(strong) NSView* view;
@property(strong) NSString* customizationLabel;
@end
@ -36,7 +39,8 @@ __attribute__((weak_import)) @interface NSCustomTouchBarItem : NSTouchBarItem
@end
typedef NSString* NSTouchBarCustomizationIdentifier;
__attribute__((weak_import)) @interface NSTouchBar : NSObject
__attribute__((weak_import))
@interface NSTouchBar : NSObject
@property(strong) NSArray<NSTouchBarItemIdentifier>* defaultItemIdentifiers;
@property(strong) id<NSTouchBarDelegate> delegate;
@property(strong) NSTouchBarCustomizationIdentifier customizationIdentifier;
@ -44,7 +48,8 @@ __attribute__((weak_import)) @interface NSTouchBar : NSObject
- (NSTouchBarItem*)itemForIdentifier:(NSTouchBarItemIdentifier)aIdentifier;
@end
__attribute__((weak_import)) @interface NSPopoverTouchBarItem : NSTouchBarItem
__attribute__((weak_import))
@interface NSPopoverTouchBarItem : NSTouchBarItem
@property(strong) NSString* customizationLabel;
@property(strong) NSView* collapsedRepresentation;
@property(strong) NSImage* collapsedRepresentationImage;

Просмотреть файл

@ -49,12 +49,12 @@
@private
}
- (id)initWithWindow:(NSWindow*)inWindow;
+ (void)activateInWindow:(NSWindow*)aWindow;
+ (void)deactivateInWindow:(NSWindow*)aWindow;
+ (void)activateInWindowViews:(NSWindow*)aWindow;
+ (void)deactivateInWindowViews:(NSWindow*)aWindow;
- (id)initWithWindow:(NSWindow*)inWindow;
+ (void)activateInWindow:(NSWindow*)aWindow;
+ (void)deactivateInWindow:(NSWindow*)aWindow;
+ (void)activateInWindowViews:(NSWindow*)aWindow;
+ (void)deactivateInWindowViews:(NSWindow*)aWindow;
@end
@end
#endif // nsWindowMap_h_

Просмотреть файл

@ -56,9 +56,7 @@ typedef void (*DestroySurfaceFunc)(struct gbm_surface*);
class nsGbmLib {
public:
static bool IsAvailable() {
return sLoaded || Load();
}
static bool IsAvailable() { return sLoaded || Load(); }
static bool IsModifierAvailable();
static struct gbm_device* CreateDevice(int fd) {

Просмотреть файл

@ -32,7 +32,8 @@ nsDeviceContextSpecProxy::nsDeviceContextSpecProxy(
nsDeviceContextSpecProxy::~nsDeviceContextSpecProxy() = default;
NS_IMETHODIMP
nsDeviceContextSpecProxy::Init(nsIPrintSettings* aPrintSettings, bool aIsPrintPreview) {
nsDeviceContextSpecProxy::Init(nsIPrintSettings* aPrintSettings,
bool aIsPrintPreview) {
mPrintSettings = aPrintSettings;
if (aIsPrintPreview) {

Просмотреть файл

@ -88,7 +88,8 @@ class MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS CAPABILITY StaticMonitor {
class MOZ_STACK_CLASS SCOPED_CAPABILITY StaticMonitorAutoLock {
public:
explicit StaticMonitorAutoLock(StaticMonitor& aMonitor) CAPABILITY_ACQUIRE(aMonitor)
explicit StaticMonitorAutoLock(StaticMonitor& aMonitor)
CAPABILITY_ACQUIRE(aMonitor)
: mMonitor(&aMonitor) {
mMonitor->Lock();
}

Просмотреть файл

@ -676,7 +676,6 @@ class nsTSubstring : public mozilla::detail::nsTStringRepr<T> {
void CompressWhitespace(bool aEliminateLeading = true,
bool aEliminateTrailing = true);
void Append(char_type aChar);
[[nodiscard]] bool Append(char_type aChar, const fallible_t& aFallible);

Просмотреть файл

@ -33,7 +33,9 @@ class CAPABILITY Monitor {
void Unlock() CAPABILITY_RELEASE() { mMutex.Unlock(); }
void Wait() REQUIRES(this) { mCondVar.Wait(); }
CVStatus Wait(TimeDuration aDuration) REQUIRES(this) { return mCondVar.Wait(aDuration); }
CVStatus Wait(TimeDuration aDuration) REQUIRES(this) {
return mCondVar.Wait(aDuration);
}
void Notify() { mCondVar.Notify(); }
void NotifyAll() { mCondVar.NotifyAll(); }
@ -254,7 +256,7 @@ class SCOPED_CAPABILITY MOZ_STACK_CLASS ReleasableMonitorAutoLock {
// See BaseMonitorAutoLock::Wait
void Wait() {
mMonitor->AssertCurrentThreadOwns(); // someone could have called Unlock()
mMonitor->AssertCurrentThreadOwns(); // someone could have called Unlock()
mMonitor->Wait();
}
CVStatus Wait(TimeDuration aDuration) {

Просмотреть файл

@ -146,7 +146,8 @@ class MOZ_RAII BaseAutoTryWriteLock {
template <typename T>
class SCOPED_CAPABILITY MOZ_RAII BaseAutoWriteLock final {
public:
explicit BaseAutoWriteLock(T& aLock) CAPABILITY_ACQUIRE(aLock) : mLock(&aLock) {
explicit BaseAutoWriteLock(T& aLock) CAPABILITY_ACQUIRE(aLock)
: mLock(&aLock) {
MOZ_ASSERT(mLock, "null lock");
mLock->WriteLock();
}

Просмотреть файл

@ -79,7 +79,9 @@ class MOZ_RAII SCOPED_CAPABILITY RecursiveMutexAutoLock {
mRecursiveMutex->Lock();
}
~RecursiveMutexAutoLock(void) CAPABILITY_RELEASE() { mRecursiveMutex->Unlock(); }
~RecursiveMutexAutoLock(void) CAPABILITY_RELEASE() {
mRecursiveMutex->Unlock();
}
private:
RecursiveMutexAutoLock() = delete;