Dangling pointer bug fix for RTCQuicStream.

If a finish is read out by JavaScript and then write() is called with
finish set to true, the underlying stream objects are destroyed
(proxy & host). This is fine, but in the case when the finish is written
with a large amount of data, it might be buffered by the QUIC library.
In this case the QuicStreamHost object is destroyed, while the
P2PQuicStream stays alive writing the data to the remote endpoint. This
violates the lifetime requirements of the P2PQuicStream's Delegate
object (P2PQuicStreamHost), and fires Delegate::OnWriteDataConsumed to a
dangling pointer.

Bug: 927098
Change-Id: I211ff7c0514c2f58f60066a64b6c5051e11ce9ac
Reviewed-on: https://chromium-review.googlesource.com/c/1447023
Commit-Queue: Seth Hampson <shampson@chromium.org>
Reviewed-by: Steve Anton <steveanton@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#627781}(cherry picked from commit 3eacc778ece91687df08454c508180eae8232d17)
Reviewed-on: https://chromium-review.googlesource.com/c/1449324
Reviewed-by: Seth Hampson <shampson@chromium.org>
Cr-Commit-Position: refs/branch-heads/3683@{#104}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
7 files changed