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

Unified Diff: net/disk_cache/simple/simple_entry_impl.cc

Issue 1059843002: Refactor NetLog::LogLevel --> NetLogCaptureMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again to fix a merge conflict 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/net_log_parameters.cc ('k') | net/disk_cache/simple/simple_net_log_parameters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_entry_impl.cc
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc
index f8f1b8566655cd7212ee45141f1d08f52ba6693f..a062dc226e31468e19e5f76c70cbe007c0feaa67 100644
--- a/net/disk_cache/simple/simple_entry_impl.cc
+++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -347,7 +347,7 @@ int SimpleEntryImpl::ReadData(int stream_index,
const CompletionCallback& callback) {
DCHECK(io_thread_checker_.CalledOnValidThread());
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_CALL,
CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len,
false));
@@ -355,7 +355,7 @@ int SimpleEntryImpl::ReadData(int stream_index,
if (stream_index < 0 || stream_index >= kSimpleEntryStreamCount ||
buf_len < 0) {
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END,
CreateNetLogReadWriteCompleteCallback(net::ERR_INVALID_ARGUMENT));
}
@@ -365,7 +365,7 @@ int SimpleEntryImpl::ReadData(int stream_index,
}
if (pending_operations_.empty() && (offset >= GetDataSize(stream_index) ||
offset < 0 || !buf_len)) {
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END,
CreateNetLogReadWriteCompleteCallback(0));
}
@@ -394,7 +394,7 @@ int SimpleEntryImpl::WriteData(int stream_index,
bool truncate) {
DCHECK(io_thread_checker_.CalledOnValidThread());
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_CALL,
CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len,
@@ -403,7 +403,7 @@ int SimpleEntryImpl::WriteData(int stream_index,
if (stream_index < 0 || stream_index >= kSimpleEntryStreamCount ||
offset < 0 || buf_len < 0) {
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END,
CreateNetLogReadWriteCompleteCallback(net::ERR_INVALID_ARGUMENT));
@@ -412,7 +412,7 @@ int SimpleEntryImpl::WriteData(int stream_index,
return net::ERR_INVALID_ARGUMENT;
}
if (backend_.get() && offset + buf_len > backend_->GetMaxFileSize()) {
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END,
CreateNetLogReadWriteCompleteCallback(net::ERR_FAILED));
@@ -454,7 +454,7 @@ int SimpleEntryImpl::WriteData(int stream_index,
}
op_callback = CompletionCallback();
ret_value = buf_len;
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_OPTIMISTIC,
CreateNetLogReadWriteCompleteCallback(buf_len));
@@ -809,7 +809,7 @@ void SimpleEntryImpl::ReadDataInternal(int stream_index,
DCHECK(io_thread_checker_.CalledOnValidThread());
ScopedOperationRunner operation_runner(this);
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_BEGIN,
CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len,
@@ -825,7 +825,7 @@ void SimpleEntryImpl::ReadDataInternal(int stream_index,
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, net::ERR_FAILED));
}
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END,
CreateNetLogReadWriteCompleteCallback(net::ERR_FAILED));
@@ -892,7 +892,7 @@ void SimpleEntryImpl::WriteDataInternal(int stream_index,
DCHECK(io_thread_checker_.CalledOnValidThread());
ScopedOperationRunner operation_runner(this);
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_BEGIN,
CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len,
@@ -901,7 +901,7 @@ void SimpleEntryImpl::WriteDataInternal(int stream_index,
if (state_ == STATE_FAILURE || state_ == STATE_UNINITIALIZED) {
RecordWriteResult(cache_type_, WRITE_RESULT_BAD_STATE);
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END,
CreateNetLogReadWriteCompleteCallback(net::ERR_FAILED));
@@ -1230,7 +1230,7 @@ void SimpleEntryImpl::ReadOperationComplete(
crc_check_state_[stream_index] = CRC_CHECK_NOT_DONE;
}
}
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END,
CreateNetLogReadWriteCompleteCallback(*result));
@@ -1248,7 +1248,7 @@ void SimpleEntryImpl::WriteOperationComplete(
RecordWriteResult(cache_type_, WRITE_RESULT_SUCCESS);
else
RecordWriteResult(cache_type_, WRITE_RESULT_SYNC_WRITE_FAILURE);
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END,
CreateNetLogReadWriteCompleteCallback(*result));
}
@@ -1319,7 +1319,7 @@ void SimpleEntryImpl::ChecksumOperationComplete(
DCHECK_EQ(STATE_IO_PENDING, state_);
DCHECK(result);
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEventWithNetErrorCode(
net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_CHECKSUM_END,
*result);
@@ -1334,7 +1334,7 @@ void SimpleEntryImpl::ChecksumOperationComplete(
} else {
RecordReadResult(cache_type_, READ_RESULT_SYNC_CHECKSUM_FAILURE);
}
- if (net_log_.IsLogging()) {
+ if (net_log_.GetCaptureMode().enabled()) {
net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END,
CreateNetLogReadWriteCompleteCallback(*result));
}
« no previous file with comments | « net/disk_cache/net_log_parameters.cc ('k') | net/disk_cache/simple/simple_net_log_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698