Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Issue 2642133002: Change WeakPtr<SpdyStream> to raw pointer in SpdyHttpStream. (Closed)

Created:
3 years, 11 months ago by Bence
Modified:
3 years, 11 months ago
Reviewers:
xunjieli
CC:
chromium-reviews, cbentzel+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change WeakPtr<SpdyStream> to raw pointer in SpdyHttpStream. This allows for more explicit expression of lifetime expectations. SpdyStream instances are created in SpdySession::CreateStream() and in SpdySession::TryCreatePushStream(), and are owned by SpdySession in its |created_streams_| and |active_streams_| members. They are destroyed in SpdySession::CloseActiveStreamIterator() and in SpdySession::CloseCreatedStreamIterator(), and SpdySession::DeleteStream() is always called by these methods. This always calls SpdyStream::OnClose() before deleting the stream, which in turn calls SpdyStream::Delegate::OnClose(). Every time SpdyHttpStream grabs a handle of a SpdyStream, it immediately registers itself as a delegate. That means that every time a SpdyStream instance is destroyed, if a SpdyHttpStream instance has a handle of it, it will get notified. That is, SpdyHttpStream does not actually need to keep a WeakPtr<SpdyStream>: a raw pointer suffices. Review-Url: https://codereview.chromium.org/2642133002 Cr-Commit-Position: refs/heads/master@{#445302} Committed: https://chromium.googlesource.com/chromium/src/+/4e6e774857ae99aa9dc13287e0c36c1e69bf92b6

Patch Set 1 #

Total comments: 5

Patch Set 2 : Nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -34 lines) Patch
M net/spdy/spdy_http_stream.h View 1 2 chunks +9 lines, -2 lines 0 comments Download
M net/spdy/spdy_http_stream.cc View 14 chunks +16 lines, -15 lines 0 comments Download
M net/spdy/spdy_session.h View 2 chunks +2 lines, -2 lines 0 comments Download
M net/spdy/spdy_session.cc View 1 3 chunks +8 lines, -8 lines 0 comments Download
M net/spdy/spdy_session_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/spdy/spdy_stream.h View 2 chunks +3 lines, -2 lines 0 comments Download
M net/spdy/spdy_stream_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 19 (10 generated)
Bence
xunjieli: PTAL. Thank you.
3 years, 11 months ago (2017-01-19 17:33:36 UTC) #6
xunjieli
https://codereview.chromium.org/2642133002/diff/1/net/spdy/spdy_http_stream.h File net/spdy/spdy_http_stream.h (right): https://codereview.chromium.org/2642133002/diff/1/net/spdy/spdy_http_stream.h#newcode131 net/spdy/spdy_http_stream.h:131: SpdyStream* stream_; Can you add a comment here on ...
3 years, 11 months ago (2017-01-20 02:57:20 UTC) #7
Bence
Thanks. PTAL. https://codereview.chromium.org/2642133002/diff/1/net/spdy/spdy_http_stream.h File net/spdy/spdy_http_stream.h (right): https://codereview.chromium.org/2642133002/diff/1/net/spdy/spdy_http_stream.h#newcode131 net/spdy/spdy_http_stream.h:131: SpdyStream* stream_; On 2017/01/20 02:57:20, xunjieli wrote: ...
3 years, 11 months ago (2017-01-20 15:53:13 UTC) #8
xunjieli
lgtm! https://codereview.chromium.org/2642133002/diff/1/net/spdy/spdy_session.cc File net/spdy/spdy_session.cc (right): https://codereview.chromium.org/2642133002/diff/1/net/spdy/spdy_session.cc#newcode841 net/spdy/spdy_session.cc:841: if (availability_state_ == STATE_DRAINING) On 2017/01/20 15:53:13, Bence ...
3 years, 11 months ago (2017-01-20 15:57:23 UTC) #9
Bence
Thanks. Now I plan to wait for branch point before landing this in case something ...
3 years, 11 months ago (2017-01-20 15:59:40 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2642133002/20001
3 years, 11 months ago (2017-01-21 10:55:12 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/375584)
3 years, 11 months ago (2017-01-21 12:47:30 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2642133002/20001
3 years, 11 months ago (2017-01-22 11:46:56 UTC) #16
commit-bot: I haz the power
3 years, 11 months ago (2017-01-22 13:00:25 UTC) #19
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/4e6e774857ae99aa9dc13287e0c3...

Powered by Google App Engine
This is Rietveld 408576698