Chromium Code Reviews| Index: net/disk_cache/blockfile/sparse_control.cc |
| diff --git a/net/disk_cache/blockfile/sparse_control.cc b/net/disk_cache/blockfile/sparse_control.cc |
| index e5096dc991d88d18da546b76cc41d2b4020c7dfc..312e44b01c2801df35108008365ed59553d3df21 100644 |
| --- a/net/disk_cache/blockfile/sparse_control.cc |
| +++ b/net/disk_cache/blockfile/sparse_control.cc |
| @@ -161,23 +161,21 @@ net::NetLog::EventType GetSparseEventType( |
| void LogChildOperationEnd(const net::BoundNetLog& net_log, |
| disk_cache::SparseControl::SparseOperation operation, |
| int result) { |
| - if (net_log.IsLogging()) { |
| - net::NetLog::EventType event_type; |
| - switch (operation) { |
| - case disk_cache::SparseControl::kReadOperation: |
| - event_type = net::NetLog::TYPE_SPARSE_READ_CHILD_DATA; |
| - break; |
| - case disk_cache::SparseControl::kWriteOperation: |
| - event_type = net::NetLog::TYPE_SPARSE_WRITE_CHILD_DATA; |
| - break; |
| - case disk_cache::SparseControl::kGetRangeOperation: |
| - return; |
| - default: |
| - NOTREACHED(); |
| - return; |
| - } |
| - net_log.EndEventWithNetErrorCode(event_type, result); |
| + net::NetLog::EventType event_type; |
|
eroman
2015/04/09 00:08:19
changed this
|
| + switch (operation) { |
| + case disk_cache::SparseControl::kReadOperation: |
| + event_type = net::NetLog::TYPE_SPARSE_READ_CHILD_DATA; |
| + break; |
| + case disk_cache::SparseControl::kWriteOperation: |
| + event_type = net::NetLog::TYPE_SPARSE_WRITE_CHILD_DATA; |
| + break; |
| + case disk_cache::SparseControl::kGetRangeOperation: |
| + return; |
| + default: |
| + NOTREACHED(); |
| + return; |
| } |
| + net_log.EndEventWithNetErrorCode(event_type, result); |
| } |
| } // namespace. |
| @@ -275,7 +273,7 @@ int SparseControl::StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf, |
| finished_ = false; |
| abort_ = false; |
| - if (entry_->net_log().IsLogging()) { |
| + if (entry_->net_log().GetCaptureMode().enabled()) { |
| entry_->net_log().BeginEvent( |
| GetSparseEventType(operation_), |
| CreateNetLogSparseOperationCallback(offset_, buf_len_)); |
| @@ -679,14 +677,14 @@ void SparseControl::DoChildrenIO() { |
| // Range operations are finished synchronously, often without setting |
| // |finished_| to true. |
| if (kGetRangeOperation == operation_ && |
| - entry_->net_log().IsLogging()) { |
| + entry_->net_log().GetCaptureMode().enabled()) { |
| entry_->net_log().EndEvent( |
| net::NetLog::TYPE_SPARSE_GET_RANGE, |
| CreateNetLogGetAvailableRangeResultCallback(offset_, result_)); |
| } |
| if (finished_) { |
| if (kGetRangeOperation != operation_ && |
| - entry_->net_log().IsLogging()) { |
| + entry_->net_log().GetCaptureMode().enabled()) { |
| 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().IsLogging()) { |
| + if (entry_->net_log().GetCaptureMode().enabled()) { |
| 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().IsLogging()) { |
| + if (entry_->net_log().GetCaptureMode().enabled()) { |
| 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().IsLogging()) { |
| + if (entry_->net_log().GetCaptureMode().enabled()) { |
| entry_->net_log().AddEvent(net::NetLog::TYPE_CANCELLED); |
| entry_->net_log().EndEvent(GetSparseEventType(operation_)); |
| } |