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

Unified Diff: net/base/upload_data_stream.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/base/logging_network_change_observer.cc ('k') | net/cert/ct_policy_enforcer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data_stream.cc
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index feb0fa037b8c9ac94da1ae99a985ccd49dec7784..bfcb44a0b7d068e2afc660b95b6131e0ba4bf10a 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -9,6 +9,7 @@
#include "base/values.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
+#include "net/log/net_log_event_type.h"
namespace net {
@@ -57,7 +58,7 @@ int UploadDataStream::Init(const CompletionCallback& callback,
DCHECK(callback_.is_null());
DCHECK(!callback.is_null() || IsInMemory());
net_log_ = net_log;
- net_log_.BeginEvent(NetLog::TYPE_UPLOAD_DATA_STREAM_INIT);
+ net_log_.BeginEvent(NetLogEventType::UPLOAD_DATA_STREAM_INIT);
int result = InitInternal(net_log_);
if (result == ERR_IO_PENDING) {
@@ -77,7 +78,7 @@ int UploadDataStream::Read(IOBuffer* buf,
DCHECK(initialized_successfully_);
DCHECK_GT(buf_len, 0);
- net_log_.BeginEvent(NetLog::TYPE_UPLOAD_DATA_STREAM_READ,
+ net_log_.BeginEvent(NetLogEventType::UPLOAD_DATA_STREAM_READ,
base::Bind(&NetLogReadInfoCallback, current_position_));
int result = 0;
@@ -107,12 +108,12 @@ void UploadDataStream::Reset() {
if (!initialized_successfully_) {
// If initialization has not yet succeeded, this call is aborting
// initialization.
- net_log_.EndEventWithNetErrorCode(NetLog::TYPE_UPLOAD_DATA_STREAM_INIT,
- ERR_ABORTED);
+ net_log_.EndEventWithNetErrorCode(
+ NetLogEventType::UPLOAD_DATA_STREAM_INIT, ERR_ABORTED);
} else {
// Otherwise, a read is being aborted.
- net_log_.EndEventWithNetErrorCode(NetLog::TYPE_UPLOAD_DATA_STREAM_READ,
- ERR_ABORTED);
+ net_log_.EndEventWithNetErrorCode(
+ NetLogEventType::UPLOAD_DATA_STREAM_READ, ERR_ABORTED);
}
}
@@ -159,7 +160,7 @@ void UploadDataStream::OnInitCompleted(int result) {
}
net_log_.EndEvent(
- NetLog::TYPE_UPLOAD_DATA_STREAM_INIT,
+ NetLogEventType::UPLOAD_DATA_STREAM_INIT,
base::Bind(&NetLogInitEndInfoCallback, result, total_size_, is_chunked_));
if (!callback_.is_null())
@@ -180,7 +181,7 @@ void UploadDataStream::OnReadCompleted(int result) {
}
}
- net_log_.EndEventWithNetErrorCode(NetLog::TYPE_UPLOAD_DATA_STREAM_READ,
+ net_log_.EndEventWithNetErrorCode(NetLogEventType::UPLOAD_DATA_STREAM_READ,
result);
if (!callback_.is_null())
« no previous file with comments | « net/base/logging_network_change_observer.cc ('k') | net/cert/ct_policy_enforcer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698