Skip to content

Commit

Permalink
Bug 1519636 - Reformat recent changes to the Google coding style r=andi
Browse files Browse the repository at this point in the history
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
  • Loading branch information
sylvestre committed Aug 31, 2020
1 parent 7bd59b0 commit 939dd42
Show file tree
Hide file tree
Showing 28 changed files with 59 additions and 65 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ debug-assertions = false
panic = "abort"

[patch.crates-io]
libudev-sys = { path = "dom/webauthn/libudev-sys" }
packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="3541e3818fdc7c2a24f87e3459151a4ce955a67a" }
rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="ed8bac8812e9f335d5fadd0f4ece96981aba88a3" }
nix = { git = "https://github.com/shravanrn/nix/", branch = "r0.13.1", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" }
Expand Down
3 changes: 1 addition & 2 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 1 addition & 4 deletions dom/base/ShadowRoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>>&);

Expand Down Expand Up @@ -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());
Expand Down
1 change: 0 additions & 1 deletion dom/base/nsFrameLoaderOwner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ void nsFrameLoaderOwner::ChangeRemotenessToProcess(
mFrameLoader->ConfigRemoteProcess(aContentParent->GetRemoteType(),
aContentParent);
}

};

auto shouldPreserve =
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsGlobalWindowOuter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions dom/ipc/ContentChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion gfx/layers/composite/LayerManagerComposite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
4 changes: 2 additions & 2 deletions gfx/thebes/gfxUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions js/public/StableStringChars.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/streams/ReadableStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions js/src/builtin/streams/ReadableStreamOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion js/src/frontend/ParserAtom.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions js/src/gc/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -1070,7 +1070,7 @@ bool js::gc::CheckWeakMapEntryMarking(const WeakMapBase* map, Cell* key,
}
fprintf(stderr, "Value:\n");
value->dump();
#endif
# endif

ok = false;
}
Expand Down
2 changes: 1 addition & 1 deletion js/src/jsfriendapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion js/src/vm/Shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
9 changes: 3 additions & 6 deletions js/src/wasm/WasmTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand All @@ -1249,8 +1247,7 @@ class FuncType {
}
for (ValType result : results()) {
if (result.isReference() &&
(!result.isExternRef() ||
!result.isNullable())) {
(!result.isExternRef() || !result.isNullable())) {
return true;
}
}
Expand Down
3 changes: 2 additions & 1 deletion js/src/wasm/WasmValidate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions layout/base/PresShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
7 changes: 4 additions & 3 deletions layout/generic/nsIFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions memory/replace/dmd/DMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions mozglue/baseprofiler/core/platform-macos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,25 @@ 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
"leaq 0x10(%%rbp), %0\n\t"
// 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
"add %0, x29, #0x10\n\t"
// 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;
Expand Down
12 changes: 6 additions & 6 deletions mozglue/misc/Mutex_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
4 changes: 2 additions & 2 deletions security/manager/ssl/nsNSSIOLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
10 changes: 5 additions & 5 deletions tools/profiler/core/platform-macos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,25 +205,25 @@ 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
"leaq 0x10(%%rbp), %0\n\t"
// 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
"add %0, x29, #0x10\n\t"
// 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;
Expand Down
3 changes: 2 additions & 1 deletion widget/android/GfxInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion widget/cocoa/nsPrintSettingsServiceX.mm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
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");
}
Expand Down
3 changes: 2 additions & 1 deletion widget/gtk/MPRISServiceHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion xpcom/build/PoisonIOInterposerMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 939dd42

Please sign in to comment.