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

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D73347
This commit is contained in:
Sylvestre Ledru 2020-05-09 14:51:53 +00:00
Родитель ac1ef7b1a2
Коммит 1929dd1ab3
27 изменённых файлов: 59 добавлений и 67 удалений

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

@ -152,7 +152,8 @@ nsMacShellService::SetDesktopBackground(Element* aElement, int32_t aPosition,
loadContext = do_QueryInterface(docShell);
}
auto referrerInfo = mozilla::MakeRefPtr<mozilla::dom::ReferrerInfo>(*aElement);
auto referrerInfo =
mozilla::MakeRefPtr<mozilla::dom::ReferrerInfo>(*aElement);
return wbp->SaveURI(imageURI, aElement->NodePrincipal(), 0, referrerInfo,
nullptr, nullptr, mBackgroundFile,
nsIContentPolicy::TYPE_IMAGE, loadContext);

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

@ -2596,8 +2596,7 @@ void nsFocusManager::FireFocusOrBlurEvent(EventMessage aEventMessage,
EventMessage focusInOrOutMessage =
aEventMessage == eFocus ? eFocusIn : eFocusOut;
FireFocusInOrOutEvent(focusInOrOutMessage, aPresShell, aTarget,
currentWindow, currentFocusedContent,
aRelatedTarget);
currentWindow, currentFocusedContent, aRelatedTarget);
}
}

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

@ -487,7 +487,7 @@ class AutoSequence : public AutoTArray<T, 16> {
AutoSequence() : AutoTArray<T, 16>() {}
// Allow converting to const sequences as needed
operator const Sequence<T> &() const {
operator const Sequence<T>&() const {
return *reinterpret_cast<const Sequence<T>*>(this);
}
};

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

@ -114,7 +114,7 @@ void JSActorService::LoadJSActorInfos(nsTArray<JSProcessActorInfo>& aProcess,
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(XRE_IsContentProcess());
for (auto& info: aProcess) {
for (auto& info : aProcess) {
// Create our JSProcessActorProtocol, register it in
// mProcessActorDescriptors.
auto name = info.name();
@ -126,15 +126,15 @@ void JSActorService::LoadJSActorInfos(nsTArray<JSProcessActorInfo>& aProcess,
proto->AddObservers();
}
for (auto& info: aWindow) {
for (auto& info : aWindow) {
auto name = info.name();
RefPtr<JSWindowActorProtocol> proto =
JSWindowActorProtocol::FromIPC(std::move(info));
JSWindowActorProtocol::FromIPC(std::move(info));
mWindowActorDescriptors.Put(std::move(name), RefPtr{proto});
// Register listeners for each chrome target.
for (EventTarget* target : mChromeEventTargets) {
proto->RegisterListenersFor(target);
proto->RegisterListenersFor(target);
}
// Add observers for each actor.

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

@ -100,8 +100,7 @@ void ProcessActor::ConstructActor(const nsACString& aName,
ctorName.Append(actorType == JSActor::Type::Parent
? NS_LITERAL_CSTRING("Parent")
: NS_LITERAL_CSTRING("Child"));
if (!JS_GetProperty(cx, exports, ctorName.get(),
&ctor)) {
if (!JS_GetProperty(cx, exports, ctorName.get(), &ctor)) {
aRv.NoteJSContextException(cx);
return;
}

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

@ -1090,22 +1090,17 @@ void AudioCallbackDriver::PanOutputIfNeeded(bool aMicrophoneActive) {
return;
}
int major,minor;
int major, minor;
for (uint32_t i = 0; i < length; i++) {
// skip the model name
if (isalpha(name[i])) {
continue;
}
sscanf(name+i, "%d,%d", &major, &minor);
sscanf(name + i, "%d,%d", &major, &minor);
break;
}
enum MacbookModel {
MacBook,
MacBookPro,
MacBookAir,
NotAMacbook
};
enum MacbookModel { MacBook, MacBookPro, MacBookAir, NotAMacbook };
MacbookModel model;

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

@ -133,7 +133,8 @@ already_AddRefed<XRViewerPose> XRFrame::GetViewerPose(
return viewerPose.forget();
}
already_AddRefed<XRPose> XRFrame::GetPose(const XRSpace& aSpace, const XRSpace& aBaseSpace,
already_AddRefed<XRPose> XRFrame::GetPose(const XRSpace& aSpace,
const XRSpace& aBaseSpace,
ErrorResult& aRv) {
if (!mActive) {
aRv.ThrowInvalidStateError(

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

@ -45,8 +45,8 @@ class XRFrame final : public nsWrapperCache {
XRSession* Session();
already_AddRefed<XRViewerPose> GetViewerPose(
const XRReferenceSpace& aReferenceSpace, ErrorResult& aRv);
already_AddRefed<XRPose> GetPose(const XRSpace& aSpace, const XRSpace& aBaseSpace,
ErrorResult& aRv);
already_AddRefed<XRPose> GetPose(const XRSpace& aSpace,
const XRSpace& aBaseSpace, ErrorResult& aRv);
gfx::Matrix4x4 ConstructInlineProjection(float aFov, float aAspect,
float aNear, float aFar);

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

@ -43,10 +43,10 @@ void gfxConfigManager::Init() {
StaticPrefs::gfx_webrender_max_partial_present_rects_AtStartup() > 0;
#ifdef XP_WIN
mWrForceAngle = StaticPrefs::gfx_webrender_force_angle_AtStartup();
#ifdef NIGHTLY_BUILD
# ifdef NIGHTLY_BUILD
mWrForceAngleNoGPUProcess = StaticPrefs::
gfx_webrender_enabled_no_gpu_process_with_angle_win_AtStartup();
#endif
# endif
mWrDCompWinEnabled =
Preferences::GetBool("gfx.webrender.dcomp-win.enabled", false);
#endif

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

@ -7,13 +7,13 @@
#ifndef mozilla_layers_GeckoContentController_h
#define mozilla_layers_GeckoContentController_h
#include "InputData.h" // for PinchGestureInput
#include "LayersTypes.h" // for ScrollDirection
#include "Units.h" // for CSSPoint, CSSRect, etc
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/Attributes.h" // for MOZ_CAN_RUN_SCRIPT
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
#include "mozilla/EventForwards.h" // for Modifiers
#include "InputData.h" // for PinchGestureInput
#include "LayersTypes.h" // for ScrollDirection
#include "Units.h" // for CSSPoint, CSSRect, etc
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/Attributes.h" // for MOZ_CAN_RUN_SCRIPT
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
#include "mozilla/EventForwards.h" // for Modifiers
#include "mozilla/layers/APZThreadUtils.h"
#include "mozilla/layers/MatrixMessage.h" // for MatrixMessage
#include "mozilla/layers/RepaintRequest.h" // for RepaintRequest

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

@ -82,7 +82,7 @@ bool APZThreadUtils::IsControllerThread() {
/*static*/
void APZThreadUtils::DelayedDispatch(already_AddRefed<Runnable> aRunnable,
int aDelayMs) {
int aDelayMs) {
MOZ_ASSERT(!XRE_IsContentProcess(),
"ContentProcessController should only be used remotely.");
RefPtr<nsISerialEventTarget> thread;

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

@ -6,7 +6,7 @@
#include "ChromeProcessController.h"
#include "MainThreadUtils.h" // for NS_IsMainThread()
#include "MainThreadUtils.h" // for NS_IsMainThread()
#include "mozilla/PresShell.h"
#include "mozilla/dom/Element.h"
#include "mozilla/layers/CompositorBridgeParent.h"

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

@ -38,7 +38,7 @@
#include "mozilla/layers/TextureClientOGL.h"
#include "mozilla/layers/TextureClientRecycleAllocator.h"
#include "mozilla/layers/TextureRecorded.h"
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING, etc
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING, etc
#include "nsISerialEventTarget.h"
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
#include "nsPrintfCString.h" // for nsPrintfCString

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

@ -38,7 +38,7 @@
#include "nsTArray.h" // for AutoTArray, nsTArray, etc
#include "nsTArrayForwardDeclare.h" // for AutoTArray
#include "nsThread.h"
#include "nsThreadUtils.h" // for NS_IsMainThread
#include "nsThreadUtils.h" // for NS_IsMainThread
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h" // for StaticRefPtr
#include "mozilla/layers/TextureClient.h"

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

@ -5,10 +5,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ImageBridgeParent.h"
#include <stdint.h> // for uint64_t, uint32_t
#include "CompositableHost.h" // for CompositableParent, Create
#include "base/process.h" // for ProcessId
#include "base/task.h" // for CancelableTask, DeleteTask, etc
#include <stdint.h> // for uint64_t, uint32_t
#include "CompositableHost.h" // for CompositableParent, Create
#include "base/process.h" // for ProcessId
#include "base/task.h" // for CancelableTask, DeleteTask, etc
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/Hal.h" // for hal::SetCurrentThreadPriority()

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

@ -37,9 +37,10 @@ void RemoteContentController::NotifyLayerTransforms(
const nsTArray<MatrixMessage>& aTransforms) {
if (!mCompositorThread->IsOnCurrentThread()) {
// We have to send messages from the compositor thread
mCompositorThread->Dispatch(NewRunnableMethod<CopyableTArray<MatrixMessage>>(
"layers::RemoteContentController::NotifyLayerTransforms", this,
&RemoteContentController::NotifyLayerTransforms, aTransforms));
mCompositorThread->Dispatch(
NewRunnableMethod<CopyableTArray<MatrixMessage>>(
"layers::RemoteContentController::NotifyLayerTransforms", this,
&RemoteContentController::NotifyLayerTransforms, aTransforms));
return;
}

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

@ -1054,9 +1054,8 @@ void gfxDWriteFontList::AppendFamiliesFromCollection(
if (key.EqualsLiteral("gill sans") && allFacesUltraBold(family)) {
visibility = FontVisibility::Hidden;
} else {
visibility = aCollection == mSystemFonts
? GetVisibilityForFamily(name)
: FontVisibility::Base;
visibility = aCollection == mSystemFonts ? GetVisibilityForFamily(name)
: FontVisibility::Base;
}
aFamilies.AppendElement(fontlist::Family::InitData(
key, name, i, visibility, aCollection != mSystemFonts, bad, classic));

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

@ -377,8 +377,7 @@ struct MOZ_STACK_CLASS StackingContextParams : public WrStackingContextParams {
nullptr,
/* prim_flags = */ wr::PrimitiveFlags::IS_BACKFACE_VISIBLE,
wr::MixBlendMode::Normal,
wr::StackingContextFlags { 0 }
} {}
wr::StackingContextFlags{0}} {}
void SetPreserve3D(bool aPreserve) {
transform_style =

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

@ -21,7 +21,7 @@
#include "nsIconDecoder.h"
#include "nsWebPDecoder.h"
#ifdef MOZ_AV1
#include "nsAVIFDecoder.h"
# include "nsAVIFDecoder.h"
#endif
namespace mozilla {
@ -84,7 +84,7 @@ DecoderType DecoderFactory::GetDecoderType(const char* aMimeType) {
}
#ifdef MOZ_AV1
else if (!strcmp(aMimeType, IMAGE_AVIF) &&
StaticPrefs::image_avif_enabled()) {
StaticPrefs::image_avif_enabled()) {
type = DecoderType::AVIF;
}
#endif

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

@ -242,7 +242,9 @@ class Nursery {
return allocateCell(zone, size, JS::TraceKind::String);
}
static size_t nurseryCellHeaderSize() { return sizeof(gc::NurseryCellHeader); }
static size_t nurseryCellHeaderSize() {
return sizeof(gc::NurseryCellHeader);
}
// Allocate a buffer for a given zone, using the nursery if possible.
void* allocateBuffer(JS::Zone* zone, size_t nbytes);

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

@ -181,7 +181,6 @@ static bool IsDescendant(nsIFrame* aFrame, nsIContent* aAncestor,
static nsIContent* GetClickableAncestor(
nsIFrame* aFrame, nsAtom* stopAt = nullptr,
nsAutoString* aLabelTargetId = nullptr) {
// If the frame is `cursor:pointer` or inherits `cursor:pointer` from an
// ancestor, treat it as clickable. This is a heuristic to deal with pages
// where the click event listener is on the <body> or <html> element but it

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

@ -3039,9 +3039,9 @@ void nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState) {
fm, aState.mMinLineHeight, wm.IsLineInverted());
nscoord minDescent = aState.mMinLineHeight - minAscent;
aState.mBCoord += std::max(minAscent, metrics.BlockStartAscent()) +
std::max(minDescent, metrics.BSize(wm) -
metrics.BlockStartAscent());
aState.mBCoord +=
std::max(minAscent, metrics.BlockStartAscent()) +
std::max(minDescent, metrics.BSize(wm) - metrics.BlockStartAscent());
nscoord offset = minAscent - metrics.BlockStartAscent();
if (offset > 0) {

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

@ -413,8 +413,7 @@ bool nsHTMLScrollFrame::TryLayout(ScrollReflowInput* aState,
nsSize vScrollbarPrefSize(0, 0);
if (mHelper.mVScrollbarBox) {
GetScrollbarMetrics(aState->mBoxState, mHelper.mVScrollbarBox,
nullptr,
GetScrollbarMetrics(aState->mBoxState, mHelper.mVScrollbarBox, nullptr,
aAssumeVScroll ? &vScrollbarPrefSize : nullptr);
nsScrollbarFrame* scrollbar = do_QueryFrame(mHelper.mVScrollbarBox);
scrollbar->SetScrollbarMediatorContent(mContent);
@ -424,8 +423,7 @@ bool nsHTMLScrollFrame::TryLayout(ScrollReflowInput* aState,
nsSize hScrollbarPrefSize(0, 0);
if (mHelper.mHScrollbarBox) {
GetScrollbarMetrics(aState->mBoxState, mHelper.mHScrollbarBox,
nullptr,
GetScrollbarMetrics(aState->mBoxState, mHelper.mHScrollbarBox, nullptr,
aAssumeHScroll ? &hScrollbarPrefSize : nullptr);
nsScrollbarFrame* scrollbar = do_QueryFrame(mHelper.mHScrollbarBox);
scrollbar->SetScrollbarMediatorContent(mContent);

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

@ -23,7 +23,8 @@ MediaPipelineFilter::MediaPipelineFilter(
const std::vector<webrtc::RtpExtension>& aExtMap)
: mExtMap(aExtMap) {}
void MediaPipelineFilter::SetRemoteMediaStreamId(const Maybe<std::string>& aMid) {
void MediaPipelineFilter::SetRemoteMediaStreamId(
const Maybe<std::string>& aMid) {
if (aMid != mRemoteMid) {
DEBUG_LOG(("MediaPipelineFilter added new remote RTP MID: '%s'.",
aMid.valueOr("").c_str()));

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

@ -897,8 +897,7 @@ nsNavHistory::CanAddURI(nsIURI* aURI, bool* canAdd) {
// Helper for nsNavHistory::CanAddURI to be callable from a child process
// static
nsresult
nsNavHistory::CanAddURIToHistory(nsIURI* aURI, bool* aCanAdd) {
nsresult nsNavHistory::CanAddURIToHistory(nsIURI* aURI, bool* aCanAdd) {
// Default to false.
*aCanAdd = false;

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

@ -298,4 +298,4 @@ MFBT_API void InitializeWin64ProfilerHooks();
using mozilla::baseprofiler::InitializeWin64ProfilerHooks;
#endif // defined(GP_PLAT_amd64_windows)
#endif // defined(GP_PLAT_amd64_windows)

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

@ -1805,12 +1805,11 @@ const nsTArray<GfxDriverInfo>& GfxInfo::GetGfxDriverInfo() {
"FEATURE_ROLLOUT_BATTERY_S_SCRN_NV_RECENT");
APPEND_TO_DRIVER_BLOCKLIST2_EXT(
OperatingSystem::Windows, ScreenSizeStatus::Small,
BatteryStatus::None, DesktopEnvironment::All, WindowProtocol::All,
DriverVendor::All, DeviceFamily::IntelRolloutWebRender,
nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_ALLOW_ALWAYS,
DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0),
"FEATURE_ROLLOUT_DESKTOP_INTEL_S_SCRN");
OperatingSystem::Windows, ScreenSizeStatus::Small, BatteryStatus::None,
DesktopEnvironment::All, WindowProtocol::All, DriverVendor::All,
DeviceFamily::IntelRolloutWebRender, nsIGfxInfo::FEATURE_WEBRENDER,
nsIGfxInfo::FEATURE_ALLOW_ALWAYS, DRIVER_COMPARISON_IGNORED,
V(0, 0, 0, 0), "FEATURE_ROLLOUT_DESKTOP_INTEL_S_SCRN");
APPEND_TO_DRIVER_BLOCKLIST2_EXT(
OperatingSystem::RecentWindows10, ScreenSizeStatus::Small,