Bug 1512961 - Reformat recent changes to the Google coding style r=Ehsan

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sylvestre Ledru 2018-12-10 19:23:16 +00:00
Родитель 5dcce00594
Коммит ad75e912fb
30 изменённых файлов: 215 добавлений и 293 удалений

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

@ -80,15 +80,11 @@ void ProxyAccessibleWrap::ScrollTo(uint32_t aHow) const {
Proxy()->ScrollTo(aHow);
}
uint8_t
ProxyAccessibleWrap::ActionCount() const
{
uint8_t ProxyAccessibleWrap::ActionCount() const {
return Proxy()->ActionCount();
}
bool
ProxyAccessibleWrap::DoAction(uint8_t aIndex) const
{
bool ProxyAccessibleWrap::DoAction(uint8_t aIndex) const {
return Proxy()->DoAction(aIndex);
}

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

@ -332,7 +332,8 @@ void SessionAccessibility::ReplaceViewportCache(
AccessibleWrap* acc = aAccessibles.ElementAt(i);
if (aData.Length() == aAccessibles.Length()) {
const BatchData& data = aData.ElementAt(i);
auto bundle = acc->ToSmallBundle(data.State(), data.Bounds(), data.ActionCount());
auto bundle =
acc->ToSmallBundle(data.State(), data.Bounds(), data.ActionCount());
infos->SetElement(i, bundle);
} else {
infos->SetElement(i, acc->ToSmallBundle());

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

@ -1897,7 +1897,7 @@ class Element : public FragmentOrElement {
// descendants of display: none elements.
mozilla::RustCell<ServoNodeData*> mServoData;
protected:
protected:
// Array containing all attributes for this element
AttrArray mAttrs;
};

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

@ -17,17 +17,14 @@ static StaticAutoPtr<WGCByIdMap> gWindowGlobalChildById;
WindowGlobalChild::WindowGlobalChild(nsGlobalWindowInner* aWindow,
dom::BrowsingContext* aBrowsingContext)
: mWindowGlobal(aWindow)
, mBrowsingContext(aBrowsingContext)
, mInnerWindowId(aWindow->WindowID())
, mOuterWindowId(aWindow->GetOuterWindow()->WindowID())
, mIPCClosed(true)
{
}
: mWindowGlobal(aWindow),
mBrowsingContext(aBrowsingContext),
mInnerWindowId(aWindow->WindowID()),
mOuterWindowId(aWindow->GetOuterWindow()->WindowID()),
mIPCClosed(true) {}
already_AddRefed<WindowGlobalChild>
WindowGlobalChild::Create(nsGlobalWindowInner* aWindow)
{
already_AddRefed<WindowGlobalChild> WindowGlobalChild::Create(
nsGlobalWindowInner* aWindow) {
nsCOMPtr<nsIPrincipal> principal = aWindow->GetPrincipal();
MOZ_ASSERT(principal);
@ -40,8 +37,7 @@ WindowGlobalChild::Create(nsGlobalWindowInner* aWindow)
WindowGlobalInit init(principal,
BrowsingContextId(wgc->BrowsingContext()->Id()),
wgc->mInnerWindowId,
wgc->mOuterWindowId);
wgc->mInnerWindowId, wgc->mOuterWindowId);
// Send the link constructor over PInProcessChild or PBrowser.
if (XRE_IsParentProcess()) {
@ -53,7 +49,8 @@ WindowGlobalChild::Create(nsGlobalWindowInner* aWindow)
// Note: ref is released in DeallocPWindowGlobalChild
ipc->SendPWindowGlobalConstructor(do_AddRef(wgc).take(), init);
} else {
RefPtr<TabChild> tabChild = TabChild::GetFrom(static_cast<mozIDOMWindow*>(aWindow));
RefPtr<TabChild> tabChild =
TabChild::GetFrom(static_cast<mozIDOMWindow*>(aWindow));
MOZ_ASSERT(tabChild);
// Note: ref is released in DeallocPWindowGlobalChild
@ -74,23 +71,18 @@ WindowGlobalChild::Create(nsGlobalWindowInner* aWindow)
}
/* static */ already_AddRefed<WindowGlobalChild>
WindowGlobalChild::GetByInnerWindowId(uint64_t aInnerWindowId)
{
WindowGlobalChild::GetByInnerWindowId(uint64_t aInnerWindowId) {
if (!gWindowGlobalChildById) {
return nullptr;
}
return gWindowGlobalChildById->Get(aInnerWindowId);
}
bool
WindowGlobalChild::IsCurrentGlobal()
{
bool WindowGlobalChild::IsCurrentGlobal() {
return !mIPCClosed && mWindowGlobal->IsCurrentInnerWindow();
}
already_AddRefed<WindowGlobalParent>
WindowGlobalChild::GetParentActor()
{
already_AddRefed<WindowGlobalParent> WindowGlobalChild::GetParentActor() {
if (mIPCClosed) {
return nullptr;
}
@ -98,38 +90,30 @@ WindowGlobalChild::GetParentActor()
return do_AddRef(static_cast<WindowGlobalParent*>(otherSide));
}
void
WindowGlobalChild::ActorDestroy(ActorDestroyReason aWhy)
{
void WindowGlobalChild::ActorDestroy(ActorDestroyReason aWhy) {
mIPCClosed = true;
gWindowGlobalChildById->Remove(mInnerWindowId);
}
WindowGlobalChild::~WindowGlobalChild()
{
WindowGlobalChild::~WindowGlobalChild() {
MOZ_ASSERT(!gWindowGlobalChildById ||
!gWindowGlobalChildById->Contains(mInnerWindowId));
}
JSObject*
WindowGlobalChild::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto)
{
JSObject* WindowGlobalChild::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
return WindowGlobalChild_Binding::Wrap(aCx, this, aGivenProto);
}
nsISupports*
WindowGlobalChild::GetParentObject()
{
nsISupports* WindowGlobalChild::GetParentObject() {
return xpc::NativeGlobal(xpc::PrivilegedJunkScope());
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WindowGlobalChild,
mWindowGlobal,
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WindowGlobalChild, mWindowGlobal,
mBrowsingContext)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WindowGlobalChild, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WindowGlobalChild, Release)
} // namespace dom
} // namespace mozilla
} // namespace dom
} // namespace mozilla

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

@ -15,7 +15,7 @@ class nsGlobalWindowInner;
class nsDocShell;
namespace mozilla {
namespace dom {
namespace dom {
class BrowsingContext;
class WindowGlobalParent;
@ -24,18 +24,16 @@ class WindowGlobalParent;
* Actor for a single nsGlobalWindowInner. This actor is used to communicate
* information to the parent process asynchronously.
*/
class WindowGlobalChild : public nsWrapperCache
, public PWindowGlobalChild
{
public:
class WindowGlobalChild : public nsWrapperCache, public PWindowGlobalChild {
public:
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WindowGlobalChild)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WindowGlobalChild)
static already_AddRefed<WindowGlobalChild>
GetByInnerWindowId(uint64_t aInnerWindowId);
static already_AddRefed<WindowGlobalChild> GetByInnerWindowId(
uint64_t aInnerWindowId);
static already_AddRefed<WindowGlobalChild>
GetByInnerWindowId(const GlobalObject& aGlobal, uint64_t aInnerWindowId) {
static already_AddRefed<WindowGlobalChild> GetByInnerWindowId(
const GlobalObject& aGlobal, uint64_t aInnerWindowId) {
return GetByInnerWindowId(aInnerWindowId);
}
@ -60,17 +58,17 @@ public:
already_AddRefed<WindowGlobalParent> GetParentActor();
// Create and initialize the WindowGlobalChild object.
static already_AddRefed<WindowGlobalChild>
Create(nsGlobalWindowInner* aWindow);
static already_AddRefed<WindowGlobalChild> Create(
nsGlobalWindowInner* aWindow);
nsISupports* GetParentObject();
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
protected:
protected:
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
private:
private:
WindowGlobalChild(nsGlobalWindowInner* aWindow, dom::BrowsingContext* aBc);
~WindowGlobalChild();
@ -81,7 +79,7 @@ private:
bool mIPCClosed;
};
} // namespace dom
} // namespace mozilla
} // namespace dom
} // namespace mozilla
#endif // !defined(mozilla_dom_WindowGlobalChild_h)
#endif // !defined(mozilla_dom_WindowGlobalChild_h)

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

@ -19,11 +19,11 @@ static StaticAutoPtr<WGPByIdMap> gWindowGlobalParentsById;
WindowGlobalParent::WindowGlobalParent(const WindowGlobalInit& aInit,
bool aInProcess)
: mDocumentPrincipal(aInit.principal())
, mInnerWindowId(aInit.innerWindowId())
, mOuterWindowId(aInit.outerWindowId())
, mInProcess(aInProcess)
, mIPCClosed(true) // Closed until WGP::Init
: mDocumentPrincipal(aInit.principal()),
mInnerWindowId(aInit.innerWindowId()),
mOuterWindowId(aInit.outerWindowId()),
mInProcess(aInProcess),
mIPCClosed(true) // Closed until WGP::Init
{
MOZ_DIAGNOSTIC_ASSERT(XRE_IsParentProcess(), "Parent process only");
MOZ_RELEASE_ASSERT(mDocumentPrincipal, "Must have a valid principal");
@ -33,9 +33,7 @@ WindowGlobalParent::WindowGlobalParent(const WindowGlobalInit& aInit,
"Must be made in BrowsingContext");
}
void
WindowGlobalParent::Init(const WindowGlobalInit& aInit)
{
void WindowGlobalParent::Init(const WindowGlobalInit& aInit) {
MOZ_ASSERT(Manager(), "Should have a manager!");
MOZ_ASSERT(!mFrameLoader, "Cannot Init() a WindowGlobalParent twice!");
@ -77,7 +75,8 @@ WindowGlobalParent::Init(const WindowGlobalInit& aInit)
RefPtr<WindowGlobalChild> otherSide = GetChildActor();
if (otherSide && otherSide->WindowGlobal()) {
// Get the toplevel window from the other side.
RefPtr<nsDocShell> docShell = nsDocShell::Cast(otherSide->WindowGlobal()->GetDocShell());
RefPtr<nsDocShell> docShell =
nsDocShell::Cast(otherSide->WindowGlobal()->GetDocShell());
if (docShell) {
docShell->GetTopFrameElement(getter_AddRefs(frameElement));
}
@ -97,17 +96,14 @@ WindowGlobalParent::Init(const WindowGlobalInit& aInit)
}
/* static */ already_AddRefed<WindowGlobalParent>
WindowGlobalParent::GetByInnerWindowId(uint64_t aInnerWindowId)
{
WindowGlobalParent::GetByInnerWindowId(uint64_t aInnerWindowId) {
if (!gWindowGlobalParentsById) {
return nullptr;
}
return gWindowGlobalParentsById->Get(aInnerWindowId);
}
already_AddRefed<WindowGlobalChild>
WindowGlobalParent::GetChildActor()
{
already_AddRefed<WindowGlobalChild> WindowGlobalParent::GetChildActor() {
if (mIPCClosed) {
return nullptr;
}
@ -115,61 +111,47 @@ WindowGlobalParent::GetChildActor()
return do_AddRef(static_cast<WindowGlobalChild*>(otherSide));
}
IPCResult
WindowGlobalParent::RecvUpdateDocumentURI(nsIURI* aURI)
{
IPCResult WindowGlobalParent::RecvUpdateDocumentURI(nsIURI* aURI) {
// XXX(nika): Assert that the URI change was one which makes sense (either
// about:blank -> a real URI, or a legal push/popstate URI change?)
mDocumentURI = aURI;
return IPC_OK();
}
IPCResult
WindowGlobalParent::RecvBecomeCurrentWindowGlobal()
{
IPCResult WindowGlobalParent::RecvBecomeCurrentWindowGlobal() {
mBrowsingContext->SetCurrentWindowGlobal(this);
return IPC_OK();
}
bool
WindowGlobalParent::IsCurrentGlobal()
{
bool WindowGlobalParent::IsCurrentGlobal() {
return !mIPCClosed && mBrowsingContext->GetCurrentWindowGlobal() == this;
}
void
WindowGlobalParent::ActorDestroy(ActorDestroyReason aWhy)
{
void WindowGlobalParent::ActorDestroy(ActorDestroyReason aWhy) {
mIPCClosed = true;
gWindowGlobalParentsById->Remove(mInnerWindowId);
mBrowsingContext->UnregisterWindowGlobal(this);
}
WindowGlobalParent::~WindowGlobalParent()
{
WindowGlobalParent::~WindowGlobalParent() {
MOZ_ASSERT(!gWindowGlobalParentsById ||
!gWindowGlobalParentsById->Contains(mInnerWindowId));
}
JSObject*
WindowGlobalParent::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto)
{
JSObject* WindowGlobalParent::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
return WindowGlobalParent_Binding::Wrap(aCx, this, aGivenProto);
}
nsISupports*
WindowGlobalParent::GetParentObject()
{
nsISupports* WindowGlobalParent::GetParentObject() {
return xpc::NativeGlobal(xpc::PrivilegedJunkScope());
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WindowGlobalParent,
mFrameLoader,
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WindowGlobalParent, mFrameLoader,
mBrowsingContext)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WindowGlobalParent, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WindowGlobalParent, Release)
} // namespace dom
} // namespace mozilla
} // namespace dom
} // namespace mozilla

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

@ -16,7 +16,7 @@ class nsIURI;
class nsFrameLoader;
namespace mozilla {
namespace dom {
namespace dom {
class ChromeBrowsingContext;
class WindowGlobalChild;
@ -24,18 +24,17 @@ class WindowGlobalChild;
/**
* A handle in the parent process to a specific nsGlobalWindowInner object.
*/
class WindowGlobalParent final : public nsWrapperCache
, public PWindowGlobalParent
{
public:
class WindowGlobalParent final : public nsWrapperCache,
public PWindowGlobalParent {
public:
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WindowGlobalParent)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WindowGlobalParent)
static already_AddRefed<WindowGlobalParent>
GetByInnerWindowId(uint64_t aInnerWindowId);
static already_AddRefed<WindowGlobalParent> GetByInnerWindowId(
uint64_t aInnerWindowId);
static already_AddRefed<WindowGlobalParent>
GetByInnerWindowId(const GlobalObject& aGlobal, uint64_t aInnerWindowId) {
static already_AddRefed<WindowGlobalParent> GetByInnerWindowId(
const GlobalObject& aGlobal, uint64_t aInnerWindowId) {
return GetByInnerWindowId(aInnerWindowId);
}
@ -85,14 +84,14 @@ public:
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
protected:
protected:
// IPC messages
mozilla::ipc::IPCResult RecvUpdateDocumentURI(nsIURI* aURI) override;
mozilla::ipc::IPCResult RecvBecomeCurrentWindowGlobal() override;
void ActorDestroy(ActorDestroyReason aWhy) override;
private:
private:
~WindowGlobalParent();
// NOTE: This document principal doesn't reflect possible |document.domain|
@ -107,7 +106,7 @@ private:
bool mIPCClosed;
};
} // namespace dom
} // namespace mozilla
} // namespace dom
} // namespace mozilla
#endif // !defined(mozilla_dom_WindowGlobalParent_h)
#endif // !defined(mozilla_dom_WindowGlobalParent_h)

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

@ -14,7 +14,8 @@ namespace rtc {
#if defined(WEBRTC_WIN)
// For use in ThreadWindowsUI callbacks
static UINT static_reg_windows_msg = RegisterWindowMessageW(L"WebrtcWindowsUIThreadEvent");
static UINT static_reg_windows_msg =
RegisterWindowMessageW(L"WebrtcWindowsUIThreadEvent");
// timer id used in delayed callbacks
static const UINT_PTR kTimerId = 1;
static const wchar_t kThisProperty[] = L"ThreadWindowsUIPtr";
@ -34,9 +35,8 @@ bool PlatformUIThread::InternalInit() {
wc.lpszClassName = kThreadWindow;
RegisterClassW(&wc);
}
hwnd_ = CreateWindowW(kThreadWindow, L"",
0, 0, 0, 0, 0,
NULL, NULL, hModule, NULL);
hwnd_ = CreateWindowW(kThreadWindow, L"", 0, 0, 0, 0, 0, NULL, NULL,
hModule, NULL);
RTC_DCHECK(hwnd_);
SetPropW(hwnd_, kThisProperty, this);
@ -89,7 +89,7 @@ void PlatformUIThread::Stop() {
}
void PlatformUIThread::Run() {
RTC_CHECK(InternalInit()); // always evaluates
RTC_CHECK(InternalInit()); // always evaluates
do {
// The interface contract of Start/Stop is that for a successful call to
// Start, there should be at least one call to the run function. So we
@ -123,15 +123,17 @@ void PlatformUIThread::NativeEventCallback() {
}
/* static */
LRESULT CALLBACK
PlatformUIThread::EventWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
LRESULT CALLBACK PlatformUIThread::EventWindowProc(HWND hwnd, UINT uMsg,
WPARAM wParam,
LPARAM lParam) {
if (uMsg == WM_DESTROY) {
RemovePropW(hwnd, kThisProperty);
PostQuitMessage(0);
return 0;
}
PlatformUIThread *twui = static_cast<PlatformUIThread*>(GetPropW(hwnd, kThisProperty));
PlatformUIThread *twui =
static_cast<PlatformUIThread *>(GetPropW(hwnd, kThisProperty));
if (!twui) {
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}

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

@ -468,8 +468,8 @@ bool AnimationFrameRecyclingQueue::MarkComplete(
// If we encounter a redecode error, just make the first frame refresh area to
// be the full frame, because we don't really know what we can safely recycle.
mFirstFrameRefreshArea = mRedecodeError ? mFirstFrame->GetRect()
: aFirstFrameRefreshArea;
mFirstFrameRefreshArea =
mRedecodeError ? mFirstFrame->GetRect() : aFirstFrameRefreshArea;
return continueDecoding;
}

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

@ -12,20 +12,17 @@ using namespace mozilla::dom;
namespace mozilla {
namespace ipc {
PWindowGlobalChild*
InProcessChild::AllocPWindowGlobalChild(const WindowGlobalInit& aInit)
{
PWindowGlobalChild* InProcessChild::AllocPWindowGlobalChild(
const WindowGlobalInit& aInit) {
MOZ_ASSERT_UNREACHABLE("PWindowGlobalChild should not be created manually");
return nullptr;
}
bool
InProcessChild::DeallocPWindowGlobalChild(PWindowGlobalChild* aActor)
{
bool InProcessChild::DeallocPWindowGlobalChild(PWindowGlobalChild* aActor) {
// Free IPC-held reference
static_cast<WindowGlobalChild*>(aActor)->Release();
return true;
}
} // namespace ipc
} // namespace mozilla
} // namespace ipc
} // namespace mozilla

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

@ -14,7 +14,7 @@ namespace mozilla {
namespace dom {
class PWindowGlobalParent;
class PWindowGlobalChild;
} // namespace dom
} // namespace dom
namespace ipc {
@ -28,9 +28,8 @@ class InProcessParent;
* for async actors which want to communicate uniformly between Content->Chrome
* and Chrome->Chrome situations.
*/
class InProcessChild : public PInProcessChild
{
public:
class InProcessChild : public PInProcessChild {
public:
friend class InProcessParent;
NS_INLINE_DECL_REFCOUNTING(InProcessChild)
@ -43,14 +42,14 @@ public:
// |nullptr|.
static IProtocol* ParentActorFor(IProtocol* aActor);
protected:
virtual mozilla::dom::PWindowGlobalChild*
AllocPWindowGlobalChild(const WindowGlobalInit& aInit) override;
protected:
virtual mozilla::dom::PWindowGlobalChild* AllocPWindowGlobalChild(
const WindowGlobalInit& aInit) override;
virtual bool
DeallocPWindowGlobalChild(mozilla::dom::PWindowGlobalChild* aActor) override;
virtual bool DeallocPWindowGlobalChild(
mozilla::dom::PWindowGlobalChild* aActor) override;
private:
private:
// NOTE: PInProcess lifecycle management is declared as staic methods and
// state on InProcessParent, and implemented in InProcessImpl.cpp.
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
@ -60,7 +59,7 @@ private:
static StaticRefPtr<InProcessChild> sSingleton;
};
} // namespace ipc
} // namespace mozilla
} // namespace ipc
} // namespace mozilla
#endif // defined(mozilla_ipc_InProcessChild_h)
#endif // defined(mozilla_ipc_InProcessChild_h)

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

@ -19,13 +19,11 @@ StaticRefPtr<InProcessParent> InProcessParent::sSingleton;
StaticRefPtr<InProcessChild> InProcessChild::sSingleton;
bool InProcessParent::sShutdown = false;
//////////////////////////////////////////
// InProcess actor lifecycle management //
//////////////////////////////////////////
/* static */ InProcessChild*
InProcessChild::Singleton() {
/* static */ InProcessChild* InProcessChild::Singleton() {
MOZ_ASSERT(NS_IsMainThread());
if (!sSingleton) {
@ -34,8 +32,7 @@ InProcessChild::Singleton() {
return sSingleton;
}
/* static */ InProcessParent*
InProcessParent::Singleton() {
/* static */ InProcessParent* InProcessParent::Singleton() {
MOZ_ASSERT(NS_IsMainThread());
if (!sSingleton) {
@ -44,9 +41,7 @@ InProcessParent::Singleton() {
return sSingleton;
}
/* static */ void
InProcessParent::Startup()
{
/* static */ void InProcessParent::Startup() {
MOZ_ASSERT(NS_IsMainThread());
if (sShutdown) {
@ -87,10 +82,7 @@ InProcessParent::Startup()
InProcessChild::sSingleton = child.forget();
}
/* static */ void
InProcessParent::Shutdown()
{
/* static */ void InProcessParent::Shutdown() {
MOZ_ASSERT(NS_IsMainThread());
if (!sSingleton || sShutdown) {
@ -109,37 +101,29 @@ InProcessParent::Shutdown()
}
NS_IMETHODIMP
InProcessParent::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{
InProcessParent::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
MOZ_ASSERT(!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID));
InProcessParent::Shutdown();
return NS_OK;
}
void
InProcessParent::ActorDestroy(ActorDestroyReason aWhy)
{
void InProcessParent::ActorDestroy(ActorDestroyReason aWhy) {
InProcessParent::Shutdown();
}
void
InProcessChild::ActorDestroy(ActorDestroyReason aWhy)
{
void InProcessChild::ActorDestroy(ActorDestroyReason aWhy) {
InProcessParent::Shutdown();
}
void
InProcessParent::DeallocPInProcessParent()
{
void InProcessParent::DeallocPInProcessParent() {
MOZ_ASSERT(!InProcessParent::sSingleton);
Release(); // Release the reference taken in InProcessParent::Startup.
Release(); // Release the reference taken in InProcessParent::Startup.
}
void
InProcessChild::DeallocPInProcessChild()
{
void InProcessChild::DeallocPInProcessChild() {
MOZ_ASSERT(!InProcessChild::sSingleton);
Release(); // Release the reference taken in InProcessParent::Startup.
Release(); // Release the reference taken in InProcessParent::Startup.
}
////////////////////////////////
@ -147,21 +131,19 @@ InProcessChild::DeallocPInProcessChild()
////////////////////////////////
// Helper method for implementing ParentActorFor and ChildActorFor.
static IProtocol*
GetOtherInProcessActor(IProtocol* aActor)
{
static IProtocol* GetOtherInProcessActor(IProtocol* aActor) {
MOZ_ASSERT(aActor->GetSide() != UnknownSide, "bad unknown side");
// Discover the manager of aActor which is PInProcess.
IProtocol* current = aActor;
while (current) {
if (current->GetProtocolTypeId() == PInProcessMsgStart) {
break; // Found the correct actor.
break; // Found the correct actor.
}
current = current->Manager();
}
if (!current) {
return nullptr; // Not a PInProcess actor, return |nullptr|
return nullptr; // Not a PInProcess actor, return |nullptr|
}
MOZ_ASSERT(current->GetSide() == aActor->GetSide(), "side changed?");
@ -194,19 +176,15 @@ GetOtherInProcessActor(IProtocol* aActor)
return otherActor;
}
/* static */ IProtocol*
InProcessParent::ChildActorFor(IProtocol* aActor)
{
/* static */ IProtocol* InProcessParent::ChildActorFor(IProtocol* aActor) {
MOZ_ASSERT(aActor && aActor->GetSide() == ParentSide);
return GetOtherInProcessActor(aActor);
}
/* static */ IProtocol*
InProcessChild::ParentActorFor(IProtocol* aActor)
{
/* static */ IProtocol* InProcessChild::ParentActorFor(IProtocol* aActor) {
MOZ_ASSERT(aActor && aActor->GetSide() == ChildSide);
return GetOtherInProcessActor(aActor);
}
} // namespace ipc
} // namespace mozilla
} // namespace ipc
} // namespace mozilla

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

@ -14,28 +14,23 @@ namespace ipc {
NS_IMPL_ISUPPORTS(InProcessParent, nsIObserver)
IPCResult
InProcessParent::RecvPWindowGlobalConstructor(PWindowGlobalParent* aActor,
const WindowGlobalInit& aInit)
{
IPCResult InProcessParent::RecvPWindowGlobalConstructor(
PWindowGlobalParent* aActor, const WindowGlobalInit& aInit) {
static_cast<WindowGlobalParent*>(aActor)->Init(aInit);
return IPC_OK();
}
PWindowGlobalParent*
InProcessParent::AllocPWindowGlobalParent(const WindowGlobalInit& aInit)
{
PWindowGlobalParent* InProcessParent::AllocPWindowGlobalParent(
const WindowGlobalInit& aInit) {
// Reference freed in DeallocPWindowGlobalParent.
return do_AddRef(new WindowGlobalParent(aInit, /* inproc */ true)).take();
}
bool
InProcessParent::DeallocPWindowGlobalParent(PWindowGlobalParent* aActor)
{
bool InProcessParent::DeallocPWindowGlobalParent(PWindowGlobalParent* aActor) {
// Free IPC-held reference.
static_cast<WindowGlobalParent*>(aActor)->Release();
return true;
}
} // namespace ipc
} // namespace mozilla
} // namespace ipc
} // namespace mozilla

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

@ -14,7 +14,7 @@ namespace mozilla {
namespace dom {
class PWindowGlobalParent;
class PWindowGlobalChild;
} // namespace dom
} // namespace dom
namespace ipc {
@ -28,10 +28,8 @@ class InProcessChild;
* for async actors which want to communicate uniformly between Content->Chrome
* and Chrome->Chrome situations.
*/
class InProcessParent : public nsIObserver
, public PInProcessParent
{
public:
class InProcessParent : public nsIObserver, public PInProcessParent {
public:
friend class InProcessChild;
NS_DECL_ISUPPORTS
@ -45,18 +43,18 @@ public:
// |nullptr|.
static IProtocol* ChildActorFor(IProtocol* aActor);
protected:
virtual mozilla::dom::PWindowGlobalParent*
AllocPWindowGlobalParent(const WindowGlobalInit& aInit) override;
protected:
virtual mozilla::dom::PWindowGlobalParent* AllocPWindowGlobalParent(
const WindowGlobalInit& aInit) override;
virtual bool
DeallocPWindowGlobalParent(mozilla::dom::PWindowGlobalParent* aActor) override;
virtual bool DeallocPWindowGlobalParent(
mozilla::dom::PWindowGlobalParent* aActor) override;
virtual IPCResult
RecvPWindowGlobalConstructor(mozilla::dom::PWindowGlobalParent* aActor,
const WindowGlobalInit& aInit) override;
virtual IPCResult RecvPWindowGlobalConstructor(
mozilla::dom::PWindowGlobalParent* aActor,
const WindowGlobalInit& aInit) override;
private:
private:
// Lifecycle management is implemented in InProcessImpl.cpp
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual void DeallocPInProcessParent() override;
@ -69,8 +67,7 @@ private:
static bool sShutdown;
};
} // namespace ipc
} // namespace mozilla
} // namespace ipc
} // namespace mozilla
#endif // defined(mozilla_ipc_InProcessParent_h)
#endif // defined(mozilla_ipc_InProcessParent_h)

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

@ -110,12 +110,11 @@ struct MapTypeToTraceKind {
// from somewhere unknown, and results in leaking the subgraph which contains
// the key.
// See the comments in NoteWeakMapsTracer::trace for more details.
inline constexpr bool IsCCTraceKind(JS::TraceKind aKind)
{
inline constexpr bool IsCCTraceKind(JS::TraceKind aKind) {
switch (aKind) {
#define JS_EXPAND_DEF(name, _, isCCTraceKind) \
case JS::TraceKind::name: \
return isCCTraceKind;
case JS::TraceKind::name: \
return isCCTraceKind;
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
#undef JS_EXPAND_DEF
default:

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

@ -215,9 +215,9 @@ void LIRGeneratorARM64::lowerDivI(MDiv* div) {
void LIRGeneratorARM64::lowerMulI(MMul* mul, MDefinition* lhs,
MDefinition* rhs) {
LMulI* lir = new(alloc()) LMulI;
LMulI* lir = new (alloc()) LMulI;
if (mul->fallible()) {
assignSnapshot(lir, Bailout_DoubleOutput);
assignSnapshot(lir, Bailout_DoubleOutput);
}
lowerForALU(lir, mul, lhs, rhs);
}

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

@ -1465,7 +1465,7 @@ extern JS_PUBLIC_API bool OrdinaryHasInstance(JSContext* cx,
// This is almost identical to JS_HasInstance, except the latter may call a
// custom hasInstance class op instead of InstanceofOperator.
extern JS_PUBLIC_API bool InstanceofOperator(JSContext* cx, HandleObject obj,
HandleValue v, bool* bp);
HandleValue v, bool* bp);
} // namespace JS

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

@ -176,7 +176,7 @@ void StructuredSpewer::parseSpewFlags(const char* flags) {
#undef CHECK_CHANNEL
if (ContainsFlag(flags, "help")) {
printf(
printf(
"\n"
"usage: SPEW=option,option,option,... where options can be:\n"
"\n"
@ -208,7 +208,7 @@ void StructuredSpewer::parseSpewFlags(const char* flags) {
" output goes to $MOZ_UPLOAD_DIR/spew_output* to ease usage\n"
" with Treeherder.\n"
);
);
exit(0);
}
}

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

@ -9,7 +9,7 @@
#include <stdint.h>
#include "nsStyleConsts.h"
#include "nsStyleCoord.h" // for nsStyleCoord
#include "nsStyleCoord.h" // for nsStyleCoord
#include "mozilla/dom/WindowBinding.h"
// Forward declarations

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

@ -1593,7 +1593,7 @@ NS_QUERYFRAME_HEAD(nsXULScrollFrame)
NS_QUERYFRAME_ENTRY(nsIScrollbarMediator)
NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
//-------------------- Helper ----------------------
//-------------------- Helper ----------------------
#define SMOOTH_SCROLL_PREF_NAME "general.smoothScroll"

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

@ -46,7 +46,7 @@ static const char sPrintSettingsServiceContractID[] =
#include "nsIWebBrowserPrint.h"
// Print Preview
#include "imgIContainer.h" // image animation mode constants
#include "imgIContainer.h" // image animation mode constants
// Print Progress
#include "nsIPrintProgress.h"

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

@ -92,8 +92,7 @@ void nsLeafBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// leaf boxes continue to receive events in the foreground layer.
DisplayBorderBackgroundOutline(aBuilder, aLists);
if (!aBuilder->IsForEventDelivery() || !IsVisibleForPainting())
return;
if (!aBuilder->IsForEventDelivery() || !IsVisibleForPainting()) return;
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayEventReceiver>(aBuilder, this));

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

@ -2564,8 +2564,7 @@ class nsDisplayTreeBody final : public nsDisplayItem {
void nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
// REVIEW: why did we paint if we were collapsed? that makes no sense!
if (!IsVisibleForPainting())
return; // We're invisible. Don't paint.
if (!IsVisibleForPainting()) return; // We're invisible. Don't paint.
// Handles painting our background, border, and outline.
nsLeafBoxFrame::BuildDisplayList(aBuilder, aLists);

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

@ -24,4 +24,3 @@
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_UNISTD_H 1

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

@ -83,8 +83,7 @@ void NetworkConnectivityService::PerformChecks() {
RecheckIPConnectivity();
}
static inline void NotifyObservers(const char *aTopic)
{
static inline void NotifyObservers(const char *aTopic) {
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
obs->NotifyObservers(nullptr, aTopic, nullptr);
}

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

@ -1773,13 +1773,14 @@ nsUrlClassifierDBService::AsyncClassifyLocalWithTables(
if (!tables.IsEmpty()) {
nsCOMPtr<nsIURIClassifierCallback> callback(aCallback);
nsCOMPtr<nsIRunnable> cbRunnable = NS_NewRunnableFunction(
"nsUrlClassifierDBService::AsyncClassifyLocalWithTables",
[callback, tables]() -> void {
callback->OnClassifyComplete(NS_OK, // Not used.
tables,
EmptyCString(), // provider. (Not used)
EmptyCString()); // prefix. (Not used)
});
"nsUrlClassifierDBService::AsyncClassifyLocalWithTables",
[callback, tables]() -> void {
callback->OnClassifyComplete(
NS_OK, // Not used.
tables,
EmptyCString(), // provider. (Not used)
EmptyCString()); // prefix. (Not used)
});
NS_DispatchToMainThread(cbRunnable);
return NS_OK;

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

@ -111,8 +111,7 @@ class StableHashTableInfo {
mCallbackStorage(nullptr),
mDestroyed(false),
mTable(nullptr),
mCallbackHash(0)
{
mCallbackHash(0) {
// Use AllocateMemory, as the result will have RWX permissions.
mCallbackStorage =
(uint8_t*)AllocateMemory(CallbackStorageCapacity, MemoryKind::Tracked);
@ -142,7 +141,8 @@ class StableHashTableInfo {
mCallbackHash = HashBytes(mCallbackStorage, mCallbackStorageSize);
} else {
MOZ_RELEASE_ASSERT(mTable == aTable);
MOZ_RELEASE_ASSERT(mCallbackHash == HashBytes(mCallbackStorage, mCallbackStorageSize));
MOZ_RELEASE_ASSERT(mCallbackHash ==
HashBytes(mCallbackStorage, mCallbackStorageSize));
}
}
@ -212,8 +212,7 @@ class StableHashTableInfo {
explicit Assembler(StableHashTableInfo& aInfo)
: recordreplay::Assembler(aInfo.mCallbackStorage,
CallbackStorageCapacity),
mInfo(aInfo)
{}
mInfo(aInfo) {}
~Assembler() {
mInfo.mCallbackStorageSize = Current() - mInfo.mCallbackStorage;
@ -424,7 +423,7 @@ void DestroyPLHashTableCallbacks(void* aAllocPrivate) {
PLHashTableInfo* info = PLHashTableInfo::MaybeFromPrivate(aAllocPrivate);
if (info) {
info->MarkDestroyed();
//delete info;
// delete info;
}
}

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

@ -2506,54 +2506,53 @@ static SystemRedirection gSystemRedirections[] = {
// cannot use dlsym() to lookup symbols that are not externally visible.
// Functions which are not overloaded.
#define FOR_EACH_DIAGNOSTIC_REDIRECTION(MACRO) \
MACRO(PL_HashTableAdd, Preamble_PLHashTable) \
MACRO(PL_HashTableRemove, Preamble_PLHashTable) \
MACRO(PL_HashTableLookup, Preamble_PLHashTable) \
MACRO(PL_HashTableLookupConst, Preamble_PLHashTable) \
MACRO(PL_HashTableEnumerateEntries, Preamble_PLHashTable) \
MACRO(PL_HashTableRawAdd, Preamble_PLHashTable) \
MACRO(PL_HashTableRawRemove, Preamble_PLHashTable) \
MACRO(PL_HashTableRawLookup, Preamble_PLHashTable) \
#define FOR_EACH_DIAGNOSTIC_REDIRECTION(MACRO) \
MACRO(PL_HashTableAdd, Preamble_PLHashTable) \
MACRO(PL_HashTableRemove, Preamble_PLHashTable) \
MACRO(PL_HashTableLookup, Preamble_PLHashTable) \
MACRO(PL_HashTableLookupConst, Preamble_PLHashTable) \
MACRO(PL_HashTableEnumerateEntries, Preamble_PLHashTable) \
MACRO(PL_HashTableRawAdd, Preamble_PLHashTable) \
MACRO(PL_HashTableRawRemove, Preamble_PLHashTable) \
MACRO(PL_HashTableRawLookup, Preamble_PLHashTable) \
MACRO(PL_HashTableRawLookupConst, Preamble_PLHashTable)
// Member functions which need a type specification to resolve overloading.
#define FOR_EACH_DIAGNOSTIC_MEMBER_PTR_WITH_TYPE_REDIRECTION(MACRO) \
#define FOR_EACH_DIAGNOSTIC_MEMBER_PTR_WITH_TYPE_REDIRECTION(MACRO) \
MACRO(PLDHashEntryHdr* (PLDHashTable::*)(const void*, const fallible_t&), \
&PLDHashTable::Add, Preamble_PLDHashTable)
// Member functions which are not overloaded.
#define FOR_EACH_DIAGNOSTIC_MEMBER_PTR_REDIRECTION(MACRO) \
MACRO(&PLDHashTable::Clear, Preamble_PLDHashTable) \
MACRO(&PLDHashTable::Remove, Preamble_PLDHashTable) \
#define FOR_EACH_DIAGNOSTIC_MEMBER_PTR_REDIRECTION(MACRO) \
MACRO(&PLDHashTable::Clear, Preamble_PLDHashTable) \
MACRO(&PLDHashTable::Remove, Preamble_PLDHashTable) \
MACRO(&PLDHashTable::RemoveEntry, Preamble_PLDHashTable)
static PreambleResult
Preamble_PLHashTable(CallArguments* aArguments)
{
static PreambleResult Preamble_PLHashTable(CallArguments* aArguments) {
CheckPLHashTable(aArguments->Arg<0, PLHashTable*>());
return PreambleResult::IgnoreRedirect;
}
static PreambleResult
Preamble_PLDHashTable(CallArguments* aArguments)
{
static PreambleResult Preamble_PLDHashTable(CallArguments* aArguments) {
CheckPLDHashTable(aArguments->Arg<0, PLDHashTable*>());
return PreambleResult::IgnoreRedirect;
}
#define MAKE_DIAGNOSTIC_ENTRY_WITH_TYPE(aType, aAddress, aPreamble) \
{ #aAddress, nullptr, nullptr, nullptr, aPreamble },
{#aAddress, nullptr, nullptr, nullptr, aPreamble},
#define MAKE_DIAGNOSTIC_ENTRY(aAddress, aPreamble) \
{ #aAddress, nullptr, nullptr, nullptr, aPreamble },
{#aAddress, nullptr, nullptr, nullptr, aPreamble},
static Redirection gDiagnosticRedirections[] = {
// clang-format off
FOR_EACH_DIAGNOSTIC_REDIRECTION(MAKE_DIAGNOSTIC_ENTRY)
FOR_EACH_DIAGNOSTIC_MEMBER_PTR_WITH_TYPE_REDIRECTION(MAKE_DIAGNOSTIC_ENTRY_WITH_TYPE)
FOR_EACH_DIAGNOSTIC_MEMBER_PTR_REDIRECTION(MAKE_DIAGNOSTIC_ENTRY)
// clang-format on
};
#undef MAKE_DIAGNOSTIC_ENTRY_WITH_TYPE
#undef MAKE_DIAGNOSTIC_ENTRY
@ -2562,7 +2561,8 @@ static Redirection gDiagnosticRedirections[] = {
///////////////////////////////////////////////////////////////////////////////
size_t NumRedirections() {
return ArrayLength(gSystemRedirections) + ArrayLength(gDiagnosticRedirections);
return ArrayLength(gSystemRedirections) +
ArrayLength(gDiagnosticRedirections);
}
static Redirection* gRedirections;
@ -2593,7 +2593,7 @@ static uint8_t* FunctionStartAddress(Redirection& aRedirection) {
template <typename FnPtr>
static uint8_t* ConvertMemberPtrToAddress(FnPtr aPtr) {
// Dig around in clang's internal representation of member function pointers.
uint8_t** contents = (uint8_t**) &aPtr;
uint8_t** contents = (uint8_t**)&aPtr;
return contents[0];
}
@ -2629,18 +2629,21 @@ void EarlyInitializeRedirections() {
size_t diagnosticIndex = 0;
#define LOAD_DIAGNOSTIC_ENTRY(aAddress, aPreamble) \
gDiagnosticRedirections[diagnosticIndex++].mBaseFunction = BitwiseCast<uint8_t*>(aAddress);
#define LOAD_DIAGNOSTIC_ENTRY(aAddress, aPreamble) \
gDiagnosticRedirections[diagnosticIndex++].mBaseFunction = \
BitwiseCast<uint8_t*>(aAddress);
FOR_EACH_DIAGNOSTIC_REDIRECTION(LOAD_DIAGNOSTIC_ENTRY)
#undef LOAD_DIAGNOSTIC_ENTRY
#define LOAD_DIAGNOSTIC_ENTRY(aType, aAddress, aPreamble) \
gDiagnosticRedirections[diagnosticIndex++].mBaseFunction = ConvertMemberPtrToAddress<aType>(aAddress);
#define LOAD_DIAGNOSTIC_ENTRY(aType, aAddress, aPreamble) \
gDiagnosticRedirections[diagnosticIndex++].mBaseFunction = \
ConvertMemberPtrToAddress<aType>(aAddress);
FOR_EACH_DIAGNOSTIC_MEMBER_PTR_WITH_TYPE_REDIRECTION(LOAD_DIAGNOSTIC_ENTRY)
#undef LOAD_DIAGNOSTIC_ENTRY
#define LOAD_DIAGNOSTIC_ENTRY(aAddress, aPreamble) \
gDiagnosticRedirections[diagnosticIndex++].mBaseFunction = ConvertMemberPtrToAddress(aAddress);
#define LOAD_DIAGNOSTIC_ENTRY(aAddress, aPreamble) \
gDiagnosticRedirections[diagnosticIndex++].mBaseFunction = \
ConvertMemberPtrToAddress(aAddress);
FOR_EACH_DIAGNOSTIC_MEMBER_PTR_REDIRECTION(LOAD_DIAGNOSTIC_ENTRY)
#undef LOAD_DIAGNOSTIC_ENTRY

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

@ -211,15 +211,15 @@ static void moz_container_unmap_wayland(MozContainer *container) {
}
static gint moz_container_get_scale(MozContainer *container) {
static auto sGdkWindowGetScaleFactorPtr = (gint(*)(GdkWindow *))dlsym(
RTLD_DEFAULT, "gdk_window_get_scale_factor");
static auto sGdkWindowGetScaleFactorPtr =
(gint(*)(GdkWindow *))dlsym(RTLD_DEFAULT, "gdk_window_get_scale_factor");
if (sGdkWindowGetScaleFactorPtr) {
GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container));
return (*sGdkWindowGetScaleFactorPtr)(window);
}
if (sGdkWindowGetScaleFactorPtr) {
GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container));
return (*sGdkWindowGetScaleFactorPtr)(window);
}
return 1;
return 1;
}
#endif
@ -352,8 +352,7 @@ void moz_container_size_allocate(GtkWidget *widget, GtkAllocation *allocation) {
}
if (container->eglwindow) {
gint scale = moz_container_get_scale(container);
wl_egl_window_resize(container->eglwindow,
allocation->width * scale,
wl_egl_window_resize(container->eglwindow, allocation->width * scale,
allocation->height * scale, 0, 0);
}
#endif
@ -506,9 +505,9 @@ struct wl_egl_window *moz_container_get_wl_egl_window(MozContainer *container) {
GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container));
gint scale = moz_container_get_scale(container);
container->eglwindow = wl_egl_window_create(
surface, gdk_window_get_width(window) * scale,
gdk_window_get_height(window) * scale);
container->eglwindow =
wl_egl_window_create(surface, gdk_window_get_width(window) * scale,
gdk_window_get_height(window) * scale);
}
return container->eglwindow;
}

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

@ -436,10 +436,7 @@ class PLDHashTable {
}
// Provide access to the raw ops to internal record/replay structures.
const PLDHashTableOps* RecordReplayWrappedOps() const
{
return mOps;
}
const PLDHashTableOps* RecordReplayWrappedOps() const { return mOps; }
// Size in entries (gross, not net of free and removed sentinels) for table.
// This can be zero if no elements have been added yet, in which case the