diff options
author | eroman <eroman@chromium.org> | 2015-05-06 12:55:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-06 19:56:36 +0000 |
commit | 24bc6a1df2048ee8feeb1d837cdfddd2e9d0cde1 (patch) | |
tree | 7735fe6a9a19f3327c040a237c15c49855d2a23c /net/disk_cache | |
parent | 1ac5725305a33686747895d6cb960ecbf4899158 (diff) | |
download | chromium_src-24bc6a1df2048ee8feeb1d837cdfddd2e9d0cde1.zip chromium_src-24bc6a1df2048ee8feeb1d837cdfddd2e9d0cde1.tar.gz chromium_src-24bc6a1df2048ee8feeb1d837cdfddd2e9d0cde1.tar.bz2 |
Remove NetLog::GetCaptureMode() and NetLogCaptureMode::None()
* In place of GetCaptureMode() use NetLog::IsCapturing().
* NetLogCaptureMode::None() is no longer needed now.
This clears up some confusion since there are no longer multiple sources of truth for what the capture mode is (per observer vs per log). The removal of NetLogCaptureMode::None() similarly removes confusion over being able to add an observer with a capture mode of None.
BUG=484762
TBR=asanka@chromium.org
Review URL: https://codereview.chromium.org/1122483004
Cr-Commit-Position: refs/heads/master@{#328589}
Diffstat (limited to 'net/disk_cache')
-rw-r--r-- | net/disk_cache/blockfile/entry_impl.cc | 10 | ||||
-rw-r--r-- | net/disk_cache/blockfile/entry_impl_v3.cc | 8 | ||||
-rw-r--r-- | net/disk_cache/blockfile/sparse_control.cc | 16 | ||||
-rw-r--r-- | net/disk_cache/blockfile/sparse_control_v3.cc | 10 | ||||
-rw-r--r-- | net/disk_cache/memory/mem_entry_impl.cc | 28 | ||||
-rw-r--r-- | net/disk_cache/simple/simple_entry_impl.cc | 30 |
6 files changed, 50 insertions, 52 deletions
diff --git a/net/disk_cache/blockfile/entry_impl.cc b/net/disk_cache/blockfile/entry_impl.cc index add38de..a4f0ff01 100644 --- a/net/disk_cache/blockfile/entry_impl.cc +++ b/net/disk_cache/blockfile/entry_impl.cc @@ -62,7 +62,7 @@ class SyncCallback: public disk_cache::FileIOCallback { void SyncCallback::OnFileIOComplete(int bytes_copied) { entry_->DecrementIoCount(); if (!callback_.is_null()) { - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().EndEvent( end_event_type_, disk_cache::CreateNetLogReadWriteCompleteCallback(bytes_copied)); @@ -315,7 +315,7 @@ void EntryImpl::DoomImpl() { int EntryImpl::ReadDataImpl(int index, int offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_ENTRY_READ_DATA, CreateNetLogReadWriteDataCallback(index, offset, buf_len, false)); @@ -323,7 +323,7 @@ int EntryImpl::ReadDataImpl(int index, int offset, IOBuffer* buf, int buf_len, int result = InternalReadData(index, offset, buf, buf_len, callback); - if (result != net::ERR_IO_PENDING && net_log_.GetCaptureMode().enabled()) { + if (result != net::ERR_IO_PENDING && net_log_.IsCapturing()) { net_log_.EndEvent( net::NetLog::TYPE_ENTRY_READ_DATA, CreateNetLogReadWriteCompleteCallback(result)); @@ -334,7 +334,7 @@ int EntryImpl::ReadDataImpl(int index, int offset, IOBuffer* buf, int buf_len, int EntryImpl::WriteDataImpl(int index, int offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback, bool truncate) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_ENTRY_WRITE_DATA, CreateNetLogReadWriteDataCallback(index, offset, buf_len, truncate)); @@ -343,7 +343,7 @@ int EntryImpl::WriteDataImpl(int index, int offset, IOBuffer* buf, int buf_len, int result = InternalWriteData(index, offset, buf, buf_len, callback, truncate); - if (result != net::ERR_IO_PENDING && net_log_.GetCaptureMode().enabled()) { + if (result != net::ERR_IO_PENDING && net_log_.IsCapturing()) { net_log_.EndEvent( net::NetLog::TYPE_ENTRY_WRITE_DATA, CreateNetLogReadWriteCompleteCallback(result)); diff --git a/net/disk_cache/blockfile/entry_impl_v3.cc b/net/disk_cache/blockfile/entry_impl_v3.cc index 78ef1b8..29b063c 100644 --- a/net/disk_cache/blockfile/entry_impl_v3.cc +++ b/net/disk_cache/blockfile/entry_impl_v3.cc @@ -547,7 +547,7 @@ int EntryImplV3::ReadData(int index, int offset, IOBuffer* buf, int buf_len, int EntryImpl::ReadDataImpl(int index, int offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_ENTRY_READ_DATA, CreateNetLogReadWriteDataCallback(index, offset, buf_len, false)); @@ -555,7 +555,7 @@ int EntryImpl::ReadDataImpl(int index, int offset, IOBuffer* buf, int buf_len, int result = InternalReadData(index, offset, buf, buf_len, callback); - if (result != net::ERR_IO_PENDING && net_log_.GetCaptureMode().enabled()) { + if (result != net::ERR_IO_PENDING && net_log_.IsCapturing()) { net_log_.EndEvent( net::NetLog::TYPE_ENTRY_READ_DATA, CreateNetLogReadWriteCompleteCallback(result)); @@ -586,7 +586,7 @@ int EntryImplV3::WriteData(int index, int offset, IOBuffer* buf, int buf_len, int EntryImpl::WriteDataImpl(int index, int offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback, bool truncate) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_ENTRY_WRITE_DATA, CreateNetLogReadWriteDataCallback(index, offset, buf_len, truncate)); @@ -595,7 +595,7 @@ int EntryImpl::WriteDataImpl(int index, int offset, IOBuffer* buf, int buf_len, int result = InternalWriteData(index, offset, buf, buf_len, callback, truncate); - if (result != net::ERR_IO_PENDING && net_log_.GetCaptureMode().enabled()) { + if (result != net::ERR_IO_PENDING && net_log_.IsCapturing()) { net_log_.EndEvent( net::NetLog::TYPE_ENTRY_WRITE_DATA, CreateNetLogReadWriteCompleteCallback(result)); diff --git a/net/disk_cache/blockfile/sparse_control.cc b/net/disk_cache/blockfile/sparse_control.cc index 8ce659da0..926cf36 100644 --- a/net/disk_cache/blockfile/sparse_control.cc +++ b/net/disk_cache/blockfile/sparse_control.cc @@ -161,7 +161,7 @@ net::NetLog::EventType GetSparseEventType( void LogChildOperationEnd(const net::BoundNetLog& net_log, disk_cache::SparseControl::SparseOperation operation, int result) { - if (net_log.GetCaptureMode().enabled()) { + if (net_log.IsCapturing()) { net::NetLog::EventType event_type; switch (operation) { case disk_cache::SparseControl::kReadOperation: @@ -275,7 +275,7 @@ int SparseControl::StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf, finished_ = false; abort_ = false; - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().BeginEvent( GetSparseEventType(operation_), CreateNetLogSparseOperationCallback(offset_, buf_len_)); @@ -678,15 +678,13 @@ void SparseControl::DoChildrenIO() { // Range operations are finished synchronously, often without setting // |finished_| to true. - if (kGetRangeOperation == operation_ && - entry_->net_log().GetCaptureMode().enabled()) { + if (kGetRangeOperation == operation_ && entry_->net_log().IsCapturing()) { entry_->net_log().EndEvent( net::NetLog::TYPE_SPARSE_GET_RANGE, CreateNetLogGetAvailableRangeResultCallback(offset_, result_)); } if (finished_) { - if (kGetRangeOperation != operation_ && - entry_->net_log().GetCaptureMode().enabled()) { + if (kGetRangeOperation != operation_ && entry_->net_log().IsCapturing()) { entry_->net_log().EndEvent(GetSparseEventType(operation_)); } if (pending_) @@ -716,7 +714,7 @@ bool SparseControl::DoChildIO() { int rv = 0; switch (operation_) { case kReadOperation: - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().BeginEvent( net::NetLog::TYPE_SPARSE_READ_CHILD_DATA, CreateNetLogSparseReadWriteCallback(child_->net_log().source(), @@ -726,7 +724,7 @@ bool SparseControl::DoChildIO() { child_len_, callback); break; case kWriteOperation: - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().BeginEvent( net::NetLog::TYPE_SPARSE_WRITE_CHILD_DATA, CreateNetLogSparseReadWriteCallback(child_->net_log().source(), @@ -856,7 +854,7 @@ void SparseControl::OnChildIOCompleted(int result) { // We'll return the current result of the operation, which may be less than // the bytes to read or write, but the user cancelled the operation. abort_ = false; - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().AddEvent(net::NetLog::TYPE_CANCELLED); entry_->net_log().EndEvent(GetSparseEventType(operation_)); } diff --git a/net/disk_cache/blockfile/sparse_control_v3.cc b/net/disk_cache/blockfile/sparse_control_v3.cc index 91492b3..bee23dc 100644 --- a/net/disk_cache/blockfile/sparse_control_v3.cc +++ b/net/disk_cache/blockfile/sparse_control_v3.cc @@ -163,7 +163,7 @@ net::NetLog::EventType GetSparseEventType( void LogChildOperationEnd(const net::BoundNetLog& net_log, disk_cache::SparseControl::SparseOperation operation, int result) { - if (net_log.GetCaptureMode().enabled()) { + if (net_log.IsCapturing()) { net::NetLog::EventType event_type; switch (operation) { case disk_cache::SparseControl::kReadOperation: @@ -254,7 +254,7 @@ int SparseControl::StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf, finished_ = false; abort_ = false; - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().BeginEvent( GetSparseEventType(operation_), CreateNetLogSparseOperationCallback(offset_, buf_len_)); @@ -563,7 +563,7 @@ bool SparseControl::DoChildIO() { int rv = 0; switch (operation_) { case kReadOperation: - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().BeginEvent( net::NetLog::TYPE_SPARSE_READ_CHILD_DATA, CreateNetLogSparseReadWriteCallback(child_->net_log().source(), @@ -573,7 +573,7 @@ bool SparseControl::DoChildIO() { child_len_, callback); break; case kWriteOperation: - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().BeginEvent( net::NetLog::TYPE_SPARSE_WRITE_CHILD_DATA, CreateNetLogSparseReadWriteCallback(child_->net_log().source(), @@ -846,7 +846,7 @@ void SparseControl::OnChildIOCompleted(int result) { // We'll return the current result of the operation, which may be less than // the bytes to read or write, but the user cancelled the operation. abort_ = false; - if (entry_->net_log().GetCaptureMode().enabled()) { + if (entry_->net_log().IsCapturing()) { entry_->net_log().AddEvent(net::NetLog::TYPE_CANCELLED); entry_->net_log().EndEvent(GetSparseEventType(operation_)); } diff --git a/net/disk_cache/memory/mem_entry_impl.cc b/net/disk_cache/memory/mem_entry_impl.cc index c1dc8cf..a5d9086 100644 --- a/net/disk_cache/memory/mem_entry_impl.cc +++ b/net/disk_cache/memory/mem_entry_impl.cc @@ -185,7 +185,7 @@ int32 MemEntryImpl::GetDataSize(int index) const { int MemEntryImpl::ReadData(int index, int offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_ENTRY_READ_DATA, CreateNetLogReadWriteDataCallback(index, offset, buf_len, false)); @@ -193,7 +193,7 @@ int MemEntryImpl::ReadData(int index, int offset, IOBuffer* buf, int buf_len, int result = InternalReadData(index, offset, buf, buf_len); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.EndEvent( net::NetLog::TYPE_ENTRY_READ_DATA, CreateNetLogReadWriteCompleteCallback(result)); @@ -203,7 +203,7 @@ int MemEntryImpl::ReadData(int index, int offset, IOBuffer* buf, int buf_len, int MemEntryImpl::WriteData(int index, int offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback, bool truncate) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_ENTRY_WRITE_DATA, CreateNetLogReadWriteDataCallback(index, offset, buf_len, truncate)); @@ -211,7 +211,7 @@ int MemEntryImpl::WriteData(int index, int offset, IOBuffer* buf, int buf_len, int result = InternalWriteData(index, offset, buf, buf_len, truncate); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.EndEvent( net::NetLog::TYPE_ENTRY_WRITE_DATA, CreateNetLogReadWriteCompleteCallback(result)); @@ -221,39 +221,39 @@ int MemEntryImpl::WriteData(int index, int offset, IOBuffer* buf, int buf_len, int MemEntryImpl::ReadSparseData(int64 offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_SPARSE_READ, CreateNetLogSparseOperationCallback(offset, buf_len)); } int result = InternalReadSparseData(offset, buf, buf_len); - if (net_log_.GetCaptureMode().enabled()) + if (net_log_.IsCapturing()) net_log_.EndEvent(net::NetLog::TYPE_SPARSE_READ); return result; } int MemEntryImpl::WriteSparseData(int64 offset, IOBuffer* buf, int buf_len, const CompletionCallback& callback) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_SPARSE_WRITE, CreateNetLogSparseOperationCallback(offset, buf_len)); } int result = InternalWriteSparseData(offset, buf, buf_len); - if (net_log_.GetCaptureMode().enabled()) + if (net_log_.IsCapturing()) net_log_.EndEvent(net::NetLog::TYPE_SPARSE_WRITE); return result; } int MemEntryImpl::GetAvailableRange(int64 offset, int len, int64* start, const CompletionCallback& callback) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_SPARSE_GET_RANGE, CreateNetLogSparseOperationCallback(offset, len)); } int result = GetAvailableRange(offset, len, start); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.EndEvent( net::NetLog::TYPE_SPARSE_GET_RANGE, CreateNetLogGetAvailableRangeResultCallback(*start, result)); @@ -373,7 +373,7 @@ int MemEntryImpl::InternalReadSparseData(int64 offset, IOBuffer* buf, // we should stop. if (child_offset < child->child_first_pos_) break; - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_SPARSE_READ_CHILD_DATA, CreateNetLogSparseReadWriteCallback(child->net_log().source(), @@ -381,7 +381,7 @@ int MemEntryImpl::InternalReadSparseData(int64 offset, IOBuffer* buf, } int ret = child->ReadData(kSparseData, child_offset, io_buf.get(), io_buf->BytesRemaining(), CompletionCallback()); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.EndEventWithNetErrorCode( net::NetLog::TYPE_SPARSE_READ_CHILD_DATA, ret); } @@ -430,7 +430,7 @@ int MemEntryImpl::InternalWriteSparseData(int64 offset, IOBuffer* buf, // Keep a record of the last byte position (exclusive) in the child. int data_size = child->GetDataSize(kSparseData); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.BeginEvent( net::NetLog::TYPE_SPARSE_WRITE_CHILD_DATA, CreateNetLogSparseReadWriteCallback(child->net_log().source(), @@ -443,7 +443,7 @@ int MemEntryImpl::InternalWriteSparseData(int64 offset, IOBuffer* buf, // continuous we may want to discard this write. int ret = child->WriteData(kSparseData, child_offset, io_buf.get(), write_len, CompletionCallback(), true); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.EndEventWithNetErrorCode( net::NetLog::TYPE_SPARSE_WRITE_CHILD_DATA, ret); } diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc index 1817bfc..b7c8524 100644 --- a/net/disk_cache/simple/simple_entry_impl.cc +++ b/net/disk_cache/simple/simple_entry_impl.cc @@ -346,7 +346,7 @@ int SimpleEntryImpl::ReadData(int stream_index, const CompletionCallback& callback) { DCHECK(io_thread_checker_.CalledOnValidThread()); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_CALL, CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len, false)); @@ -354,7 +354,7 @@ int SimpleEntryImpl::ReadData(int stream_index, if (stream_index < 0 || stream_index >= kSimpleEntryStreamCount || buf_len < 0) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END, CreateNetLogReadWriteCompleteCallback(net::ERR_INVALID_ARGUMENT)); } @@ -364,7 +364,7 @@ int SimpleEntryImpl::ReadData(int stream_index, } if (pending_operations_.empty() && (offset >= GetDataSize(stream_index) || offset < 0 || !buf_len)) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END, CreateNetLogReadWriteCompleteCallback(0)); } @@ -393,7 +393,7 @@ int SimpleEntryImpl::WriteData(int stream_index, bool truncate) { DCHECK(io_thread_checker_.CalledOnValidThread()); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_CALL, CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len, @@ -402,7 +402,7 @@ int SimpleEntryImpl::WriteData(int stream_index, if (stream_index < 0 || stream_index >= kSimpleEntryStreamCount || offset < 0 || buf_len < 0) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END, CreateNetLogReadWriteCompleteCallback(net::ERR_INVALID_ARGUMENT)); @@ -411,7 +411,7 @@ int SimpleEntryImpl::WriteData(int stream_index, return net::ERR_INVALID_ARGUMENT; } if (backend_.get() && offset + buf_len > backend_->GetMaxFileSize()) { - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END, CreateNetLogReadWriteCompleteCallback(net::ERR_FAILED)); @@ -453,7 +453,7 @@ int SimpleEntryImpl::WriteData(int stream_index, } op_callback = CompletionCallback(); ret_value = buf_len; - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_OPTIMISTIC, CreateNetLogReadWriteCompleteCallback(buf_len)); @@ -808,7 +808,7 @@ void SimpleEntryImpl::ReadDataInternal(int stream_index, DCHECK(io_thread_checker_.CalledOnValidThread()); ScopedOperationRunner operation_runner(this); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_BEGIN, CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len, @@ -824,7 +824,7 @@ void SimpleEntryImpl::ReadDataInternal(int stream_index, base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(callback, net::ERR_FAILED)); } - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END, CreateNetLogReadWriteCompleteCallback(net::ERR_FAILED)); @@ -891,7 +891,7 @@ void SimpleEntryImpl::WriteDataInternal(int stream_index, DCHECK(io_thread_checker_.CalledOnValidThread()); ScopedOperationRunner operation_runner(this); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_BEGIN, CreateNetLogReadWriteDataCallback(stream_index, offset, buf_len, @@ -900,7 +900,7 @@ void SimpleEntryImpl::WriteDataInternal(int stream_index, if (state_ == STATE_FAILURE || state_ == STATE_UNINITIALIZED) { RecordWriteResult(cache_type_, WRITE_RESULT_BAD_STATE); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END, CreateNetLogReadWriteCompleteCallback(net::ERR_FAILED)); @@ -1229,7 +1229,7 @@ void SimpleEntryImpl::ReadOperationComplete( crc_check_state_[stream_index] = CRC_CHECK_NOT_DONE; } } - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END, CreateNetLogReadWriteCompleteCallback(*result)); @@ -1247,7 +1247,7 @@ void SimpleEntryImpl::WriteOperationComplete( RecordWriteResult(cache_type_, WRITE_RESULT_SUCCESS); else RecordWriteResult(cache_type_, WRITE_RESULT_SYNC_WRITE_FAILURE); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_WRITE_END, CreateNetLogReadWriteCompleteCallback(*result)); } @@ -1318,7 +1318,7 @@ void SimpleEntryImpl::ChecksumOperationComplete( DCHECK_EQ(STATE_IO_PENDING, state_); DCHECK(result); - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEventWithNetErrorCode( net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_CHECKSUM_END, *result); @@ -1333,7 +1333,7 @@ void SimpleEntryImpl::ChecksumOperationComplete( } else { RecordReadResult(cache_type_, READ_RESULT_SYNC_CHECKSUM_FAILURE); } - if (net_log_.GetCaptureMode().enabled()) { + if (net_log_.IsCapturing()) { net_log_.AddEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY_READ_END, CreateNetLogReadWriteCompleteCallback(*result)); } |