Bug 1149971 Part 2: Cet rid of kCurrentProcessId as it makes lots of static initializers. r=dvander

This commit is contained in:
Bob Owen 2015-04-01 13:59:20 +01:00
Родитель 967713e4e9
Коммит 283c8df550
11 изменённых файлов: 12 добавлений и 13 удалений

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

@ -615,7 +615,7 @@ bool ImageBridgeChild::StartUpOnThread(Thread* aThread)
}
sImageBridgeChildSingleton = new ImageBridgeChild();
sImageBridgeParentSingleton = new ImageBridgeParent(
CompositorParent::CompositorLoop(), nullptr, ipc::kCurrentProcessId);
CompositorParent::CompositorLoop(), nullptr, base::GetCurrentProcId());
sImageBridgeChildSingleton->ConnectAsync(sImageBridgeParentSingleton);
return true;
} else {
@ -943,7 +943,7 @@ void ImageBridgeChild::RemoveTexture(TextureClient* aTexture)
bool ImageBridgeChild::IsSameProcess() const
{
return OtherPid() == ipc::kCurrentProcessId;
return OtherPid() == base::GetCurrentProcId();
}
void ImageBridgeChild::SendPendingAsyncMessges()

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

@ -340,7 +340,7 @@ ImageBridgeParent::CloneToplevel(const InfallibleTArray<ProtocolFdMapping>& aFds
bool ImageBridgeParent::IsSameProcess() const
{
return OtherPid() == ipc::kCurrentProcessId;
return OtherPid() == base::GetCurrentProcId();
}
void

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

@ -976,7 +976,7 @@ LayerTransactionParent::ActorDestroy(ActorDestroyReason why)
bool LayerTransactionParent::IsSameProcess() const
{
return OtherPid() == ipc::kCurrentProcessId;
return OtherPid() == base::GetCurrentProcId();
}
void

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

@ -738,7 +738,7 @@ ShadowLayerForwarder::IsSameProcess() const
if (!HasShadowManager() || !mShadowManager->IPCOpen()) {
return false;
}
return mShadowManager->OtherPid() == kCurrentProcessId;
return mShadowManager->OtherPid() == base::GetCurrentProcId();
}
/**

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

@ -1957,7 +1957,7 @@ ChildImpl::OpenMainProcessActorRunnable::Run()
}
// Make sure the parent knows it is same process.
parentActor->SetOtherProcessId(kCurrentProcessId);
parentActor->SetOtherProcessId(base::GetCurrentProcId());
// Now that Open() has succeeded transfer the ownership of the actors to IPDL.
unused << parentActor.forget();

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

@ -265,7 +265,7 @@ bool DuplicateHandle(HANDLE aSourceHandle,
DWORD aDesiredAccess,
DWORD aOptions) {
// If our process is the target just duplicate the handle.
if (aTargetProcessId == kCurrentProcessId) {
if (aTargetProcessId == base::GetCurrentProcId()) {
return !!::DuplicateHandle(::GetCurrentProcess(), aSourceHandle,
::GetCurrentProcess(), aTargetHandle,
aDesiredAccess, false, aOptions);
@ -318,7 +318,7 @@ FatalError(const char* aProtocolName, const char* aMsg,
formattedMessage.AppendLiteral("\". Killing child side as a result.");
NS_ERROR(formattedMessage.get());
if (aOtherPid != kInvalidProcessId && aOtherPid != kCurrentProcessId) {
if (aOtherPid != kInvalidProcessId && aOtherPid != base::GetCurrentProcId()) {
ScopedProcessHandle otherProcessHandle;
if (base::OpenProcessHandle(aOtherPid, &otherProcessHandle.rwget())) {
if (!base::KillProcess(otherProcessHandle,

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

@ -72,7 +72,6 @@ const base::ProcessId kInvalidProcessId = kuint32max;
const base::ProcessHandle kInvalidProcessHandle = -1;
const base::ProcessId kInvalidProcessId = -1;
#endif
const base::ProcessId kCurrentProcessId = base::GetCurrentProcId();
// Scoped base::ProcessHandle to ensure base::CloseProcessHandle is called.
struct ScopedProcessHandleTraits

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

@ -3005,7 +3005,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
ret=Type.BOOL))
openmeth.addstmts([
StmtExpr(ExprAssn(p.otherPidVar(), ExprVar('ipc::kCurrentProcessId'))),
StmtExpr(ExprAssn(p.otherPidVar(), ExprCall(ExprVar('base::GetCurrentProcId')))),
StmtReturn(ExprCall(ExprSelect(p.channelVar(), '.', 'Open'),
[ aChannel, aMessageLoop, sidevar ]))
])

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

@ -494,7 +494,7 @@ TestDataStructuresChild::RecvStart()
Test15();
Test16();
Test17();
if (OtherPid() != ipc::kCurrentProcessId) {
if (OtherPid() != base::GetCurrentProcId()) {
//FIXME/bug 703317 allocation of nsIntRegion uses a global
//region pool which breaks threads
Test18();

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

@ -110,7 +110,7 @@ TestFailedCtorChild::DeallocPTestFailedCtorSubChild(PTestFailedCtorSubChild* act
void
TestFailedCtorChild::ProcessingError(Result aCode, const char* aReason)
{
if (OtherPid() != ipc::kCurrentProcessId) // thread-mode
if (OtherPid() != base::GetCurrentProcId()) // thread-mode
_exit(0);
}

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

@ -1130,7 +1130,7 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
mCompositorChild->OpenSameProcess(mCompositorParent);
// Make sure the parent knows it is same process.
mCompositorParent->SetOtherProcessId(kCurrentProcessId);
mCompositorParent->SetOtherProcessId(base::GetCurrentProcId());
if (gfxPrefs::AsyncPanZoomEnabled() &&
(WindowType() == eWindowType_toplevel || WindowType() == eWindowType_child)) {