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 efdd65a589a02b407ea43ad4ac1974ecffdc7f34..2c25d0ff8d02c2b8453501d33930ad2a83e6bba6 100644 |
--- a/net/disk_cache/simple/simple_entry_impl.cc |
+++ b/net/disk_cache/simple/simple_entry_impl.cc |
@@ -479,6 +479,11 @@ int SimpleEntryImpl::ReadSparseData(int64_t offset, |
const CompletionCallback& callback) { |
DCHECK(io_thread_checker_.CalledOnValidThread()); |
+ if (net_log_.IsCapturing()) { |
+ net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_SPARSE_CALL, |
+ CreateNetLogSparseOperationCallback(offset, buf_len)); |
+ } |
+ |
ScopedOperationRunner operation_runner(this); |
pending_operations_.push(SimpleEntryOperation::ReadSparseOperation( |
this, offset, buf_len, buf, callback)); |
@@ -491,6 +496,11 @@ int SimpleEntryImpl::WriteSparseData(int64_t offset, |
const CompletionCallback& callback) { |
DCHECK(io_thread_checker_.CalledOnValidThread()); |
+ if (net_log_.IsCapturing()) { |
+ net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_SPARSE_CALL, |
+ CreateNetLogSparseOperationCallback(offset, buf_len)); |
+ } |
+ |
ScopedOperationRunner operation_runner(this); |
pending_operations_.push(SimpleEntryOperation::WriteSparseOperation( |
this, offset, buf_len, buf, callback)); |
@@ -992,6 +1002,12 @@ void SimpleEntryImpl::ReadSparseDataInternal( |
DCHECK(io_thread_checker_.CalledOnValidThread()); |
ScopedOperationRunner operation_runner(this); |
+ if (net_log_.IsCapturing()) { |
+ net_log_.AddEvent( |
+ net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_SPARSE_BEGIN, |
+ CreateNetLogSparseOperationCallback(sparse_offset, buf_len)); |
+ } |
+ |
DCHECK_EQ(STATE_READY, state_); |
state_ = STATE_IO_PENDING; |
@@ -1020,6 +1036,12 @@ void SimpleEntryImpl::WriteSparseDataInternal( |
DCHECK(io_thread_checker_.CalledOnValidThread()); |
ScopedOperationRunner operation_runner(this); |
+ if (net_log_.IsCapturing()) { |
+ net_log_.AddEvent( |
+ net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_SPARSE_BEGIN, |
+ CreateNetLogSparseOperationCallback(sparse_offset, buf_len)); |
+ } |
+ |
DCHECK_EQ(STATE_READY, state_); |
state_ = STATE_IO_PENDING; |
@@ -1264,6 +1286,11 @@ void SimpleEntryImpl::ReadSparseOperationComplete( |
DCHECK(synchronous_entry_); |
DCHECK(result); |
+ if (net_log_.IsCapturing()) { |
+ net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_SPARSE_END, |
+ CreateNetLogReadWriteCompleteCallback(*result)); |
+ } |
+ |
SimpleEntryStat entry_stat(*last_used, last_modified_, data_size_, |
sparse_data_size_); |
EntryOperationComplete(completion_callback, entry_stat, std::move(result)); |
@@ -1277,6 +1304,11 @@ void SimpleEntryImpl::WriteSparseOperationComplete( |
DCHECK(synchronous_entry_); |
DCHECK(result); |
+ if (net_log_.IsCapturing()) { |
+ net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_SPARSE_END, |
+ CreateNetLogReadWriteCompleteCallback(*result)); |
+ } |
+ |
EntryOperationComplete(completion_callback, *entry_stat, std::move(result)); |
} |