Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/http/http_pipelined_stream.h" | 5 #include "net/http/http_pipelined_stream.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/http/http_pipelined_connection_impl.h" | 10 #include "net/http/http_pipelined_connection_impl.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 int HttpPipelinedStream::ReadResponseBody(IOBuffer* buf, int buf_len, | 64 int HttpPipelinedStream::ReadResponseBody(IOBuffer* buf, int buf_len, |
| 65 OldCompletionCallback* callback) { | 65 OldCompletionCallback* callback) { |
| 66 return pipeline_->ReadResponseBody(pipeline_id_, buf, buf_len, callback); | 66 return pipeline_->ReadResponseBody(pipeline_id_, buf, buf_len, callback); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void HttpPipelinedStream::Close(bool not_reusable) { | 69 void HttpPipelinedStream::Close(bool not_reusable) { |
| 70 pipeline_->Close(pipeline_id_, not_reusable); | 70 pipeline_->Close(pipeline_id_, not_reusable); |
| 71 } | 71 } |
| 72 | 72 |
| 73 HttpStream* HttpPipelinedStream::RenewStreamForAuth() { | 73 HttpStream* HttpPipelinedStream::RenewStreamForAuth() { |
| 74 // FIXME: What does this mean on a pipeline? Is it for proxies? | 74 if (pipeline_->usable()) { |
| 75 return new HttpPipelinedStream(pipeline_, pipeline_id_); | 75 return pipeline_->CreateNewStream(); |
| 76 } else { | |
|
mmenke
2011/11/01 14:21:55
nit: It's chrome style not to use else statements
| |
| 77 return NULL; | |
| 78 } | |
| 76 } | 79 } |
| 77 | 80 |
| 78 bool HttpPipelinedStream::IsResponseBodyComplete() const { | 81 bool HttpPipelinedStream::IsResponseBodyComplete() const { |
| 79 return pipeline_->IsResponseBodyComplete(pipeline_id_); | 82 return pipeline_->IsResponseBodyComplete(pipeline_id_); |
| 80 } | 83 } |
| 81 | 84 |
| 82 bool HttpPipelinedStream::CanFindEndOfResponse() const { | 85 bool HttpPipelinedStream::CanFindEndOfResponse() const { |
| 83 return pipeline_->CanFindEndOfResponse(pipeline_id_); | 86 return pipeline_->CanFindEndOfResponse(pipeline_id_); |
| 84 } | 87 } |
| 85 | 88 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 | 136 |
| 134 const NetLog::Source& HttpPipelinedStream::source() const { | 137 const NetLog::Source& HttpPipelinedStream::source() const { |
| 135 return pipeline_->source(); | 138 return pipeline_->source(); |
| 136 } | 139 } |
| 137 | 140 |
| 138 bool HttpPipelinedStream::was_npn_negotiated() const { | 141 bool HttpPipelinedStream::was_npn_negotiated() const { |
| 139 return pipeline_->was_npn_negotiated(); | 142 return pipeline_->was_npn_negotiated(); |
| 140 } | 143 } |
| 141 | 144 |
| 142 } // namespace net | 145 } // namespace net |
| OLD | NEW |