Bug 1519636 - Reformat recent changes to the Google coding style r=andi

Updated with Debian clang-format version 11.0.1-1

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D100934
This commit is contained in:
Sylvestre Ledru 2021-01-06 17:17:23 +00:00
parent f5d986aec7
commit b58ddc19df
23 changed files with 42 additions and 38 deletions

View File

@ -24,4 +24,4 @@ enum class EWhichPostFilter { eContainsText };
} // namespace a11y
} // namespace mozilla
#endif // mozilla_a11y_PlatformExtTypes_h__
#endif // mozilla_a11y_PlatformExtTypes_h__

View File

@ -120,7 +120,6 @@ class nsDocShellLoadState final {
void SetPrincipalIsExplicit(bool aPrincipalIsExplicit);
// If true, "beforeunload" event listeners were notified by the creater of the
// LoadState and given the chance to abort the navigation, and should not be
// notified again.

View File

@ -379,7 +379,8 @@ js::SliceBudget CCGCScheduler::ComputeCCSliceBudget(
// Note: We may have already overshot the deadline, in which case
// baseBudget will be negative and we will end up returning
// laterSliceBudget.
return js::SliceBudget(std::max({delaySliceBudget, laterSliceBudget, baseBudget}));
return js::SliceBudget(
std::max({delaySliceBudget, laterSliceBudget, baseBudget}));
}
inline TimeDuration CCGCScheduler::ComputeInterSliceGCBudget(

View File

@ -1639,7 +1639,7 @@ mozilla::ipc::IPCResult ContentChild::RecvSetProcessSandbox(
CrashReporter::Annotation::ContentSandboxCapabilities,
static_cast<int>(SandboxInfo::Get().AsInteger()));
# endif /* XP_LINUX && !OS_ANDROID */
#endif /* MOZ_SANDBOX */
#endif /* MOZ_SANDBOX */
return IPC_OK();
}
@ -2159,7 +2159,7 @@ void ContentChild::ActorDestroy(ActorDestroyReason why) {
CrashReporterClient::DestroySingleton();
XRE_ShutdownChildProcess();
#endif // NS_FREE_PERMANENT_DATA
#endif // NS_FREE_PERMANENT_DATA
}
void ContentChild::ProcessingError(Result aCode, const char* aReason) {

View File

@ -13,8 +13,7 @@
namespace mozilla::dom {
VsyncChild::VsyncChild()
: mIsShutdown(false),
mVsyncRate(TimeDuration::Forever()) {
: mIsShutdown(false), mVsyncRate(TimeDuration::Forever()) {
MOZ_ASSERT(NS_IsMainThread());
}
@ -71,8 +70,6 @@ mozilla::ipc::IPCResult VsyncChild::RecvNotify(const VsyncEvent& aVsync,
return IPC_OK();
}
TimeDuration VsyncChild::GetVsyncRate() {
return mVsyncRate;
}
TimeDuration VsyncChild::GetVsyncRate() { return mVsyncRate; }
} // namespace mozilla::dom

View File

@ -1945,10 +1945,9 @@ RefPtr<MediaManager::MgrPromise> MediaManager::EnumerateRawDevices(
// Need to ask permission to retrieve list of all devices;
// notify frontend observer and wait for callback notification to post task.
const char16_t* const type =
(aVideoInputType != MediaSourceEnum::Camera)
? u"audio"
: (aAudioInputType != MediaSourceEnum::Microphone) ? u"video"
: u"all";
(aVideoInputType != MediaSourceEnum::Camera) ? u"audio"
: (aAudioInputType != MediaSourceEnum::Microphone) ? u"video"
: u"all";
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
obs->NotifyObservers(static_cast<nsIRunnable*>(task),
"getUserMedia:ask-device-permission", type);

View File

@ -25,7 +25,9 @@ namespace gfx {
static const size_t NUM_CRASH_GUARD_TYPES = size_t(CrashGuardType::NUM_TYPES);
static const char* sCrashGuardNames[] = {
"d3d11layers", "glcontext", "wmfvpxvideo",
"d3d11layers",
"glcontext",
"wmfvpxvideo",
};
static_assert(MOZ_ARRAY_LENGTH(sCrashGuardNames) == NUM_CRASH_GUARD_TYPES,
"CrashGuardType updated without a name string");

View File

@ -789,7 +789,8 @@ WebRenderMemoryReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
helper.ReportTexture(aReport.texture_upload_pbos,
"texture-upload-pbos");
helper.ReportTexture(aReport.swap_chain, "swap-chains");
helper.ReportTexture(aReport.render_texture_hosts, "render-texture-hosts");
helper.ReportTexture(aReport.render_texture_hosts,
"render-texture-hosts");
FinishAsyncMemoryReport();
},

View File

@ -146,8 +146,8 @@ wr::WrExternalImage RenderAndroidHardwareBufferTextureHost::Lock(
void RenderAndroidHardwareBufferTextureHost::Unlock() {}
size_t RenderAndroidHardwareBufferTextureHost::Bytes() {
return GetSize().width * GetSize().height
* BytesPerPixel(mAndroidHardwareBuffer->mFormat);
return GetSize().width * GetSize().height *
BytesPerPixel(mAndroidHardwareBuffer->mFormat);
}
void RenderAndroidHardwareBufferTextureHost::DeleteTextureHandle() {

View File

@ -28,6 +28,7 @@ class RenderAndroidHardwareBufferTextureHost final : public RenderTextureHost {
void Unlock() override;
size_t Bytes() override;
private:
virtual ~RenderAndroidHardwareBufferTextureHost();
bool EnsureLockable(wr::ImageRendering aRendering);

View File

@ -29,9 +29,10 @@ class RenderDMABUFTextureHost final : public RenderTextureHost {
void ClearCachedResources() override;
size_t Bytes() override {
return mSurface->GetWidth() * mSurface->GetHeight()
* BytesPerPixel(mSurface->GetFormat());
return mSurface->GetWidth() * mSurface->GetHeight() *
BytesPerPixel(mSurface->GetFormat());
}
private:
virtual ~RenderDMABUFTextureHost();
void DeleteTextureHandle();

View File

@ -27,6 +27,7 @@ class RenderEGLImageTextureHost final : public RenderTextureHost {
// XXX: we don't have a format so we can't get bpp.
return mSize.width * mSize.height;
}
private:
virtual ~RenderEGLImageTextureHost();
void DeleteTextureHandle();

View File

@ -31,6 +31,7 @@ class RenderExternalTextureHost final : public RenderTextureHost {
size_t Bytes() override {
return mSize.width * mSize.height * BytesPerPixel(mFormat);
}
private:
~RenderExternalTextureHost();

View File

@ -30,6 +30,7 @@ class RenderSharedSurfaceTextureHost final : public RenderTextureHost {
wr::ImageRendering aRendering) override;
void Unlock() override;
size_t Bytes() override;
private:
virtual ~RenderSharedSurfaceTextureHost();

View File

@ -60,11 +60,12 @@ class RenderTextureHostSWGL : public RenderTextureHost {
size_t Bytes() override {
size_t bytes = 0;
for (auto &plane : mPlanes) {
for (auto& plane : mPlanes) {
bytes += plane.mStride * plane.mSize.height;
}
return bytes;
}
protected:
bool mLocked = false;
void* mContext = nullptr;

View File

@ -307,7 +307,8 @@ bool MessagePumpLibevent::CatchSignal(int sig, SignalEvent* sigevent,
void MessagePumpLibevent::OnLibeventSignalNotification(int sig, short flags,
void* context) {
AUTO_PROFILER_LABEL("MessagePumpLibevent::OnLibeventSignalNotification", OTHER);
AUTO_PROFILER_LABEL("MessagePumpLibevent::OnLibeventSignalNotification",
OTHER);
DCHECK(sig > 0);
DCHECK(EV_SIGNAL == flags);

View File

@ -10,7 +10,7 @@
#include "mozilla/ipc/SharedMemory.h"
#if defined(XP_MACOSX) && defined(__x86_64__)
#include "prenv.h"
# include "prenv.h"
#endif
namespace mozilla {

View File

@ -66,9 +66,7 @@ class JS_PUBLIC_API SliceBudget {
explicit SliceBudget(WorkBudget work);
explicit SliceBudget(mozilla::TimeDuration time)
: SliceBudget(TimeBudget(time.ToMilliseconds()))
{}
: SliceBudget(TimeBudget(time.ToMilliseconds())) {}
void makeUnlimited() {
MOZ_ASSERT(unlimitedDeadline);

View File

@ -421,7 +421,7 @@ static MOZ_MUST_USE PromiseObject* ReadableByteStreamControllerPullSteps(
MOZ_RELEASE_ASSERT(unwrappedStream->mode() ==
JS::ReadableStreamMode::ExternalSource);
#if 0 // disable user-defined byte streams
#if 0 // disable user-defined byte streams
if (unwrappedStream->mode() == JS::ReadableStreamMode::ExternalSource)
#endif // user-defined byte streams
{
@ -448,7 +448,7 @@ static MOZ_MUST_USE PromiseObject* ReadableByteStreamControllerPullSteps(
queueTotalSize = queueTotalSize - bytesWritten;
}
#if 0 // disable user-defined byte streams
#if 0 // disable user-defined byte streams
else {
// Step 3.b: Let entry be the first element of this.[[queue]].
// Step 3.c: Remove entry from this.[[queue]], shifting all other

View File

@ -30,7 +30,7 @@
#include "gc/Rooting.h"
#include "js/CallArgs.h"
#include "js/Class.h"
#include "js/experimental/Intl.h" // JS::AddMozDisplayNamesConstructor
#include "js/experimental/Intl.h" // JS::AddMozDisplayNamesConstructor
#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_*
#include "js/GCVector.h"
#include "js/PropertyDescriptor.h"

View File

@ -1262,10 +1262,10 @@ void js::Nursery::doPretenuring(JSRuntime* rt, JS::GCReason reason,
uint64_t zoneTenuredStrings =
zone->stringStats.ref().liveNurseryStrings -
zone->previousGCStringStats.ref().liveNurseryStrings;
double tenuredRate = allocThreshold
? double(zoneTenuredStrings) /
double(zone->nurseryAllocatedStrings)
: 0.0;
double tenuredRate =
allocThreshold
? double(zoneTenuredStrings) / double(zone->nurseryAllocatedStrings)
: 0.0;
bool disableNurseryStrings =
pretenureStr && zone->allocNurseryStrings &&
tenuredRate > tunables().pretenureStringThreshold();

View File

@ -1250,8 +1250,8 @@ static nsIContent* NextSiblingWhichMayHaveFrame(nsIContent* aContent) {
// If |aFrame| is dirty or has dirty children, then we can skip updating
// overflows since that will happen when it's reflowed.
static inline bool CanSkipOverflowUpdates(const nsIFrame* aFrame) {
return aFrame->HasAnyStateBits(
NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN);
return aFrame->HasAnyStateBits(NS_FRAME_IS_DIRTY |
NS_FRAME_HAS_DIRTY_CHILDREN);
}
void RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) {

View File

@ -1842,8 +1842,8 @@ const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
////////////////////////////////////
// FEATURE_WEBRENDER_SOFTWARE - ALLOWLIST
#ifdef NIGHTLY_BUILD
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \
defined(__i386) || defined(__amd64__)
# if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \
defined(__i386) || defined(__amd64__)
APPEND_TO_DRIVER_BLOCKLIST2_EXT(
OperatingSystem::Windows, ScreenSizeStatus::SmallAndMedium,
BatteryStatus::All, DesktopEnvironment::All, WindowProtocol::All,
@ -1851,7 +1851,7 @@ const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
nsIGfxInfo::FEATURE_WEBRENDER_SOFTWARE,
nsIGfxInfo::FEATURE_ALLOW_ALWAYS, DRIVER_COMPARISON_IGNORED,
V(0, 0, 0, 0), "FEATURE_ROLLOUT_NIGHTLY_SOFTWARE_WR_S_M_SCRN");
#endif
# endif
#endif
}
return *sDriverInfo;