Commit a6f2e8fb authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Fix incorrect DCHECK in SpdySessionPool's destructor.

The destructor was checking that |spdy_session_request_map_| is empty.
This used to be true, as |spdy_session_request_map_| used to just
contain SpdySessionRequests, which are cancelled on request destruction.
However, it now also contains callbacks used to delay redundant H2
connection requests, which have no cancellation semantecs, so there
may be pending callbacks when the SpdySessionPool is destroyed.

This CL fixes the DCHECK by just checking that there are no pending
SpdySessionRequests.


Bug: 966991
Change-Id: I5f8e36d62850ffab83db38742250fae8b6eefff1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635437
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664518}
parent 63fc525c
...@@ -112,7 +112,15 @@ SpdySessionPool::SpdySessionPool( ...@@ -112,7 +112,15 @@ SpdySessionPool::SpdySessionPool(
} }
SpdySessionPool::~SpdySessionPool() { SpdySessionPool::~SpdySessionPool() {
DCHECK(spdy_session_request_map_.empty()); #if DCHECK_IS_ON()
for (const auto& request_info : spdy_session_request_map_) {
// The should be no pending SpdySessionRequests on destruction, though there
// may be callbacks waiting to be invoked, since they use weak pointers and
// there's no API to unregister them.
DCHECK(request_info.second.request_set.empty());
}
#endif // DCHECK_IS_ON()
// TODO(bnc): CloseAllSessions() is also called in HttpNetworkSession // TODO(bnc): CloseAllSessions() is also called in HttpNetworkSession
// destructor, one of the two calls should be removed. // destructor, one of the two calls should be removed.
CloseAllSessions(); CloseAllSessions();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment