diff options
Diffstat (limited to 'net/disk_cache/blockfile')
-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 |
4 files changed, 21 insertions, 23 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_)); } |