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

Issue 393953009: Moving the work currently done in the QuicSession constructor to (Closed)

Created:
6 years, 5 months ago by ramant (doing other things)
Modified:
6 years, 5 months ago
Reviewers:
Ryan Hamilton
CC:
chromium-reviews, cbentzel+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Moving the work currently done in the QuicSession constructor to Initialize(). This is worthwhile because currently it's possible for virtual functions to be called from under the stack of the QuicSession constructor, which is confusing and annoying to debug. Example: if a bad config (without SetDefaults called) is passed to the quic server session, it calls SetFromConfig which calls SetIdleNetworkTimeout which calls CheckForTimeout which can technically call SendConnectionClose which calls CloseConnection which calls visitor->OnConnectionClosed() on the session, which still doesn't have a good vtable. As it turns out, this puts the internal server in an inconsistent state which causes all sorts of other annoying to debug things. This can be solved by never giving an invalid config (heh) or, say, not doing a ton of complicated work in a constructor in the first place. This hopefully will also make some unit testing earlier as you don't have to do quite as much work in test classes. Moving work from the QuicSession constructor to InitializeSession() Merge internal change: 70661792 R=rch@chromium.org

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -69 lines) Patch
M net/quic/quic_client_session.h View 2 chunks +6 lines, -4 lines 0 comments Download
M net/quic/quic_client_session.cc View 5 chunks +20 lines, -17 lines 2 comments Download
M net/quic/quic_client_session_test.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M net/quic/quic_http_stream_test.cc View 1 chunk +5 lines, -4 lines 0 comments Download
M net/quic/quic_server_session.cc View 1 chunk +1 line, -0 lines 0 comments Download
M net/quic/quic_session.h View 1 chunk +1 line, -0 lines 0 comments Download
M net/quic/quic_session.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M net/quic/quic_session_test.cc View 1 chunk +3 lines, -1 line 0 comments Download
M net/quic/quic_stream_factory.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M net/quic/test_tools/crypto_test_utils.cc View 1 chunk +2 lines, -1 line 0 comments Download
M net/quic/test_tools/quic_test_utils.cc View 3 chunks +7 lines, -4 lines 0 comments Download
M net/tools/quic/quic_client.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M net/tools/quic/quic_client_session.h View 3 chunks +5 lines, -5 lines 0 comments Download
M net/tools/quic/quic_client_session.cc View 3 chunks +16 lines, -11 lines 0 comments Download
M net/tools/quic/quic_client_session_test.cc View 1 chunk +3 lines, -4 lines 0 comments Download
M net/tools/quic/quic_server_session.cc View 1 chunk +1 line, -0 lines 0 comments Download
M net/tools/quic/quic_spdy_client_stream_test.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M net/tools/quic/test_tools/quic_test_utils.cc View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ramant (doing other things)
6 years, 5 months ago (2014-07-16 03:19:39 UTC) #1
ramant (doing other things)
https://codereview.chromium.org/393953009/diff/1/net/quic/quic_client_session.cc File net/quic/quic_client_session.cc (right): https://codereview.chromium.org/393953009/diff/1/net/quic/quic_client_session.cc#newcode165 net/quic/quic_client_session.cc:165: QuicClientSessionBase::InitializeSession(); Hi Ryan, Tried to keep this class similar ...
6 years, 5 months ago (2014-07-16 03:22:57 UTC) #2
Ryan Hamilton
6 years, 5 months ago (2014-07-16 15:53:32 UTC) #3
lgtm

https://codereview.chromium.org/393953009/diff/1/net/quic/quic_client_session.cc
File net/quic/quic_client_session.cc (right):

https://codereview.chromium.org/393953009/diff/1/net/quic/quic_client_session...
net/quic/quic_client_session.cc:165: QuicClientSessionBase::InitializeSession();
On 2014/07/16 03:22:57, ramant wrote:
> Hi Ryan,
>   Tried to keep this class similar to server's QuicClientSession. Would
> appreciate your opinion of this change. Is there a better way to organize this
> code? thanks much.

Seems reasonable to me!

Powered by Google App Engine
This is Rietveld 408576698