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/D85678
  • Loading branch information
sylvestre committed Aug 2, 2020
1 parent 964bac7 commit 843f943
Show file tree
Hide file tree
Showing 72 changed files with 145 additions and 156 deletions.
1 change: 0 additions & 1 deletion devtools/shared/heapsnapshot/AutoMemMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace devtools {
// }
// // The memory is automatically unmapped when the AutoMemMap leaves scope.
class MOZ_RAII AutoMemMap {

PRFileInfo64 fileInfo;
PRFileDesc* fd;
PRFileMap* fileMap;
Expand Down
1 change: 0 additions & 1 deletion docshell/base/timeline/AutoGlobalTimelineMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace mozilla {
// ...
// }
class MOZ_RAII AutoGlobalTimelineMarker {

// The name of the marker we are adding.
const char* mName;
// Whether to capture the JS stack or not.
Expand Down
1 change: 0 additions & 1 deletion docshell/base/timeline/AutoRestyleTimelineMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class nsIDocShell;
namespace mozilla {

class MOZ_RAII AutoRestyleTimelineMarker {

RefPtr<nsIDocShell> mDocShell;
bool mIsAnimationOnly;

Expand Down
1 change: 0 additions & 1 deletion docshell/base/timeline/AutoTimelineMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace mozilla {
// ...
// }
class MOZ_RAII AutoTimelineMarker {

// The name of the marker we are adding.
const char* mName;

Expand Down
1 change: 0 additions & 1 deletion docshell/shistory/nsSHistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ class nsSHistory : public mozilla::LinkedListElement<nsSHistory>,
nsISHEntry* aNewEntry);

protected:

bool mHasOngoingUpdate;
bool mIsRemote;
nsTArray<nsCOMPtr<nsISHEntry>> mEntries; // entries are never null
Expand Down
1 change: 1 addition & 0 deletions dom/base/Selection.h
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,7 @@ class MOZ_STACK_CLASS SelectionBatcher final {
class MOZ_RAII AutoHideSelectionChanges final {
private:
RefPtr<Selection> mSelection;

public:
explicit AutoHideSelectionChanges(const nsFrameSelection* aFrame);

Expand Down
1 change: 0 additions & 1 deletion dom/base/nsGlobalWindowOuter.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
~TemporarilyDisableDialogs();

private:

// Always an inner window; this is the window whose dialog state we messed
// with. We just want to keep it alive, because we plan to poke at its
// members in our destructor.
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsImageLoadingContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ nsImageLoadingContent::LoadImageWithChannel(nsIChannel* aChannel,

// Do the load.
RefPtr<imgRequestProxy>& req = PrepareNextRequest(eImageLoadType_Normal);
nsresult rv = loader->LoadImageWithChannel(aChannel, this, doc,
aListener, getter_AddRefs(req));
nsresult rv = loader->LoadImageWithChannel(aChannel, this, doc, aListener,
getter_AddRefs(req));
if (NS_SUCCEEDED(rv)) {
CloneScriptedRequests(req);
TrackImage(req);
Expand Down
6 changes: 3 additions & 3 deletions dom/bindings/TypedArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "js/ArrayBuffer.h"
#include "js/ArrayBufferMaybeShared.h"
#include "js/experimental/TypedData.h" // js::Unwrap(Ui|I)nt(8|16|32)Array, js::Get(Ui|I)nt(8|16|32)ArrayLengthAndData, js::UnwrapUint8ClampedArray, js::GetUint8ClampedArrayLengthAndData, js::UnwrapFloat(32|64)Array, js::GetFloat(32|64)ArrayLengthAndData, JS_GetArrayBufferViewType
#include "js/GCAPI.h" // JS::AutoCheckCannotGC
#include "js/RootingAPI.h" // JS::Rooted
#include "js/ScalarType.h" // js::Scalar::Type
#include "js/GCAPI.h" // JS::AutoCheckCannotGC
#include "js/RootingAPI.h" // JS::Rooted
#include "js/ScalarType.h" // js::Scalar::Type
#include "js/SharedArrayBuffer.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/BindingDeclarations.h"
Expand Down
1 change: 1 addition & 0 deletions dom/canvas/WebGLChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class WebGLChild final : public PWebGLChild, public SupportsWeakPtr {
webgl::RaiiShmem mPendingCmdsShmem;
size_t mPendingCmdsPos = 0;
FlushedCmdInfo mFlushedCmdInfo;

public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebGLChild, override);
using OtherSideActor = WebGLParent;
Expand Down
3 changes: 2 additions & 1 deletion dom/canvas/WebGLIpdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
namespace mozilla {
namespace webgl {

// TODO: This should probably replace Shmem, or at least this should move to ipc/glue.
// TODO: This should probably replace Shmem, or at least this should move to
// ipc/glue.
class RaiiShmem final {
RefPtr<mozilla::ipc::ActorLifecycleProxy> mWeakRef;
mozilla::ipc::Shmem mShmem = {};
Expand Down
2 changes: 1 addition & 1 deletion dom/canvas/WebGLParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HostWebGLContext;
namespace layers {
class SharedSurfaceTextureClient;
class SurfaceDescriptor;
}
} // namespace layers

namespace dom {

Expand Down
16 changes: 10 additions & 6 deletions dom/gamepad/GamepadRemapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,14 @@ class StadiaControllerRemapper final : public GamepadRemapper {
break;
case 4: {
const double value = AxisToButtonValue(aValue);
service->NewButtonEvent(aIndex, BUTTON_INDEX_LEFT_TRIGGER, value > BUTTON_THRESHOLD_VALUE, value);
service->NewButtonEvent(aIndex, BUTTON_INDEX_LEFT_TRIGGER,
value > BUTTON_THRESHOLD_VALUE, value);
break;
}
case 5: {
const double value = AxisToButtonValue(aValue);
service->NewButtonEvent(aIndex, BUTTON_INDEX_RIGHT_TRIGGER, value > BUTTON_THRESHOLD_VALUE, value);
service->NewButtonEvent(aIndex, BUTTON_INDEX_RIGHT_TRIGGER,
value > BUTTON_THRESHOLD_VALUE, value);
break;
}
default:
Expand Down Expand Up @@ -420,7 +422,8 @@ class Playstation3Remapper final : public GamepadRemapper {
default:
NS_WARNING(
nsPrintfCString(
"Axis idx '%d' doesn't support in Playstation3Remapper().", aAxis)
"Axis idx '%d' doesn't support in Playstation3Remapper().",
aAxis)
.get());
break;
}
Expand Down Expand Up @@ -594,13 +597,13 @@ class Dualshock4Remapper final : public GamepadRemapper {
const double value = AxisToButtonValue(aValue);
service->NewButtonEvent(aIndex, BUTTON_INDEX_LEFT_TRIGGER,
value > BUTTON_THRESHOLD_VALUE, value);
break;
break;
}
case 4: {
const double value = AxisToButtonValue(aValue);
service->NewButtonEvent(aIndex, BUTTON_INDEX_RIGHT_TRIGGER,
value > BUTTON_THRESHOLD_VALUE, value);
break;
break;
}
case 5:
service->NewAxisMoveEvent(aIndex, AXIS_INDEX_RIGHT_STICK_Y, aValue);
Expand Down Expand Up @@ -1723,7 +1726,8 @@ already_AddRefed<GamepadRemapper> GetGamepadRemapper(const uint16_t aVendorId,
{GamepadId::kPadixProduct2060, new IBuffaloRemapper()},
{GamepadId::kPlayComProduct0005, new XSkillsRemapper()},
{GamepadId::kPrototypeVendorProduct0667, new BoomN64PsxRemapper()},
{GamepadId::kPrototypeVendorProduct9401, new StadiaControllerOldFirmwareRemapper()},
{GamepadId::kPrototypeVendorProduct9401,
new StadiaControllerOldFirmwareRemapper()},
{GamepadId::kRazer1532Product0900, new RazerServalRemapper()},
{GamepadId::kSonyProduct0268, new Playstation3Remapper()},
{GamepadId::kSonyProduct05c4, new Dualshock4Remapper()},
Expand Down
6 changes: 3 additions & 3 deletions dom/html/HTMLImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,9 @@ nsresult HTMLImageElement::CopyInnerTo(HTMLImageElement* aDest) {
// initaiated by a user interaction.
mUseUrgentStartForChannel = UserActivation::IsHandlingUserInput();

nsContentUtils::AddScriptRunner(NewRunnableMethod<bool>(
"dom::HTMLImageElement::MaybeLoadImage", aDest,
&HTMLImageElement::MaybeLoadImage, false));
nsContentUtils::AddScriptRunner(
NewRunnableMethod<bool>("dom::HTMLImageElement::MaybeLoadImage", aDest,
&HTMLImageElement::MaybeLoadImage, false));
}

return NS_OK;
Expand Down
4 changes: 2 additions & 2 deletions dom/media/VideoUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ bool ExtractVPXCodecDetails(const nsAString& aCodec, uint8_t& aProfile,
// No more than 8 fields are expected.
return false;
}
*(fields[fieldsCount]) = static_cast<uint8_t>(
(*fieldsItr).ToInteger(&rv, 10));
*(fields[fieldsCount]) =
static_cast<uint8_t>((*fieldsItr).ToInteger(&rv, 10));
// We got invalid field value, parsing error.
NS_ENSURE_SUCCESS(rv, false);
}
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webaudio/AudioBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "AudioBuffer.h"
#include "mozilla/dom/AudioBufferBinding.h"
#include "jsfriendapi.h"
#include "js/ArrayBuffer.h" // JS::StealArrayBufferContents
#include "js/ArrayBuffer.h" // JS::StealArrayBufferContents
#include "js/experimental/TypedData.h" // JS_NewFloat32Array, JS_GetFloat32ArrayData, JS_GetTypedArrayLength, JS_GetArrayBufferViewBuffer
#include "mozilla/ErrorResult.h"
#include "AudioSegment.h"
Expand Down
2 changes: 0 additions & 2 deletions dom/script/ScriptSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ AutoJSContext::AutoJSContext() : mCx(nullptr) {
MOZ_ASSERT(!mCx, "mCx should not be initialized!");
MOZ_ASSERT(NS_IsMainThread());


if (dom::IsJSAPIActive()) {
mCx = dom::danger::GetJSContext();
} else {
Expand All @@ -722,7 +721,6 @@ AutoJSContext::operator JSContext*() const { return mCx; }
AutoSafeJSContext::AutoSafeJSContext() : AutoJSAPI() {
MOZ_ASSERT(NS_IsMainThread());


DebugOnly<bool> ok = Init(xpc::UnprivilegedJunkScope());
MOZ_ASSERT(ok,
"This is quite odd. We should have crashed in the "
Expand Down
4 changes: 2 additions & 2 deletions dom/simpledb/SDBConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "ActorsChild.h"
#include "js/ArrayBuffer.h" // JS::{GetObjectAsArrayBuffer,IsArrayBufferObject}
#include "js/experimental/TypedData.h" // JS_IsArrayBufferViewObject, JS_GetObjectAsArrayBufferView
#include "js/RootingAPI.h" // JS::{Handle,Rooted}
#include "js/Value.h" // JS::Value
#include "js/RootingAPI.h" // JS::{Handle,Rooted}
#include "js/Value.h" // JS::Value
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ipc/BackgroundUtils.h"
Expand Down
1 change: 0 additions & 1 deletion editor/libeditor/HTMLEditSubActionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ static bool IsStyleCachePreservingSubAction(EditSubAction aEditSubAction) {
}

class MOZ_RAII AutoSetTemporaryAncestorLimiter final {

public:
explicit AutoSetTemporaryAncestorLimiter(HTMLEditor& aHTMLEditor,
Selection& aSelection,
Expand Down
2 changes: 1 addition & 1 deletion gfx/config/gfxConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void gfxConfigManager::ConfigureWebRender() {
if (mXRenderEnabled) {
// XRender and WebRender don't play well together. XRender is disabled by
// default. If the user opts into it don't enable webrender.
mFeatureWr->ForceDisable(FeatureStatus::Blocked,"XRender is enabled",
mFeatureWr->ForceDisable(FeatureStatus::Blocked, "XRender is enabled",
"FEATURE_FAILURE_XRENDER"_ns);
}

Expand Down
1 change: 0 additions & 1 deletion gfx/layers/client/TextureClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ class TextureClientReleaseTask : public Runnable {
// Automatically lock and unlock a texture. Since texture locking is fallible,
// Succeeded() must be checked on the guard object before proceeding.
class MOZ_RAII TextureClientAutoLock {

public:
TextureClientAutoLock(TextureClient* aTexture, OpenMode aMode)
: mTexture(aTexture), mSucceeded(false) {
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/wr/OMTASampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <unordered_map>
#include <queue>

#include "base/platform_thread.h" // for PlatformThreadId
#include "base/platform_thread.h" // for PlatformThreadId
#include "mozilla/layers/OMTAController.h" // for OMTAController
#include "mozilla/Maybe.h"
#include "mozilla/StaticMutex.h"
Expand Down
1 change: 0 additions & 1 deletion gfx/tests/gtest/TestConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,4 +711,3 @@ TEST_F(GfxConfigManager, WebRenderWhenXRenderEnabled) {
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
}

3 changes: 2 additions & 1 deletion image/imgRequestProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,8 @@ imgRequestProxy::GetStaticRequest(imgIRequest** aReturn) {

already_AddRefed<imgRequestProxy> imgRequestProxy::GetStaticRequest(
Document* aLoadingDocument) {
MOZ_DIAGNOSTIC_ASSERT(!aLoadingDocument || aLoadingDocument->IsStaticDocument());
MOZ_DIAGNOSTIC_ASSERT(!aLoadingDocument ||
aLoadingDocument->IsStaticDocument());
RefPtr<Image> image = GetImage();

bool animated;
Expand Down
3 changes: 2 additions & 1 deletion image/imgRequestProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class imgRequestProxy : public mozilla::PreloaderBase,
Document* aLoadingDocument, imgRequestProxy** aClone);
nsresult Clone(imgINotificationObserver* aObserver,
Document* aLoadingDocument, imgRequestProxy** aClone);
already_AddRefed<imgRequestProxy> GetStaticRequest(Document* aLoadingDocument);
already_AddRefed<imgRequestProxy> GetStaticRequest(
Document* aLoadingDocument);

imgRequest* GetOwner() const;

Expand Down
12 changes: 6 additions & 6 deletions ipc/glue/BackgroundChildImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ void BackgroundChildImpl::ProcessingError(Result aCode, const char* aReason) {
abortMessage.AssignLiteral(#_result); \
break

HANDLE_CASE(MsgNotKnown);
HANDLE_CASE(MsgNotAllowed);
HANDLE_CASE(MsgPayloadError);
HANDLE_CASE(MsgProcessingError);
HANDLE_CASE(MsgRouteError);
HANDLE_CASE(MsgValueError);
HANDLE_CASE(MsgNotKnown);
HANDLE_CASE(MsgNotAllowed);
HANDLE_CASE(MsgPayloadError);
HANDLE_CASE(MsgProcessingError);
HANDLE_CASE(MsgRouteError);
HANDLE_CASE(MsgValueError);

#undef HANDLE_CASE

Expand Down
1 change: 0 additions & 1 deletion ipc/glue/Neutering.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifndef mozilla_ipc_Neutering_h
#define mozilla_ipc_Neutering_h


/**
* This header declares RAII wrappers for Window neutering. See
* WindowsMessageLoop.cpp for more details.
Expand Down
1 change: 1 addition & 0 deletions js/src/builtin/FinalizationRegistryObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class FinalizationRegistryObject : public NativeObject {
static bool cleanupQueuedRecords(JSContext* cx,
HandleFinalizationRegistryObject registry,
HandleObject callback = nullptr);

private:
static const JSClassOps classOps_;
static const ClassSpec classSpec_;
Expand Down
2 changes: 1 addition & 1 deletion js/src/builtin/TestingFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include "js/Debug.h"
#include "js/experimental/TypedData.h" // JS_GetObjectAsUint8Array
#include "js/friend/DumpFunctions.h" // js::Dump{Backtrace,Heap,Object}, JS::FormatStackDump, js::IgnoreNurseryObjects
#include "js/friend/WindowProxy.h" // js::ToWindowProxyIfWindow
#include "js/friend/WindowProxy.h" // js::ToWindowProxyIfWindow
#include "js/HashTable.h"
#include "js/LocaleSensitive.h"
#include "js/PropertySpec.h"
Expand Down
4 changes: 2 additions & 2 deletions js/src/builtin/streams/StreamAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

#include <stdint.h> // uint32_t, uintptr_t

#include "jsapi.h" // js::AssertHeapIsIdle, JS_ReportErrorNumberASCII
#include "jsapi.h" // js::AssertHeapIsIdle, JS_ReportErrorNumberASCII
#include "jsfriendapi.h" // js::GetErrorMessage, js::IsObjectInContextCompartment, JSMSG_*
#include "jstypes.h" // JS_{FRIEND,PUBLIC}_API
#include "jstypes.h" // JS_{FRIEND,PUBLIC}_API

#include "builtin/Stream.h" // js::ReadableByteStreamController{,Close}, js::ReadableStreamDefaultController{,Close}, js::StreamController
#include "builtin/streams/ReadableStream.h" // js::ReadableStream
Expand Down
3 changes: 0 additions & 3 deletions js/src/debugger/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2961,7 +2961,6 @@ class MOZ_RAII ExecutionObservableRealms
// don't match.
return iter.hasUsableAbstractFramePtr() && realms_.has(iter.realm());
}

};

// Given a particular AbstractFramePtr F that has become observable, this
Expand Down Expand Up @@ -3025,7 +3024,6 @@ class MOZ_RAII ExecutionObservableFrame
return iter.hasUsableAbstractFramePtr() &&
iter.abstractFramePtr() == frame_;
}

};

class MOZ_RAII ExecutionObservableScript
Expand Down Expand Up @@ -3057,7 +3055,6 @@ class MOZ_RAII ExecutionObservableScript
return iter.hasUsableAbstractFramePtr() && !iter.isWasm() &&
iter.abstractFramePtr().script() == script_;
}

};

/* static */
Expand Down
14 changes: 7 additions & 7 deletions js/src/debugger/NoExecute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#include "jsapi.h" // for Handle
#include "jsfriendapi.h" // for DumpBacktrace, GetErrorMessage

#include "debugger/Debugger.h" // for Debugger
#include "gc/Barrier.h" // for GCPtrNativeObject
#include "debugger/Debugger.h" // for Debugger
#include "gc/Barrier.h" // for GCPtrNativeObject
#include "js/friend/DumpFunctions.h" // for DumpBacktrace
#include "js/Promise.h" // for AutoDebuggerJobQueueInterruption
#include "vm/JSContext.h" // for ProtectedDataContextArg, JSContext
#include "vm/JSScript.h" // for JSScript
#include "vm/Realm.h" // for AutoRealm, Realm
#include "vm/Warnings.h" // for WarnNumberLatin1
#include "js/Promise.h" // for AutoDebuggerJobQueueInterruption
#include "vm/JSContext.h" // for ProtectedDataContextArg, JSContext
#include "vm/JSScript.h" // for JSScript
#include "vm/Realm.h" // for AutoRealm, Realm
#include "vm/Warnings.h" // for WarnNumberLatin1

#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm

Expand Down
Loading

0 comments on commit 843f943

Please sign in to comment.