Skip to content

Commit

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

Differential Revision: https://phabricator.services.mozilla.com/D35622
  • Loading branch information
sylvestre committed Jul 6, 2019
1 parent 6258d65 commit a801064
Show file tree
Hide file tree
Showing 64 changed files with 276 additions and 284 deletions.
7 changes: 4 additions & 3 deletions docshell/base/nsDocShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,10 @@ class nsDocShell final : public nsDocLoader,
LOCATION_CHANGE_SAME_DOCUMENT);
}

// This function is created exclusively for dom.background_loading_iframe is set.
// As soon as the current DocShell knows itself can be treated as background loading,
// it triggers the parent docshell to see if the parent document can fire load event earlier.
// This function is created exclusively for dom.background_loading_iframe is
// set. As soon as the current DocShell knows itself can be treated as
// background loading, it triggers the parent docshell to see if the parent
// document can fire load event earlier.
void TriggerParentCheckDocShellIsEmpty() {
RefPtr<nsDocShell> parent = GetParentDocshell();
if (parent) {
Expand Down
1 change: 0 additions & 1 deletion dom/base/BindContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ struct MOZ_STACK_CLASS BindContext final {
}

private:

static bool IsLikelyUndisplayed(const nsINode& aParent) {
return aParent.IsAnyOfHTMLElements(nsGkAtoms::style, nsGkAtoms::script);
}
Expand Down
14 changes: 5 additions & 9 deletions dom/base/DocGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,12 @@ void DocGroup::SignalSlotChange(HTMLSlotElement& aSlot) {
}

bool DocGroup::TryToLoadIframesInBackground() {
return
StaticPrefs::dom_separate_event_queue_for_post_message_enabled() &&
StaticPrefs::dom_cross_origin_iframes_loaded_in_background();
return StaticPrefs::dom_separate_event_queue_for_post_message_enabled() &&
StaticPrefs::dom_cross_origin_iframes_loaded_in_background();
}

nsresult DocGroup::QueueIframePostMessages(
already_AddRefed<nsIRunnable>&& aRunnable,
uint64_t aWindowId) {
already_AddRefed<nsIRunnable>&& aRunnable, uint64_t aWindowId) {
if (DocGroup::TryToLoadIframesInBackground()) {
if (!mIframePostMessageQueue) {
nsCOMPtr<nsISerialEventTarget> target = GetMainThreadSerialEventTarget();
Expand All @@ -221,8 +219,7 @@ nsresult DocGroup::QueueIframePostMessages(

mIframesUsedPostMessageQueue.PutEntry(aWindowId);

mIframePostMessageQueue->Dispatch(std::move(aRunnable),
NS_DISPATCH_NORMAL);
mIframePostMessageQueue->Dispatch(std::move(aRunnable), NS_DISPATCH_NORMAL);
return NS_OK;
}
return NS_ERROR_FAILURE;
Expand All @@ -231,8 +228,7 @@ nsresult DocGroup::QueueIframePostMessages(
void DocGroup::TryFlushIframePostMessages(uint64_t aWindowId) {
if (DocGroup::TryToLoadIframesInBackground()) {
mIframesUsedPostMessageQueue.RemoveEntry(aWindowId);
if (mIframePostMessageQueue &&
mIframesUsedPostMessageQueue.IsEmpty()) {
if (mIframePostMessageQueue && mIframesUsedPostMessageQueue.IsEmpty()) {
MOZ_ASSERT(mIframePostMessageQueue->IsPaused());
nsresult rv = mIframePostMessageQueue->SetIsPaused(true);
MOZ_ALWAYS_SUCCEEDS(rv);
Expand Down
5 changes: 2 additions & 3 deletions dom/base/DocGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ class DocGroup final {
// Returns true if any of its documents are active but not in the bfcache.
bool IsActive() const;

nsresult QueueIframePostMessages(
already_AddRefed<nsIRunnable>&& aRunnable,
uint64_t aWindowId);
nsresult QueueIframePostMessages(already_AddRefed<nsIRunnable>&& aRunnable,
uint64_t aWindowId);

void TryFlushIframePostMessages(uint64_t aWindowId);

Expand Down
4 changes: 1 addition & 3 deletions dom/base/ShadowRoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ class ShadowRoot final : public DocumentFragment,
void PartAdded(const Element&);
void PartRemoved(const Element&);

const nsTArray<const Element*>& Parts() const {
return mParts;
}
const nsTArray<const Element*>& Parts() const { return mParts; }

const RawServoAuthorStyles* GetServoStyles() const {
return mServoStyles.get();
Expand Down
3 changes: 2 additions & 1 deletion dom/base/nsGlobalWindowInner.h
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,8 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
: Runnable("DeprioritizedLoadRunner"), mInner(aInner) {}

NS_IMETHOD Run() override {
if (mInner) {;
if (mInner) {
;
RefPtr<nsIRunnable> inner = std::move(mInner);
inner->Run();
}
Expand Down
1 change: 1 addition & 0 deletions dom/base/nsGlobalWindowOuter.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
nsresult GetPrompter(nsIPrompt** aPrompt) override;

RefPtr<mozilla::ThrottledEventQueue> mPostMessageEventQueue;

protected:
nsPIDOMWindowOuter* GetOpenerWindowOuter();
// Initializes the mWasOffline member variable
Expand Down
1 change: 0 additions & 1 deletion dom/base/nsImageLoadingContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,6 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, bool aForce,
nsLoadFlags loadFlags =
aLoadFlags | nsContentUtils::CORSModeToLoadImageFlags(GetCORSMode());


RefPtr<imgRequestProxy>& req = PrepareNextRequest(aImageLoadType);
nsCOMPtr<nsIContent> content =
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
Expand Down
5 changes: 3 additions & 2 deletions dom/base/nsNodeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ void nsNodeUtils::LastRelease(nsINode* aNode) {
aNode->UnsetFlags(NODE_HAS_LISTENERMANAGER);
}

NS_ASSERTION(!Element::FromNode(aNode) ||
!Element::FromNode(aNode)->GetXBLBinding(), "Node has binding on destruction");
NS_ASSERTION(
!Element::FromNode(aNode) || !Element::FromNode(aNode)->GetXBLBinding(),
"Node has binding on destruction");

aNode->ReleaseWrapper(aNode);

Expand Down
3 changes: 1 addition & 2 deletions dom/bindings/RemoteObjectProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ class RemoteObjectProxy : public RemoteObjectProxyBase {
* represents an object implementing the WebIDL interface for
* aProtoID.
*/
inline bool IsRemoteObjectProxy(JSObject* aObj,
prototypes::ID aProtoID) {
inline bool IsRemoteObjectProxy(JSObject* aObj, prototypes::ID aProtoID) {
if (!js::IsProxy(aObj)) {
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion dom/gamepad/fallback/FallbackGamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ void StartGamepadMonitoring() {}

void StopGamepadMonitoring() {}

void SetGamepadLightIndicatorColor(uint32_t, uint32_t, uint8_t, uint8_t, uint8_t) {}
void SetGamepadLightIndicatorColor(uint32_t, uint32_t, uint8_t, uint8_t,
uint8_t) {}

} // namespace dom
} // namespace mozilla
4 changes: 2 additions & 2 deletions dom/html/nsIFormControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ bool nsIFormControl::IsSingleLineTextControl(bool aExcludePassword,
bool nsIFormControl::IsSubmittableControl() const {
uint32_t type = ControlType();
return type == NS_FORM_OBJECT || type == NS_FORM_TEXTAREA ||
type == NS_FORM_SELECT ||
type & NS_FORM_BUTTON_ELEMENT || type & NS_FORM_INPUT_ELEMENT;
type == NS_FORM_SELECT || type & NS_FORM_BUTTON_ELEMENT ||
type & NS_FORM_INPUT_ELEMENT;
}

bool nsIFormControl::AllowDraggableChildren() const {
Expand Down
6 changes: 3 additions & 3 deletions dom/ipc/BrowserChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
JS::Handle<JSObject*> aCpows,
nsIPrincipal* aPrincipal) override;

bool DoUpdateZoomConstraints(
const uint32_t& aPresShellId, const ViewID& aViewId,
const Maybe<ZoomConstraints>& aConstraints);
bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
const ViewID& aViewId,
const Maybe<ZoomConstraints>& aConstraints);

mozilla::ipc::IPCResult RecvLoadURL(const nsCString& aURI,
const ShowInfo& aInfo);
Expand Down
14 changes: 7 additions & 7 deletions dom/localstorage/ActorsParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4387,8 +4387,8 @@ nsresult Connection::BeginWriteTransaction() {
MOZ_ASSERT(mStorageConnection);

CachedStatement stmt;
nsresult rv = GetCachedStatement(NS_LITERAL_CSTRING("BEGIN IMMEDIATE;"),
&stmt);
nsresult rv =
GetCachedStatement(NS_LITERAL_CSTRING("BEGIN IMMEDIATE;"), &stmt);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
Expand Down Expand Up @@ -9425,9 +9425,7 @@ QuotaClient::MatchFunction::OnFunctionCall(
******************************************************************************/

AutoWriteTransaction::AutoWriteTransaction(bool aShadowWrites)
: mConnection(nullptr)
, mShadowWrites(aShadowWrites)
{
: mConnection(nullptr), mShadowWrites(aShadowWrites) {
AssertIsOnConnectionThread();

MOZ_COUNT_CTOR(mozilla::dom::AutoWriteTransaction);
Expand Down Expand Up @@ -9494,7 +9492,8 @@ nsresult AutoWriteTransaction::Commit() {
return NS_OK;
}

nsresult AutoWriteTransaction::LockAndAttachShadowDatabase(Connection* aConnection) {
nsresult AutoWriteTransaction::LockAndAttachShadowDatabase(
Connection* aConnection) {
AssertIsOnConnectionThread();
MOZ_ASSERT(aConnection);
MOZ_ASSERT(!mConnection);
Expand All @@ -9511,7 +9510,8 @@ nsresult AutoWriteTransaction::LockAndAttachShadowDatabase(Connection* aConnecti
mShadowDatabaseLock.emplace(
aConnection->GetQuotaClient()->ShadowDatabaseMutex());

nsresult rv = AttachShadowDatabase(quotaManager->GetBasePath(), storageConnection);
nsresult rv =
AttachShadowDatabase(quotaManager->GetBasePath(), storageConnection);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
Expand Down
10 changes: 6 additions & 4 deletions dom/media/AutoplayPolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ static uint32_t SiteAutoplayPerm(const Document* aDocument) {
NS_ENSURE_TRUE(permMgr, nsIPermissionManager::DENY_ACTION);

uint32_t perm;
nsresult rv = permMgr->TestExactPermissionFromPrincipal(principal, NS_LITERAL_CSTRING("autoplay-media"), &perm);
nsresult rv = permMgr->TestExactPermissionFromPrincipal(
principal, NS_LITERAL_CSTRING("autoplay-media"), &perm);
NS_ENSURE_SUCCESS(rv, nsIPermissionManager::DENY_ACTION);
return perm;
}
Expand Down Expand Up @@ -187,9 +188,10 @@ static bool IsAllowedToPlayInternal(const HTMLMediaElement& aElement) {
uint32_t defaultBehaviour = DefaultAutoplayBehaviour();
uint32_t sitePermission = SiteAutoplayPerm(approver);

AUTOPLAY_LOG("IsAllowedToPlayInternal, isInaudible=%d,"
"isUsingAutoplayModel=%d, sitePermission=%d, defaultBehaviour=%d",
isInaudible, isUsingAutoplayModel, sitePermission, defaultBehaviour);
AUTOPLAY_LOG(
"IsAllowedToPlayInternal, isInaudible=%d,"
"isUsingAutoplayModel=%d, sitePermission=%d, defaultBehaviour=%d",
isInaudible, isUsingAutoplayModel, sitePermission, defaultBehaviour);

// For site permissions we store permissionManager values except
// for BLOCKED_ALL, for the default pref values we store
Expand Down
3 changes: 2 additions & 1 deletion gfx/2d/DrawTargetD2D1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,8 @@ already_AddRefed<ID2D1Image> DrawTargetD2D1::GetImageForSurface(
case SurfaceType::DUAL_DT: {
// Sometimes we have a dual drawtarget but the underlying targets
// are d2d surfaces. Let's not readback and reupload in those cases.
SourceSurfaceDual* dualSurface = static_cast<SourceSurfaceDual*>(surface.get());
SourceSurfaceDual* dualSurface =
static_cast<SourceSurfaceDual*>(surface.get());
SourceSurface* first = dualSurface->GetFirstSurface();
if (first->GetType() == SurfaceType::D2D1_1_IMAGE) {
MOZ_ASSERT(dualSurface->SameSurfaceTypes());
Expand Down
6 changes: 3 additions & 3 deletions gfx/2d/PathCairo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ void PathBuilderCairo::Arc(const Point& aOrigin, float aRadius,
}

already_AddRefed<Path> PathBuilderCairo::Finish() {
return MakeAndAddRef<PathCairo>(mFillRule, mPathData, mCurrentPoint, mBeginPoint);
return MakeAndAddRef<PathCairo>(mFillRule, mPathData, mCurrentPoint,
mBeginPoint);
}

PathCairo::PathCairo(FillRule aFillRule,
std::vector<cairo_path_data_t>& aPathData,
const Point& aCurrentPoint,
const Point& aBeginPoint)
const Point& aCurrentPoint, const Point& aBeginPoint)
: mFillRule(aFillRule),
mContainingContext(nullptr),
mCurrentPoint(aCurrentPoint),
Expand Down
2 changes: 1 addition & 1 deletion gfx/2d/PathRecording.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace mozilla {
namespace gfx {

#define NEXT_PARAMS(_type) \
#define NEXT_PARAMS(_type) \
const _type params = *reinterpret_cast<const _type*>(nextByte); \
nextByte += sizeof(_type);

Expand Down
15 changes: 7 additions & 8 deletions gfx/2d/PathRecording.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,9 @@ class PathBuilderRecording final : public PathBuilder {
/* Point the current subpath is at - or where the next subpath will start
* if there is no active subpath.
*/
Point CurrentPoint() const final {
return mPathBuilder->CurrentPoint();
}
Point CurrentPoint() const final { return mPathBuilder->CurrentPoint(); }

Point BeginPoint() const final {
return mPathBuilder->BeginPoint();
}
Point BeginPoint() const final { return mPathBuilder->BeginPoint(); }

void SetCurrentPoint(const Point& aPoint) final {
mPathBuilder->SetCurrentPoint(aPoint);
Expand All @@ -193,8 +189,11 @@ class PathRecording final : public Path {

PathRecording(Path* aPath, PathOps&& aOps, FillRule aFillRule,
const Point& aCurrentPoint, const Point& aBeginPoint)
: mPath(aPath), mPathOps(std::move(aOps)), mFillRule(aFillRule),
mCurrentPoint(aCurrentPoint), mBeginPoint(aBeginPoint) {}
: mPath(aPath),
mPathOps(std::move(aOps)),
mFillRule(aFillRule),
mCurrentPoint(aCurrentPoint),
mBeginPoint(aBeginPoint) {}

~PathRecording();

Expand Down
8 changes: 4 additions & 4 deletions gfx/2d/PathSkia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ void PathBuilderSkia::Arc(const Point& aOrigin, float aRadius,
}

already_AddRefed<Path> PathBuilderSkia::Finish() {
RefPtr<Path> path = MakeAndAddRef<PathSkia>(mPath, mFillRule,
mCurrentPoint, mBeginPoint);
RefPtr<Path> path =
MakeAndAddRef<PathSkia>(mPath, mFillRule, mCurrentPoint, mBeginPoint);
mCurrentPoint = Point(0.0, 0.0);
mBeginPoint = Point(0.0, 0.0);
return path.forget();
Expand All @@ -98,8 +98,8 @@ already_AddRefed<PathBuilder> PathSkia::CopyToBuilder(

already_AddRefed<PathBuilder> PathSkia::TransformedCopyToBuilder(
const Matrix& aTransform, FillRule aFillRule) const {
RefPtr<PathBuilderSkia> builder = MakeAndAddRef<PathBuilderSkia>(
aTransform, mPath, aFillRule);
RefPtr<PathBuilderSkia> builder =
MakeAndAddRef<PathBuilderSkia>(aTransform, mPath, aFillRule);

builder->mCurrentPoint = aTransform.TransformPoint(mCurrentPoint);
builder->mBeginPoint = aTransform.TransformPoint(mBeginPoint);
Expand Down
10 changes: 4 additions & 6 deletions gfx/2d/PathSkia.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ class PathSkia : public Path {
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSkia, override)

PathSkia(SkPath& aPath,
FillRule aFillRule,
Point aCurrentPoint = Point(),
PathSkia(SkPath& aPath, FillRule aFillRule, Point aCurrentPoint = Point(),
Point aBeginPoint = Point())
: mFillRule(aFillRule)
, mCurrentPoint(aCurrentPoint)
, mBeginPoint(aBeginPoint) {
: mFillRule(aFillRule),
mCurrentPoint(aCurrentPoint),
mBeginPoint(aBeginPoint) {
mPath.swap(aPath);
}

Expand Down
3 changes: 2 additions & 1 deletion gfx/2d/ScaledFontDWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ bool UnscaledFontDWrite::GetFontFileData(FontFileDataOutput aDataCallback,
}

RefPtr<IDWriteFontFileStream> stream;
hr = loader->CreateStreamFromKey(referenceKey, refKeySize, getter_AddRefs(stream));
hr = loader->CreateStreamFromKey(referenceKey, refKeySize,
getter_AddRefs(stream));
if (FAILED(hr)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion gfx/config/gfxVars.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class gfxVarReceiver;
_(AllowD3D11KeyedMutex, bool, false) \
_(SystemTextQuality, int32_t, 5 /* CLEARTYPE_QUALITY */) \
_(LayersWindowRecordingPath, nsCString, nsCString()) \
_(RemoteCanvasEnabled, bool, false) \
_(RemoteCanvasEnabled, bool, false)

/* Add new entries above this line. */

Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/apz/public/APZUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class APZUpdater {
void UpdateFocusState(LayersId aRootLayerTreeId,
WRRootId aOriginatingWrRootId,
const FocusTarget& aFocusTarget);
void UpdateHitTestingTree(Layer* aRoot,
bool aIsFirstPaint, LayersId aOriginatingLayersId,
void UpdateHitTestingTree(Layer* aRoot, bool aIsFirstPaint,
LayersId aOriginatingLayersId,
uint32_t aPaintSequenceNumber);
/**
* This should be called (in the WR-enabled case) when the compositor receives
Expand Down
7 changes: 4 additions & 3 deletions gfx/layers/apz/src/APZCTreeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
*
* @param aRoot The root of the (full) layer tree
* @param aOriginatingLayersId The layers id of the subtree that triggered
* this repaint, and to which aIsFirstPaint applies.
* this repaint, and to which aIsFirstPaint
* applies.
* @param aIsFirstPaint True if the layers update that this is called in
* response to included a first-paint. If this is true,
* the part of the tree that is affected by the
Expand All @@ -196,8 +197,8 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
* process' layer subtree has its own sequence
* numbers.
*/
void UpdateHitTestingTree(Layer* aRoot,
bool aIsFirstPaint, LayersId aOriginatingLayersId,
void UpdateHitTestingTree(Layer* aRoot, bool aIsFirstPaint,
LayersId aOriginatingLayersId,
uint32_t aPaintSequenceNumber);

/**
Expand Down
Loading

0 comments on commit a801064

Please sign in to comment.