Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/spdy/spdy_http_stream.h" | 5 #include "net/spdy/spdy_http_stream.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 stream_(NULL), | 26 stream_(NULL), |
| 27 spdy_session_(spdy_session), | 27 spdy_session_(spdy_session), |
| 28 response_info_(NULL), | 28 response_info_(NULL), |
| 29 download_finished_(false), | 29 download_finished_(false), |
| 30 user_callback_(NULL), | 30 user_callback_(NULL), |
| 31 user_buffer_len_(0), | 31 user_buffer_len_(0), |
| 32 buffered_read_callback_pending_(false), | 32 buffered_read_callback_pending_(false), |
| 33 more_read_data_pending_(false), | 33 more_read_data_pending_(false), |
| 34 direct_(direct) { } | 34 direct_(direct) { } |
| 35 | 35 |
| 36 SpdyHttpStream::SpdyHttpStream(SpdyStream* spdy_stream) | |
| 37 : ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_factory_(this)), | |
| 38 stream_(spdy_stream), | |
| 39 spdy_session_(NULL), | |
| 40 response_info_(NULL), | |
| 41 download_finished_(false), | |
| 42 user_callback_(NULL), | |
| 43 user_buffer_len_(0), | |
| 44 buffered_read_callback_pending_(false), | |
|
vandebo (ex-Chrome)
2010/12/04 00:30:37
Should some of these settings come from the passed
Ryan Hamilton
2010/12/09 21:19:35
I don't *think* any of the fields need to come fro
| |
| 45 more_read_data_pending_(false), | |
| 46 direct_(false) { | |
| 47 stream_->SetDelegate(this); | |
| 48 } | |
| 49 | |
| 36 SpdyHttpStream::~SpdyHttpStream() { | 50 SpdyHttpStream::~SpdyHttpStream() { |
| 37 if (stream_) | 51 if (stream_) |
| 38 stream_->DetachDelegate(); | 52 stream_->DetachDelegate(); |
| 39 } | 53 } |
| 40 | 54 |
| 41 int SpdyHttpStream::InitializeStream(const HttpRequestInfo* request_info, | 55 int SpdyHttpStream::InitializeStream(const HttpRequestInfo* request_info, |
| 42 const BoundNetLog& stream_net_log, | 56 const BoundNetLog& stream_net_log, |
| 43 CompletionCallback* callback) { | 57 CompletionCallback* callback) { |
| 58 DCHECK(!stream_.get()); | |
| 44 if (spdy_session_->IsClosed()) | 59 if (spdy_session_->IsClosed()) |
| 45 return ERR_CONNECTION_CLOSED; | 60 return ERR_CONNECTION_CLOSED; |
| 46 | 61 |
| 47 request_info_ = request_info; | 62 request_info_ = request_info; |
| 48 if (request_info_->method == "GET") { | 63 if (request_info_->method == "GET") { |
| 49 int error = spdy_session_->GetPushStream(request_info_->url, &stream_, | 64 int error = spdy_session_->GetPushStream(request_info_->url, &stream_, |
| 50 stream_net_log); | 65 stream_net_log); |
| 51 if (error != OK) | 66 if (error != OK) |
| 52 return error; | 67 return error; |
| 53 } | 68 } |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 stream_->GetSSLInfo(ssl_info, &using_npn); | 392 stream_->GetSSLInfo(ssl_info, &using_npn); |
| 378 } | 393 } |
| 379 | 394 |
| 380 void SpdyHttpStream::GetSSLCertRequestInfo( | 395 void SpdyHttpStream::GetSSLCertRequestInfo( |
| 381 SSLCertRequestInfo* cert_request_info) { | 396 SSLCertRequestInfo* cert_request_info) { |
| 382 DCHECK(stream_); | 397 DCHECK(stream_); |
| 383 stream_->GetSSLCertRequestInfo(cert_request_info); | 398 stream_->GetSSLCertRequestInfo(cert_request_info); |
| 384 } | 399 } |
| 385 | 400 |
| 386 } // namespace net | 401 } // namespace net |
| OLD | NEW |