Bug 1215508: Fix the race in accessing the unopened IPC channels in TabChild::PreloadSlowThings(). r=khuey

This commit is contained in:
Cervantes Yu 2015-10-19 14:27:01 +08:00
parent 578ca2a77a
commit eabbe039ec
2 changed files with 4 additions and 10 deletions

View File

@ -510,16 +510,8 @@ private:
content->GetIPCChannel()->Unblock();
}
nsTArray<IToplevelProtocol*> actors;
content->GetOpenedActors(actors);
for (size_t j = 0; j < actors.Length(); j++) {
IToplevelProtocol* actor = actors[j];
if (aBlock) {
actor->GetIPCChannel()->Block();
} else {
actor->GetIPCChannel()->Unblock();
}
}
// Other IPC channels do not perform the checks through Block() and
// Unblock().
}
};
#endif

View File

@ -177,10 +177,12 @@ class MessageChannel : HasResultCodes
#ifdef MOZ_NUWA_PROCESS
void Block() {
MOZ_ASSERT(mLink);
mLink->Block();
}
void Unblock() {
MOZ_ASSERT(mLink);
mLink->Unblock();
}
#endif