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

Side by Side Diff: net/http/http_stream_parser.h

Issue 1074263003: Add histograms for a number of hacks in the HTTP header parsing logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fetcher4
Patch Set: Response to comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_stream_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_ 5 #ifndef NET_HTTP_HTTP_STREAM_PARSER_H_
6 #define NET_HTTP_HTTP_STREAM_PARSER_H_ 6 #define NET_HTTP_HTTP_STREAM_PARSER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 int DoReadBody(); 153 int DoReadBody();
154 int DoReadBodyComplete(int result); 154 int DoReadBodyComplete(int result);
155 155
156 // This handles most of the logic for DoReadHeadersComplete. 156 // This handles most of the logic for DoReadHeadersComplete.
157 int HandleReadHeaderResult(int result); 157 int HandleReadHeaderResult(int result);
158 158
159 // Examines |read_buf_| to find the start and end of the headers. If they are 159 // Examines |read_buf_| to find the start and end of the headers. If they are
160 // found, parse them with DoParseResponseHeaders(). Return the offset for 160 // found, parse them with DoParseResponseHeaders(). Return the offset for
161 // the end of the headers, or -1 if the complete headers were not found, or 161 // the end of the headers, or -1 if the complete headers were not found, or
162 // with a net::Error if we encountered an error during parsing. 162 // with a net::Error if we encountered an error during parsing.
163 int ParseResponseHeaders(); 163 int FindAndParseResponseHeaders();
164 164
165 // Parse the headers into response_. Returns OK on success or a net::Error on 165 // Parse the headers into response_. Returns OK on success or a net::Error on
166 // failure. 166 // failure.
167 int DoParseResponseHeaders(int end_of_header_offset); 167 int ParseResponseHeaders(int end_of_header_offset);
168 168
169 // Examine the parsed headers to try to determine the response body size. 169 // Examine the parsed headers to try to determine the response body size.
170 void CalculateResponseBodySize(); 170 void CalculateResponseBodySize();
171 171
172 // Next state of the request, when the current one completes. 172 // Next state of the request, when the current one completes.
173 State io_state_; 173 State io_state_;
174 174
175 // The request to send. 175 // The request to send.
176 const HttpRequestInfo* request_; 176 const HttpRequestInfo* request_;
177 177
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 int upload_error_; 248 int upload_error_;
249 249
250 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_; 250 base::WeakPtrFactory<HttpStreamParser> weak_ptr_factory_;
251 251
252 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser); 252 DISALLOW_COPY_AND_ASSIGN(HttpStreamParser);
253 }; 253 };
254 254
255 } // namespace net 255 } // namespace net
256 256
257 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_ 257 #endif // NET_HTTP_HTTP_STREAM_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698