Make sure to remove unclaimed pushed streams from Http2PushPromiseIndex.

UnclaimedPushedStreamContainer has two erase() methods: one by key,
the other by iterator.  Call the latter from the former to make sure
entries are removed from Http2PushPromiseIndex.

Do not add pushed streams to Http2PushPromiseIndex if they are not added
to SpdySession's local unclaimed_pushed_stream_contrainer_ because there
is already a pushed stream on the same SpdySession for the same URL.

Add DCHECK in Http2PushPromiseIndex destructor to test that container is
empty.  This is expected, as Http2PushPromiseIndex is owned by
SpdySessionPool, which destroys all SpdySessions in its destructor
(before its members are destroyed).

https://crrev.com/c/744506 was incorrect and I reverted it.  This CL
re-lands that change but this time with some added paranoia and the
necessary fixes to make sure there are no invalid weak pointers in
Http2PushPromiseIndex.

Bug: 554220
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I6e902f41686c6f43eda4ecc90c9979677a5b3f27
Reviewed-on: https://chromium-review.googlesource.com/749902
Reviewed-by: Helen Li <xunjieli@chromium.org>
Commit-Queue: Bence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513766}
3 files changed