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

Unified Diff: net/disk_cache/memory/mem_entry_impl.cc

Issue 1122483004: Remove NetLog::GetCaptureMode() and NetLogCaptureMode::None() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mmenke_refactor
Patch Set: second attempt at fixing int --> bool warning on windows Created 5 years, 7 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/blockfile/sparse_control_v3.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/memory/mem_entry_impl.cc
diff --git a/net/disk_cache/memory/mem_entry_impl.cc b/net/disk_cache/memory/mem_entry_impl.cc
index c1dc8cfebd10b142b7d5eb81b22bc6d9bb9e8485..a5d9086ec0e93f913146137dfb61a9b0863ef437 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);
}
« no previous file with comments | « net/disk_cache/blockfile/sparse_control_v3.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698