Skip to content

Commit

Permalink
Bug 1521000 - Part 1: Reformat the tree to ensure everything is forma…
Browse files Browse the repository at this point in the history
…tted correctly with clang-format r=sylvestre

Summary: # ignore-this-changeset

Reviewers: sylvestre

Reviewed By: sylvestre

Subscribers: reviewbot, emilio, jandem, bbouvier, karlt, jya

Bug #: 1521000

Differential Revision: https://phabricator.services.mozilla.com/D16936

--HG--
extra : histedit_source : 4add583bfa729ccc1aef934629ed45ff095189b0
  • Loading branch information
ehsan committed Jan 18, 2019
1 parent 3a99ace commit 06c3d29
Show file tree
Hide file tree
Showing 48 changed files with 242 additions and 233 deletions.
4 changes: 2 additions & 2 deletions accessible/base/nsCoreUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ bool nsCoreUtils::HasClickListener(nsIContent *aContent) {
listenerManager->HasListenersFor(nsGkAtoms::onmouseup));
}

void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree,
int32_t aRowIndex, nsTreeColumn *aColumn,
void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex,
nsTreeColumn *aColumn,
const nsAString &aPseudoElt) {
RefPtr<dom::Element> tcElm = aTree->GetTreeBody();
if (!tcElm) return;
Expand Down
18 changes: 8 additions & 10 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1062,9 +1062,8 @@ nsDOMNavigationTiming* nsDocShell::GetNavigationTiming() const {
innerTargetURI = NS_GetInnermostURI(targetURI);
}

return innerOriginURI && innerTargetURI &&
SchemeIsFile(innerOriginURI) &&
SchemeIsFile(innerTargetURI);
return innerOriginURI && innerTargetURI && SchemeIsFile(innerOriginURI) &&
SchemeIsFile(innerTargetURI);
}

nsPresContext* nsDocShell::GetEldestPresContext() {
Expand Down Expand Up @@ -5508,8 +5507,8 @@ nsDocShell::GetAllowMixedContentAndConnectionData(
// For things with system principal (e.g. scratchpad) there is no uri
// aRootHasSecureConnection should be false.
nsCOMPtr<nsIURI> rootUri = rootPrincipal->GetURI();
if (nsContentUtils::IsSystemPrincipal(rootPrincipal) ||
!rootUri || !SchemeIsHTTPS(rootUri)) {
if (nsContentUtils::IsSystemPrincipal(rootPrincipal) || !rootUri ||
!SchemeIsHTTPS(rootUri)) {
*aRootHasSecureConnection = false;
}

Expand Down Expand Up @@ -9770,9 +9769,8 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
true, // aInheritForAboutBlank
isSrcdoc);

bool isURIUniqueOrigin =
nsIOService::IsDataURIUniqueOpaqueOrigin() &&
SchemeIsData(aLoadState->URI());
bool isURIUniqueOrigin = nsIOService::IsDataURIUniqueOpaqueOrigin() &&
SchemeIsData(aLoadState->URI());
inheritPrincipal = inheritAttrs && !isURIUniqueOrigin;
}

Expand Down Expand Up @@ -9892,8 +9890,8 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
getter_AddRefs(channel));
} else {
rv = NS_NewInputStreamChannelInternal(
getter_AddRefs(channel), aLoadState->URI(), aSrcdoc,
NS_LITERAL_CSTRING("text/html"), loadInfo, true);
getter_AddRefs(channel), aLoadState->URI(), aSrcdoc,
NS_LITERAL_CSTRING("text/html"), loadInfo, true);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIInputStreamChannel> isc = do_QueryInterface(channel);
MOZ_ASSERT(isc);
Expand Down
5 changes: 3 additions & 2 deletions dom/events/EventStateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ EventStateManager::DeltaAccumulator*
EventStateManager::DeltaAccumulator::sInstance = nullptr;

constexpr const StyleCursorKind kInvalidCursorKind =
static_cast<StyleCursorKind>(255);
static_cast<StyleCursorKind>(255);

EventStateManager::EventStateManager()
: mLockCursor(kInvalidCursorKind),
Expand Down Expand Up @@ -3665,7 +3665,8 @@ void EventStateManager::UpdateCursor(nsPresContext* aPresContext,
// Show busy cursor everywhere before page loads
// and just replace the arrow cursor after page starts loading
if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY &&
(cursor == StyleCursorKind::Auto || cursor == StyleCursorKind::Default)) {
(cursor == StyleCursorKind::Auto ||
cursor == StyleCursorKind::Default)) {
cursor = StyleCursorKind::Progress;
container = nullptr;
}
Expand Down
10 changes: 4 additions & 6 deletions dom/ipc/PreallocatedProcessManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ class PreallocatedProcessManagerImpl final : public nsIObserver {

/* static */ StaticRefPtr<PreallocatedProcessManagerImpl>
PreallocatedProcessManagerImpl::sSingleton;
/* static */ uint32_t
PreallocatedProcessManagerImpl::sPrelaunchDelayMS = 0;
/* static */ uint32_t PreallocatedProcessManagerImpl::sPrelaunchDelayMS = 0;

/* static */ PreallocatedProcessManagerImpl*
PreallocatedProcessManagerImpl::Singleton() {
Expand All @@ -101,10 +100,9 @@ PreallocatedProcessManagerImpl::~PreallocatedProcessManagerImpl() {
}

void PreallocatedProcessManagerImpl::Init() {
Preferences::AddUintVarCache(
&sPrelaunchDelayMS,
"dom.ipc.processPrelaunch.delayMs",
DEFAULT_ALLOCATE_DELAY);
Preferences::AddUintVarCache(&sPrelaunchDelayMS,
"dom.ipc.processPrelaunch.delayMs",
DEFAULT_ALLOCATE_DELAY);
Preferences::AddStrongObserver(this, "dom.ipc.processPrelaunch.enabled");
// We have to respect processCount at all time. This is especially important
// for testing.
Expand Down
5 changes: 3 additions & 2 deletions dom/media/AutoplayPolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ static bool IsAllowedToPlayInternal(const HTMLMediaElement& aElement) {
}

nsPIDOMWindowInner* window = aContext.GetParentObject();
Document* approver = aContext.GetParentObject() ?
ApproverDocOf(*(window->GetExtantDoc())) : nullptr;
Document* approver = aContext.GetParentObject()
? ApproverDocOf(*(window->GetExtantDoc()))
: nullptr;
if (IsSiteInAutoplayWhiteList(approver)) {
AUTOPLAY_LOG(
"Allow autoplay as document has permanent autoplay permission.");
Expand Down
3 changes: 2 additions & 1 deletion dom/media/webaudio/AudioContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,8 @@ void AudioContext::MaybeUpdateAutoplayTelemetryWhenShutdown() {
}

void AudioContext::ReportBlocked() {
ReportToConsole(nsIScriptError::warningFlag, "BlockAutoplayWebAudioStartError");
ReportToConsole(nsIScriptError::warningFlag,
"BlockAutoplayWebAudioStartError");
mWasAllowedToStart = false;

if (!StaticPrefs::MediaBlockEventEnabled()) {
Expand Down
6 changes: 3 additions & 3 deletions dom/xul/XULTreeElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum class CallerType : uint32_t;

class XULTreeElement final : public nsXULElement {
public:
explicit XULTreeElement(already_AddRefed<mozilla::dom::NodeInfo> &&aNodeInfo)
explicit XULTreeElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
: nsXULElement(std::move(aNodeInfo)),
mCachedFirstVisibleRow(0),
mTreeBody(nullptr) {}
Expand Down Expand Up @@ -118,8 +118,8 @@ class XULTreeElement final : public nsXULElement {

virtual ~XULTreeElement() {}

JSObject *WrapNode(JSContext *aCx,
JS::Handle<JSObject *> aGivenProto) override;
JSObject* WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
};

} // namespace dom
Expand Down
10 changes: 5 additions & 5 deletions gfx/layers/ipc/LayerTransactionParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,11 @@ bool LayerTransactionParent::IsSameProcess() const {
void LayerTransactionParent::SetPendingTransactionId(
TransactionId aId, const VsyncId& aVsyncId,
const TimeStamp& aVsyncStartTime, const TimeStamp& aRefreshStartTime,
const TimeStamp& aTxnStartTime, const TimeStamp& aTxnEndTime, bool aContainsSVG,
const nsCString& aURL, const TimeStamp& aFwdTime) {
mPendingTransactions.AppendElement(
PendingTransaction{aId, aVsyncId, aVsyncStartTime, aRefreshStartTime,
aTxnStartTime, aTxnEndTime, aFwdTime, aURL, aContainsSVG});
const TimeStamp& aTxnStartTime, const TimeStamp& aTxnEndTime,
bool aContainsSVG, const nsCString& aURL, const TimeStamp& aFwdTime) {
mPendingTransactions.AppendElement(PendingTransaction{
aId, aVsyncId, aVsyncStartTime, aRefreshStartTime, aTxnStartTime,
aTxnEndTime, aFwdTime, aURL, aContainsSVG});
}

TransactionId LayerTransactionParent::FlushTransactionId(
Expand Down
22 changes: 10 additions & 12 deletions gfx/layers/wr/WebRenderCommandBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,8 @@ struct DIGroup {
geometry->ComputeInvalidationRegion());
aData->mGeometry = std::move(geometry);

IntRect transformedRect =
ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel,
mLayerBounds.TopLeft());
IntRect transformedRect = ToDeviceSpace(
clippedBounds, aMatrix, appUnitsPerDevPixel, mLayerBounds.TopLeft());
aData->mRect = transformedRect.Intersect(mImageBounds);
GP("CGC %s %d %d %d %d\n", aItem->Name(), clippedBounds.x,
clippedBounds.y, clippedBounds.width, clippedBounds.height);
Expand Down Expand Up @@ -441,9 +440,8 @@ struct DIGroup {
// matrix?
// XXX: TransformBounds is expensive. We should avoid doing it if we have
// no transform
IntRect transformedRect =
ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel,
mLayerBounds.TopLeft());
IntRect transformedRect = ToDeviceSpace(
clippedBounds, aMatrix, appUnitsPerDevPixel, mLayerBounds.TopLeft());
aData->mRect = transformedRect.Intersect(mImageBounds);
InvalidateRect(aData->mRect);
GP("new rect: %d %d %d %d\n", aData->mRect.x, aData->mRect.y,
Expand Down Expand Up @@ -551,8 +549,8 @@ struct DIGroup {
geometry->ComputeInvalidationRegion());
aData->mGeometry = std::move(geometry);
IntRect transformedRect =
ToDeviceSpace(clippedBounds, aMatrix,
appUnitsPerDevPixel, mLayerBounds.TopLeft());
ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel,
mLayerBounds.TopLeft());
InvalidateRect(aData->mRect.Intersect(mImageBounds));
aData->mRect = transformedRect.Intersect(mImageBounds);
InvalidateRect(aData->mRect);
Expand All @@ -562,8 +560,8 @@ struct DIGroup {
nsRect clippedBounds = clip.ApplyNonRoundedIntersection(
geometry->ComputeInvalidationRegion());
IntRect transformedRect =
ToDeviceSpace(clippedBounds, aMatrix,
appUnitsPerDevPixel, mLayerBounds.TopLeft());
ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel,
mLayerBounds.TopLeft());
// The invalid rect should contain the old rect and the new rect
// but may not because the parent may have been removed.
InvalidateRect(aData->mRect);
Expand All @@ -575,8 +573,8 @@ struct DIGroup {
nsRect clippedBounds = clip.ApplyNonRoundedIntersection(
geometry->ComputeInvalidationRegion());
IntRect transformedRect =
ToDeviceSpace(clippedBounds, aMatrix,
appUnitsPerDevPixel, mLayerBounds.TopLeft());
ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel,
mLayerBounds.TopLeft());
auto rect = transformedRect.Intersect(mImageBounds);
GP("Layer NoChange: %s %d %d %d %d\n", aItem->Name(),
aData->mRect.x, aData->mRect.y, aData->mRect.XMost(),
Expand Down
4 changes: 2 additions & 2 deletions gfx/src/FilterSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
namespace mozilla {
namespace gfx {
class FilterPrimitiveDescription;
} // namespace gfx
} // namespace mozilla
} // namespace gfx
} // namespace mozilla

DECLARE_USE_COPY_CONSTRUCTORS(mozilla::gfx::FilterPrimitiveDescription)

Expand Down
8 changes: 2 additions & 6 deletions gfx/vr/ipc/VRGPUChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@ static StaticRefPtr<VRGPUChild> sVRGPUChildSingleton;
sVRGPUChildSingleton = nullptr;
}

void VRGPUChild::ActorDestroy(ActorDestroyReason aWhy) {
mClosed = true;
}
void VRGPUChild::ActorDestroy(ActorDestroyReason aWhy) { mClosed = true; }

bool VRGPUChild::IsClosed() {
return mClosed;
}
bool VRGPUChild::IsClosed() { return mClosed; }

} // namespace gfx
} // namespace mozilla
11 changes: 3 additions & 8 deletions gfx/vr/ipc/VRGPUParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ namespace gfx {

using namespace ipc;

VRGPUParent::VRGPUParent(ProcessId aChildProcessId)
: mClosed(false) {
VRGPUParent::VRGPUParent(ProcessId aChildProcessId) : mClosed(false) {
MOZ_COUNT_CTOR(VRGPUParent);
MOZ_ASSERT(NS_IsMainThread());

SetOtherProcessId(aChildProcessId);
}

VRGPUParent::~VRGPUParent() {
MOZ_COUNT_DTOR(VRGPUParent);
}
VRGPUParent::~VRGPUParent() { MOZ_COUNT_DTOR(VRGPUParent); }

void VRGPUParent::ActorDestroy(ActorDestroyReason aWhy) {
#if !defined(MOZ_WIDGET_ANDROID)
Expand Down Expand Up @@ -80,9 +77,7 @@ mozilla::ipc::IPCResult VRGPUParent::RecvStopVRService() {
return IPC_OK();
}

bool VRGPUParent::IsClosed() {
return mClosed;
}
bool VRGPUParent::IsClosed() { return mClosed; }

} // namespace gfx
} // namespace mozilla
1 change: 0 additions & 1 deletion gfx/vr/ipc/VRGPUParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class VRGPUParent final : public PVRGPUParent {
bool IsClosed();

protected:

void Bind(Endpoint<PVRGPUParent>&& aEndpoint);
virtual mozilla::ipc::IPCResult RecvStartVRService() override;
virtual mozilla::ipc::IPCResult RecvStopVRService() override;
Expand Down
6 changes: 3 additions & 3 deletions gfx/webrender_bindings/WebRenderAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,12 +799,12 @@ wr::WrSpaceAndClip DisplayListBuilder::DefineScrollLayer(

// We haven't defined aViewId before, so let's define it now.
wr::WrSpaceAndClip defaultParent = wr::RootScrollNode();
//Note: we are currently ignoring the clipId on the stack here
// Note: we are currently ignoring the clipId on the stack here
defaultParent.space = mCurrentSpaceAndClipChain.space;

auto spaceAndClip = wr_dp_define_scroll_layer(
mWrState, aViewId, aParent ? aParent.ptr() : &defaultParent,
aContentRect, aClipRect);
mWrState, aViewId, aParent ? aParent.ptr() : &defaultParent, aContentRect,
aClipRect);

WRDL_LOG("DefineScrollLayer id=%" PRIu64 "/%zu p=%s co=%s cl=%s\n", mWrState,
aViewId, spaceAndClip.space.id,
Expand Down
4 changes: 1 addition & 3 deletions js/ipc/WrapperOwner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ const CPOWProxyHandler CPOWProxyHandler::singleton;
if (!owner->allowMessage(cx)) { \
return failRetVal; \
} \
{ \
return owner->call args; \
}
{ return owner->call args; }

bool CPOWProxyHandler::getOwnPropertyDescriptor(
JSContext* cx, HandleObject proxy, HandleId id,
Expand Down
3 changes: 1 addition & 2 deletions js/src/gc/GC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4223,8 +4223,7 @@ static void DiscardJITCodeForGC(JSRuntime* rt) {
for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
gcstats::AutoPhase ap(rt->gc.stats(),
gcstats::PhaseKind::MARK_DISCARD_CODE);
zone->discardJitCode(rt->defaultFreeOp(),
Zone::DiscardBaselineCode,
zone->discardJitCode(rt->defaultFreeOp(), Zone::DiscardBaselineCode,
Zone::ReleaseTypes);
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/src/gc/GCLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ class MOZ_RAII AutoUnlockGC {
AutoUnlockGC& operator=(const AutoUnlockGC&) = delete;
};

} // namespace js
} // namespace js

#endif /* gc_GCLock_h */
12 changes: 5 additions & 7 deletions js/src/gc/Zone.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,12 @@ class Zone : public JS::shadow::Zone,
DiscardBaselineCode
};

enum ShouldReleaseTypes : bool {
KeepTypes = false,
ReleaseTypes
};
enum ShouldReleaseTypes : bool { KeepTypes = false, ReleaseTypes };

void discardJitCode(js::FreeOp* fop,
ShouldDiscardBaselineCode discardBaselineCode = DiscardBaselineCode,
ShouldReleaseTypes releaseTypes = KeepTypes);
void discardJitCode(
js::FreeOp* fop,
ShouldDiscardBaselineCode discardBaselineCode = DiscardBaselineCode,
ShouldReleaseTypes releaseTypes = KeepTypes);

void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
size_t* typePool, size_t* regexpZone,
Expand Down
4 changes: 1 addition & 3 deletions js/src/vm/Realm.h
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,7 @@ class JS::Realm : public JS::shadow::Realm {
* principals during its lifetime (e.g. in case of lazy parsing).
*/
JSPrincipals* principals() { return principals_; }
void setPrincipals(JSPrincipals* principals) {
principals_ = principals;
}
void setPrincipals(JSPrincipals* principals) { principals_ = principals; }

bool isSystem() const { return isSystem_; }

Expand Down
3 changes: 1 addition & 2 deletions js/src/wasm/WasmInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,7 @@ bool Instance::memoryAccessInGuardRegion(uint8_t* addr,
lastByteOffset < memoryMappedSize();
}

bool Instance::memoryAccessInBounds(uint8_t* addr,
unsigned numBytes) const {
bool Instance::memoryAccessInBounds(uint8_t* addr, unsigned numBytes) const {
MOZ_ASSERT(numBytes > 0 && numBytes <= sizeof(double));

if (!metadata().usesMemory()) {
Expand Down
Loading

0 comments on commit 06c3d29

Please sign in to comment.