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

Issue 3064033: Refactor HttpNetworkTransaction to eliminate the SPDY... (Closed)

Created:
10 years, 4 months ago by Ryan Hamilton
Modified:
9 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Refactor HttpNetworkTransaction to eliminate the SPDY specific states of the state machine. This required adding two new states: STATE_INIT_STREAM STATE_INTI_STREAM_COMPLETE The http_stream_ and spdy_http_stream_ member fields have been removed, and replaced by a single stream_ member field which is initialized with either an HttpBasicStream, or SpdyHttpStream depending on the underlying connection. In the process, the NetLog no longer receives TYPE_SPDY events, only TYPE_HTTP, so spdy_network_transaction_unittest.cc needed to be modified accordingly. BUG=50267 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=54906

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 34

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -237 lines) Patch
M net/http/http_network_transaction.h View 1 2 6 chunks +7 lines, -19 lines 0 comments Download
M net/http/http_network_transaction.cc View 1 2 3 25 chunks +120 lines, -212 lines 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 1 2 chunks +7 lines, -6 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Ryan Hamilton
10 years, 4 months ago (2010-08-03 18:36:55 UTC) #1
Mike Belshe
Overall - looks great - just that one question http://codereview.chromium.org/3064033/diff/1/2 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/3064033/diff/1/2#newcode1176 net/http/http_network_transaction.cc:1176: ...
10 years, 4 months ago (2010-08-03 20:37:02 UTC) #2
vandebo (ex-Chrome)
http://codereview.chromium.org/3064033/diff/6001/7001 File net/http/http_network_transaction.cc (left): http://codereview.chromium.org/3064033/diff/6001/7001#oldcode1313 net/http/http_network_transaction.cc:1313: int HttpNetworkTransaction::DoSpdyGetStream() { Oh, I see, you just moved ...
10 years, 4 months ago (2010-08-03 21:41:06 UTC) #3
rch (use chromium not google)
http://codereview.chromium.org/3064033/diff/1/2 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/3064033/diff/1/2#newcode1176 net/http/http_network_transaction.cc:1176: } On 2010/08/03 20:37:02, Mike Belshe wrote: > This ...
10 years, 4 months ago (2010-08-03 21:45:10 UTC) #4
rch (use chromium not google)
http://codereview.chromium.org/3064033/diff/6001/7001 File net/http/http_network_transaction.cc (left): http://codereview.chromium.org/3064033/diff/6001/7001#oldcode1313 net/http/http_network_transaction.cc:1313: int HttpNetworkTransaction::DoSpdyGetStream() { On 2010/08/03 21:41:06, vandebo wrote: > ...
10 years, 4 months ago (2010-08-03 22:17:12 UTC) #5
vandebo (ex-Chrome)
Try result? LGTM otherwise. http://codereview.chromium.org/3064033/diff/6001/7001 File net/http/http_network_transaction.cc (right): http://codereview.chromium.org/3064033/diff/6001/7001#newcode506 net/http/http_network_transaction.cc:506: static_cast<SpdyHttpStream*>(stream_.get())->Cancel(); On 2010/08/03 22:17:12, Ryan ...
10 years, 4 months ago (2010-08-04 00:45:42 UTC) #6
Ryan Hamilton
10 years, 4 months ago (2010-08-04 15:47:23 UTC) #7
On 2010/08/04 00:45:42, vandebo wrote:
> Try result?  LGTM otherwise.
> 
> http://codereview.chromium.org/3064033/diff/6001/7001
> File net/http/http_network_transaction.cc (right):
> 
> http://codereview.chromium.org/3064033/diff/6001/7001#newcode506
> net/http/http_network_transaction.cc:506:
> static_cast<SpdyHttpStream*>(stream_.get())->Cancel();
> On 2010/08/03 22:17:12, Ryan Hamilton wrote:
> > On 2010/08/03 21:41:06, vandebo wrote:
> > > Maybe Cancel should be added to the HttpStream interface?  For standard
> Http,
> > > you could have it disconnect the socket.
> > 
> > Agreed.  HttpNetworkTransaction is currently a bit schizophrenic about the
> > relationship between a HTTP stream and the connection.  Some times the code
> trys
> > to work with the stream, and other times with the connection.  Yuck!  I'm
> > hopeful that Mike's StreamFactory will help by hiding the connection from
> > HttpNetworkTransaction :>
> > 
> > I like the idea of adding Connect to HttpStream.  Are you thinking that
> > HttpBasicStream::Cancel() would basically implement the earlier block? 
> Namely:
> 
> Yea, I think the thing to keep in mind is that the stream factory is the way
of
> the future, at which point there won't be much use for the connection.  So
> hiding all current accesses to connection in appropriate interfaces to
> HttpStream is the preferred change.

Sounds great.  I'll start a second CL to do just that!

> If this is the only need for a Close type call, then maybe implicitly in the
> HttpStream destructor is appropriate, I haven't looked.
> 
> http://codereview.chromium.org/3064033/diff/6001/7001#newcode1156
> net/http/http_network_transaction.cc:1156: if (using_spdy_) {
> On 2010/08/03 22:17:12, Ryan Hamilton wrote:
> > On 2010/08/03 21:41:06, vandebo wrote:
> > > This is fine, but you might be able to integrate it better.  Mike might
want
> > > some of the error handling that is currently only done for Http results...
> > 
> > Yeah, mike commented on this one as well.  I'm on the same page, but I'm
> tempted
> > to leave it for now, and rework in a subsequent step?
> 
> I mentally did this when writing the suggestion, I think it's no too bad.  If
> you spend more than 10 min trying to do it (integrate, but no change in
> behavior), forget it.

I must be screwing up something simple.  I get a crash from
HttpNetworkTransactionTest.UseAlternateProtocolForNpnSpdy, when
HttpNetworkTransaction attempts to get the SSL socket from the connection.  (I
believe this is because in the SPDY case, connection_ is not set).  As part of
the "hide connection_ in stream_"  CL, I'm sure I'll be able to get this
working.

> http://codereview.chromium.org/3064033/diff/6001/7001#newcode1273
> net/http/http_network_transaction.cc:1273: if (!using_spdy_)
> On 2010/08/03 22:17:12, Ryan Hamilton wrote:
> > On 2010/08/03 21:41:06, vandebo wrote:
> > > Maybe HttpStream should also have an is_initialized() method?
> > 
> > Sounds reasonable.  Should it return true iff InitializeStream() was
> successful,
> > or do we want something at the connection level?  (Should we do this in a
> second
> > CL?)
> 
> I think this should be implementation specific.  For the HttpBasicStream case,
> it probably needs to check the connection as well as verify that InitStream
has
> been called.  Follow up CL makes sense here.

Sounds good.

> http://codereview.chromium.org/3064033/diff/6001/7001#newcode1299
> net/http/http_network_transaction.cc:1299: if (!keep_alive)
> On 2010/08/03 22:17:12, Ryan Hamilton wrote:
> > On 2010/08/03 21:41:06, vandebo wrote:
> > > can put the spdy code down here.
> > Done.
> 
> I was actually suggesting in here... calculating done and keep_alive for spdy
> won't hurt anything.

Oh, hah!  I wondered why you wanted me to reverse the order of statements in an
if() block :>  You know, I think the SPDY case (of resetting stream_) might not
even be needed.  I'll see if I can remove it altogether...

Powered by Google App Engine
This is Rietveld 408576698