OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_stream_parser.h" | 5 #include "net/http/http_stream_parser.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 GrowableIOBuffer* read_buffer, | 173 GrowableIOBuffer* read_buffer, |
174 const BoundNetLog& net_log) | 174 const BoundNetLog& net_log) |
175 : io_state_(STATE_NONE), | 175 : io_state_(STATE_NONE), |
176 request_(request), | 176 request_(request), |
177 request_headers_(NULL), | 177 request_headers_(NULL), |
178 read_buf_(read_buffer), | 178 read_buf_(read_buffer), |
179 read_buf_unused_offset_(0), | 179 read_buf_unused_offset_(0), |
180 response_header_start_offset_(-1), | 180 response_header_start_offset_(-1), |
181 response_body_length_(-1), | 181 response_body_length_(-1), |
182 response_body_read_(0), | 182 response_body_read_(0), |
183 chunked_decoder_(NULL), | |
184 user_read_buf_(NULL), | 183 user_read_buf_(NULL), |
185 user_read_buf_len_(0), | 184 user_read_buf_len_(0), |
186 connection_(connection), | 185 connection_(connection), |
187 net_log_(net_log), | 186 net_log_(net_log), |
188 sent_last_chunk_(false), | 187 sent_last_chunk_(false), |
189 weak_ptr_factory_(this) { | 188 weak_ptr_factory_(this) { |
190 io_callback_ = base::Bind(&HttpStreamParser::OnIOComplete, | 189 io_callback_ = base::Bind(&HttpStreamParser::OnIOComplete, |
191 weak_ptr_factory_.GetWeakPtr()); | 190 weak_ptr_factory_.GetWeakPtr()); |
192 } | 191 } |
193 | 192 |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 request_body->IsInMemory() && | 945 request_body->IsInMemory() && |
947 request_body->size() > 0) { | 946 request_body->size() > 0) { |
948 size_t merged_size = request_headers.size() + request_body->size(); | 947 size_t merged_size = request_headers.size() + request_body->size(); |
949 if (merged_size <= kMaxMergedHeaderAndBodySize) | 948 if (merged_size <= kMaxMergedHeaderAndBodySize) |
950 return true; | 949 return true; |
951 } | 950 } |
952 return false; | 951 return false; |
953 } | 952 } |
954 | 953 |
955 } // namespace net | 954 } // namespace net |
OLD | NEW |