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

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
This commit is contained in:
Sylvestre Ledru 2020-08-31 09:23:02 +00:00
parent 4d0b6a4061
commit 9c192aa9ca
27 changed files with 59 additions and 64 deletions

View File

@ -457,8 +457,7 @@ uint64_t Accessible::NativeInteractiveState() const {
uint64_t Accessible::NativeLinkState() const { return 0; }
bool Accessible::NativelyUnavailable() const {
if (mContent->IsHTMLElement())
return mContent->AsElement()->IsDisabled();
if (mContent->IsHTMLElement()) return mContent->AsElement()->IsDisabled();
return mContent->IsElement() && mContent->AsElement()->AttrValueIs(
kNameSpaceID_None, nsGkAtoms::disabled,

View File

@ -107,7 +107,6 @@ class ShadowRoot final : public DocumentFragment,
private:
bool IsStaticUAWidget() const { return mIsStaticUAWidget; }
void InsertSheetIntoAuthorData(size_t aIndex, StyleSheet&,
const nsTArray<RefPtr<StyleSheet>>&);
@ -206,9 +205,7 @@ class ShadowRoot final : public DocumentFragment,
// Whether we should clone this shadow root for printing. We usually don't
// clone UA widgets (because they're attached and setup on bind), but we need
// to clone "static" UA widgets, which don't.
bool ShouldStaticClone() const {
return !IsUAWidget() || IsStaticUAWidget();
}
bool ShouldStaticClone() const { return !IsUAWidget() || IsStaticUAWidget(); }
void SetIsUAWidget() {
MOZ_ASSERT(!HasChildren());

View File

@ -247,7 +247,6 @@ void nsFrameLoaderOwner::ChangeRemotenessToProcess(
mFrameLoader->ConfigRemoteProcess(aContentParent->GetRemoteType(),
aContentParent);
}
};
auto shouldPreserve =

View File

@ -5208,8 +5208,8 @@ static CallState CollectDocuments(Document& aDoc,
return CallState::Continue;
}
static void DispatchPrintEventToWindowTree(
Document& aDoc, const nsAString& aEvent) {
static void DispatchPrintEventToWindowTree(Document& aDoc,
const nsAString& aEvent) {
if (aDoc.IsStaticDocument()) {
return;
}

View File

@ -779,8 +779,8 @@ class ContentChild final : public PContentChild,
nsDocShellLoadState* aLoadState, bool aSetNavigating,
LoadURIResolver&& aResolve);
mozilla::ipc::IPCResult RecvInternalLoad(
nsDocShellLoadState* aLoadState, bool aTakeFocus);
mozilla::ipc::IPCResult RecvInternalLoad(nsDocShellLoadState* aLoadState,
bool aTakeFocus);
mozilla::ipc::IPCResult RecvDisplayLoadError(
const MaybeDiscarded<BrowsingContext>& aContext, const nsAString& aURI);

View File

@ -1695,7 +1695,8 @@ class RenderSourceLMC : public profiler_screenshots::RenderSource {
class DownscaleTargetLMC : public profiler_screenshots::DownscaleTarget {
public:
explicit DownscaleTargetLMC(CompositingRenderTarget* aRT, Compositor* aCompositor)
explicit DownscaleTargetLMC(CompositingRenderTarget* aRT,
Compositor* aCompositor)
: profiler_screenshots::DownscaleTarget(aRT->GetSize()),
mRenderSource(new RenderSourceLMC(aRT)),
mCompositor(aCompositor) {}

View File

@ -1100,9 +1100,9 @@ const float kBT2020NarrowYCbCrToRGB_RowMajor[16] = {
-0.65042f, 0.34746f, 1.16438f, 2.14177f, 0.00000f, -1.14815f,
0.00000f, 0.00000f, 0.00000f, 1.00000f};
const float kIdentityNarrowYCbCrToRGB_RowMajor[16] = {
0.00000f, 0.00000f, 1.00000f, 0.00000f, 1.00000f, 0.00000f,
0.00000f, 0.00000f, 1.00000f, 0.00000f, 1.00000f, 0.00000f,
0.00000f, 0.00000f, 0.00000f, 1.00000f, 0.00000f, 0.00000f,
0.00000f, 0.00000f, 0.00000f, 1.00000f};
0.00000f, 0.00000f, 0.00000f, 1.00000f};
/* static */ const float* gfxUtils::YuvToRgbMatrix4x3RowMajor(
gfx::YUVColorSpace aYUVColorSpace) {

View File

@ -21,11 +21,11 @@
#include "jstypes.h" // JS_FRIEND_API
#include "js/HeapAPI.h" // JS::shadow::String
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
#include "js/HeapAPI.h" // JS::shadow::String
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
#include "js/shadow/String.h" // JS::shadow::String
#include "js/TypeDecls.h" // JSContext, JS::Latin1Char, JSString
#include "js/Vector.h" // js::Vector
#include "js/TypeDecls.h" // JSContext, JS::Latin1Char, JSString
#include "js/Vector.h" // js::Vector
class JSLinearString;

View File

@ -37,7 +37,7 @@
#include "vm/Runtime.h" // JSAtomState, JSRuntime
#include "vm/StringType.h" // js::EqualStrings, js::ToString
#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheck{Argument,This,Value}
#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheck{Argument,This,Value}
#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance
#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing

View File

@ -35,9 +35,9 @@
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::ResolveUnwrappedPromiseWithValue
#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapReaderFromStream
#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::Unwrap{Callee,Internal}Slot
#include "vm/JSContext-inl.h" // JSContext::check
#include "vm/JSObject-inl.h" // js::IsCallable, js::NewObjectWithClassProto
#include "vm/Realm-inl.h" // js::AutoRealm
#include "vm/JSContext-inl.h" // JSContext::check
#include "vm/JSObject-inl.h" // js::IsCallable, js::NewObjectWithClassProto
#include "vm/Realm-inl.h" // js::AutoRealm
using js::IsCallable;
using js::NewHandler;

View File

@ -394,7 +394,7 @@ class WellKnownParserAtoms {
public:
WellKnownParserAtoms() = default;
bool init(JSContext * cx);
bool init(JSContext* cx);
template <typename CharT>
const ParserAtom* lookupChar16Seq(InflatedChar16Sequence<CharT> seq) const;

View File

@ -1061,7 +1061,7 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
fprintf(stderr, "(map %p is %s, key %p is %s, value %p is %s)\n", map,
map->mapColor.name(), key, keyColor.name(), value,
valueColor.name());
#ifdef DEBUG
# ifdef DEBUG
fprintf(stderr, "Key:\n");
key->dump();
if (auto delegate = MaybeGetDelegate(key); delegate) {
@ -1070,7 +1070,7 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
}
fprintf(stderr, "Value:\n");
value->dump();
#endif
# endif
ok = false;
}

View File

@ -22,7 +22,7 @@
#include "js/shadow/Function.h" // JS::shadow::Function
#include "js/shadow/Object.h" // JS::shadow::Object
#include "js/shadow/ObjectGroup.h" // JS::shadow::ObjectGroup
#include "js/shadow/String.h" // JS::shadow::String
#include "js/shadow/String.h" // JS::shadow::String
#include "js/TypeDecls.h"
#include "js/Utility.h"

View File

@ -713,7 +713,7 @@ class BaseShape : public gc::TenuredCellWithNonGCPointer<const JSClass> {
/* Class of referring object, stored in the cell header */
const JSClass* clasp() const { return headerPtr(); }
uint32_t flags; /* Vector of above flags. */
uint32_t flags; /* Vector of above flags. */
/* For owned BaseShapes, the canonical unowned BaseShape. */
GCPtrUnownedBaseShape unowned_;

View File

@ -1209,8 +1209,7 @@ class FuncType {
// but are guarded against separately.
bool temporarilyUnsupportedReftypeForEntry() const {
for (ValType arg : args()) {
if (arg.isReference() &&
(!arg.isExternRef() || !arg.isNullable())) {
if (arg.isReference() && (!arg.isExternRef() || !arg.isNullable())) {
return true;
}
}
@ -1226,8 +1225,7 @@ class FuncType {
// excluded per spec but are guarded against separately.
bool temporarilyUnsupportedReftypeForInlineEntry() const {
for (ValType arg : args()) {
if (arg.isReference() &&
(!arg.isExternRef() || !arg.isNullable())) {
if (arg.isReference() && (!arg.isExternRef() || !arg.isNullable())) {
return true;
}
}
@ -1249,8 +1247,7 @@ class FuncType {
}
for (ValType result : results()) {
if (result.isReference() &&
(!result.isExternRef() ||
!result.isNullable())) {
(!result.isExternRef() || !result.isNullable())) {
return true;
}
}

View File

@ -1923,7 +1923,8 @@ static bool DecodeTableTypeAndLimits(Decoder& d, bool refTypesEnabled,
maximumLength = Some(uint32_t(*limits.maximum));
}
return tables->emplaceBack(tableElemType, initialLength, maximumLength, /* isAsmJS */ false);
return tables->emplaceBack(tableElemType, initialLength, maximumLength,
/* isAsmJS */ false);
}
static bool GlobalIsJSCompatible(Decoder& d, ValType type) {

View File

@ -6650,8 +6650,8 @@ void PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent) {
if (rootFrame->PresContext()->IsRootContentDocumentCrossProcess()) {
relativeTo.mViewportType = ViewportType::Visual;
}
mMouseLocation = nsLayoutUtils::GetEventCoordinatesRelativeTo(
aEvent, relativeTo);
mMouseLocation =
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, relativeTo);
mMouseEventTargetGuid = InputAPZContext::GetTargetLayerGuid();
}
mMouseLocationWasSetBySynthesizedMouseEventForTests =

View File

@ -5122,9 +5122,10 @@ NS_IMETHODIMP nsIFrame::HandleRelease(nsPresContext* aPresContext,
frameSelection->SetDragState(false);
frameSelection->StopAutoScrollTimer();
if (wf.IsAlive()) {
nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetNearestScrollableFrame(
this, nsLayoutUtils::SCROLLABLE_SAME_DOC |
nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
nsIScrollableFrame* scrollFrame =
nsLayoutUtils::GetNearestScrollableFrame(
this, nsLayoutUtils::SCROLLABLE_SAME_DOC |
nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
if (scrollFrame) {
// Perform any additional scrolling needed to maintain CSS snap point
// requirements when autoscrolling is over.

View File

@ -659,9 +659,7 @@ static uint32_t gGCStackTraceTableWhenSizeExceeds = 4 * 1024;
"movq (%%rbp), %0\n\t"
: "=r"(fp));
# else
asm(
"ldr %0, [x29]\n\t"
: "=r"(fp));
asm("ldr %0, [x29]\n\t" : "=r"(fp));
# endif
void* stackEnd = pthread_get_stackaddr_np(pthread_self());
FramePointerStackWalk(StackWalkCallback, /* skipFrames = */ 0, MaxFrames,

View File

@ -204,7 +204,7 @@ static void PlatformInit(PSLockRef aLock) {}
#if defined(HAVE_NATIVE_UNWIND)
void Registers::SyncPopulate() {
#if defined(__x86_64__)
# if defined(__x86_64__)
asm(
// Compute caller's %rsp by adding to %rbp:
// 8 bytes for previous %rbp, 8 bytes for return address
@ -212,7 +212,7 @@ void Registers::SyncPopulate() {
// Dereference %rbp to get previous %rbp
"movq (%%rbp), %1\n\t"
: "=r"(mSP), "=r"(mFP));
#elif defined(__aarch64__)
# elif defined(__aarch64__)
asm(
// Compute caller's sp by adding to fp:
// 8 bytes for previous fp, 8 bytes for return address
@ -220,9 +220,9 @@ void Registers::SyncPopulate() {
// Dereference fp to get previous fp
"ldr %1, [x29]\n\t"
: "=r"(mSP), "=r"(mFP));
#else
# error "unknown architecture"
#endif
# else
# error "unknown architecture"
# endif
mPC = reinterpret_cast<Address>(
__builtin_extract_return_addr(__builtin_return_address(0)));
mLR = 0;

View File

@ -164,13 +164,13 @@ void mozilla::detail::MutexImpl::lock() {
break;
}
// Hint to the processor that we're spinning.
#ifdef __x86_64__
# define SPIN_HINT "pause"
#elif defined(__aarch64__)
# define SPIN_HINT "yield"
#endif
# ifdef __x86_64__
# define SPIN_HINT "pause"
# elif defined(__aarch64__)
# define SPIN_HINT "yield"
# endif
asm volatile(SPIN_HINT ::: "memory");
#undef SPIN_HINT
# undef SPIN_HINT
count++;
} while (!mutexTryLock());

View File

@ -1914,8 +1914,8 @@ SECStatus nsNSS_SSLGetClientAuthData(void* arg, PRFileDesc* socket,
Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_CLIENT_CERT, u"sent"_ns,
1);
if (info->GetSSLVersionUsed() == nsISSLSocketControl::TLS_VERSION_1_3) {
Telemetry::Accumulate(Telemetry::TLS_1_3_CLIENT_AUTH_USES_PHA,
info->IsHandshakeCompleted());
Telemetry::Accumulate(Telemetry::TLS_1_3_CLIENT_AUTH_USES_PHA,
info->IsHandshakeCompleted());
}
}

View File

@ -205,7 +205,7 @@ static void PlatformInit(PSLockRef aLock) {}
#if defined(HAVE_NATIVE_UNWIND)
void Registers::SyncPopulate() {
#if defined(__x86_64__)
# if defined(__x86_64__)
asm(
// Compute caller's %rsp by adding to %rbp:
// 8 bytes for previous %rbp, 8 bytes for return address
@ -213,7 +213,7 @@ void Registers::SyncPopulate() {
// Dereference %rbp to get previous %rbp
"movq (%%rbp), %1\n\t"
: "=r"(mSP), "=r"(mFP));
#elif defined(__aarch64__)
# elif defined(__aarch64__)
asm(
// Compute caller's sp by adding to fp:
// 8 bytes for previous fp, 8 bytes for return address
@ -221,9 +221,9 @@ void Registers::SyncPopulate() {
// Dereference fp to get previous fp
"ldr %1, [x29]\n\t"
: "=r"(mSP), "=r"(mFP));
#else
# error "unknown architecture"
#endif
# else
# error "unknown architecture"
# endif
mPC = reinterpret_cast<Address>(
__builtin_extract_return_addr(__builtin_return_address(0)));
mLR = 0;

View File

@ -603,7 +603,8 @@ nsresult GfxInfo::GetFeatureStatusImpl(
if (aFeature == FEATURE_WEBRENDER_SCISSORED_CACHE_CLEARS) {
// Mali-G71 and G72 (and presumably others) are buggy when attempting
// to clear picture cache textures with a scissor rect set.
const bool isMaliGxx = mGLStrings->Renderer().Find("Mali-G", /*ignoreCase*/ true) >= 0;
const bool isMaliGxx =
mGLStrings->Renderer().Find("Mali-G", /*ignoreCase*/ true) >= 0;
if (isMaliGxx) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
aFailureId = "FEATURE_FAILURE_BUG_1603515";

View File

@ -66,7 +66,7 @@ nsresult nsPrintSettingsServiceX::SerializeToPrintDataParent(nsIPrintSettings* a
NSURL* printToFileURL = [dict objectForKey:NSPrintJobSavingURL];
if (printToFileURL) {
if ([printToFileURL isFileURL]) {
nsCocoaUtils::GetStringForNSString([printToFileURL path], data->toFileName());
nsCocoaUtils::GetStringForNSString([printToFileURL path], data -> toFileName());
} else {
MOZ_ASSERT_UNREACHABLE("expected a file URL");
}

View File

@ -807,7 +807,8 @@ bool MPRISServiceHandler::EmitSupportedKeyChanged(
return EmitPropertiesChangedSignal(parameters);
}
bool MPRISServiceHandler::EmitPropertiesChangedSignal(GVariant* aParameters) const {
bool MPRISServiceHandler::EmitPropertiesChangedSignal(
GVariant* aParameters) const {
if (!mConnection) {
LOG("No D-Bus Connection. Cannot emit properties changed signal");
return false;

View File

@ -7,7 +7,7 @@
#include "PoisonIOInterposer.h"
// Disabled until bug 1658385 is fixed.
#ifndef __aarch64__
#include "mach_override.h"
# include "mach_override.h"
#endif
#include "mozilla/ArrayUtils.h"