Bug 931456 - Initialize the chrome process pid information while we are constructing OpenFileFinder. r=dhylands

This commit is contained in:
Alan Huang 2013-12-04 10:24:36 +08:00
parent 3dafe8688a
commit 888891e62b

View File

@ -19,9 +19,10 @@ OpenFileFinder::OpenFileFinder(const nsACString& aPath,
mProcDir(nullptr),
mFdDir(nullptr),
mPid(0),
mMyPid(-1),
mCheckIsB2gOrDescendant(aCheckIsB2gOrDescendant)
{
// We assume that we're running in the parent process
mMyPid = getpid();
}
OpenFileFinder::~OpenFileFinder()
@ -162,10 +163,6 @@ OpenFileFinder::FillInfo(OpenFileFinder::Info* aInfo, const nsACString& aPath)
// ) X ppid
// 01234
int ppid = atoi(&closeParen[4]);
// We assume that we're running in the parent process
if (mMyPid == -1) {
mMyPid = getpid();
}
if (mPid == mMyPid) {
// This is chrome process