Bug 894191 - Run ContentParent::ShutDownProcesss() after ContentParent::KillHard(). r=jlebar

--HG--
extra : rebase_source : 2cd9c02feab01b9506d74f721f24068fb653879d
Bug 893242 - Part 0: Don't crash if we call ContentParent::Pid() after the process is dead. r=bent
Bug 893242 - Part 1: Add Unsound_IsClosed() and Unsound_NumQueuedMessages() to AsyncChannel. r=bent
Bug 893242 - Part 2: Make sContentParents a StaticAutoPtr. r=khuey

This eliminates a static constructor, which is good.  It also avoids a
problem at shutdown: If we leak a ContentParent and we destroy
sContentParents atexit, then sContentParents will assert that it's not
empty and cause test failures.
Bug 893242 - Part 3: Add ContentParent::GetAllEvenIfDead(). r=bent

To do this, we got rid of the explicit removal of a ContentParent from
sContentParents in MarkAsDead().  Instead, we rely on
LinkedListElement's destructor to remove the ContentParent from
sContentParents.

Thus, a ContentParent stays in sContentParents until it's destructed.
ContentParent::GetAll() checks whether the ContentParent is still alive,
so its behavior is unchanged.
Bug 893242 - Part 4: Add a memory reporter counting ContentParents and the number of IPC messages they have outstanding. r=njn
Bug 894147 - Don't leak BrowserElementParent due to an event listener on the window which contains it. r=khuey
Bug 895123 - Change nsFrameLoader::mChildHost from nsCOMPtr<nsIObserver> to nsRefPtr<ContentParent>, and rename it to mContentParent. r=jdm

This doesn't change any behavior; the only effect of this change is to make it easier to figure out, from GDB, which ContentParent a nsFrameLoader points to.
Bug 894597 - TaskThrottler::TaskComplete shouldn't call nsTArray::RemoveElementAt(0) on an empty array. r=kentuckyfriedtakahe
Bug 895204 - Let ContentParent call CloseWithError() even if it's already called Close().

When Close() fails with an error, we should end up back in ContentParent and we eventually need to call CloseWithError().