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

Unified Diff: net/http/http_stream_parser.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory_impl_request.cc ('k') | net/log/bounded_file_net_log_observer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_parser.cc
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 87e34da7bd470eefcff36af46b9ca22bc562299e..31681edb8200e547c7e07eab3c2ad372d8e91d9d 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -22,6 +22,7 @@
#include "net/http/http_response_headers.h"
#include "net/http/http_status_line_validator.h"
#include "net/http/http_util.h"
+#include "net/log/net_log_event_type.h"
#include "net/socket/client_socket_handle.h"
#include "net/socket/ssl_client_socket.h"
#include "net/ssl/token_binding.h"
@@ -241,11 +242,9 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
DCHECK(!callback.is_null());
DCHECK(response);
- net_log_.AddEvent(
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS,
- base::Bind(&HttpRequestHeaders::NetLogCallback,
- base::Unretained(&headers),
- &request_line));
+ net_log_.AddEvent(NetLogEventType::HTTP_TRANSACTION_SEND_REQUEST_HEADERS,
+ base::Bind(&HttpRequestHeaders::NetLogCallback,
+ base::Unretained(&headers), &request_line));
DVLOG(1) << __func__ << "() request_line = \"" << request_line << "\""
<< " headers = \"" << headers.ToString() << "\"";
@@ -306,12 +305,11 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
request_headers_->SetOffset(0);
did_merge = true;
- net_log_.AddEvent(
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_BODY,
- base::Bind(&NetLogSendRequestBodyCallback,
- request_->upload_data_stream->size(),
- false, /* not chunked */
- true /* merged */));
+ net_log_.AddEvent(NetLogEventType::HTTP_TRANSACTION_SEND_REQUEST_BODY,
+ base::Bind(&NetLogSendRequestBodyCallback,
+ request_->upload_data_stream->size(),
+ false, /* not chunked */
+ true /* merged */));
}
if (!did_merge) {
@@ -435,14 +433,14 @@ int HttpStreamParser::DoLoop(int result) {
result = DoSendRequestComplete(result);
break;
case STATE_READ_HEADERS:
- net_log_.BeginEvent(NetLog::TYPE_HTTP_STREAM_PARSER_READ_HEADERS);
+ net_log_.BeginEvent(NetLogEventType::HTTP_STREAM_PARSER_READ_HEADERS);
DCHECK_GE(result, 0);
result = DoReadHeaders();
break;
case STATE_READ_HEADERS_COMPLETE:
result = DoReadHeadersComplete(result);
net_log_.EndEventWithNetErrorCode(
- NetLog::TYPE_HTTP_STREAM_PARSER_READ_HEADERS, result);
+ NetLogEventType::HTTP_STREAM_PARSER_READ_HEADERS, result);
break;
case STATE_READ_BODY:
DCHECK_GE(result, 0);
@@ -507,12 +505,11 @@ int HttpStreamParser::DoSendHeadersComplete(int result) {
// !IsEOF() indicates that the body wasn't merged.
(request_->upload_data_stream->size() > 0 &&
!request_->upload_data_stream->IsEOF()))) {
- net_log_.AddEvent(
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_BODY,
- base::Bind(&NetLogSendRequestBodyCallback,
- request_->upload_data_stream->size(),
- request_->upload_data_stream->is_chunked(),
- false /* not merged */));
+ net_log_.AddEvent(NetLogEventType::HTTP_TRANSACTION_SEND_REQUEST_BODY,
+ base::Bind(&NetLogSendRequestBodyCallback,
+ request_->upload_data_stream->size(),
+ request_->upload_data_stream->is_chunked(),
+ false /* not merged */));
io_state_ = STATE_SEND_BODY;
return OK;
}
« no previous file with comments | « net/http/http_stream_factory_impl_request.cc ('k') | net/log/bounded_file_net_log_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698