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

Unified Diff: net/disk_cache/blockfile/entry_impl.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Created 4 years, 3 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
Index: net/disk_cache/blockfile/entry_impl.cc
diff --git a/net/disk_cache/blockfile/entry_impl.cc b/net/disk_cache/blockfile/entry_impl.cc
index b20e10423c287a3305cd120c9f2432f1a94d7b79..1cf74e06e2a43fc2de99aa4b1f46acdd239686ef 100644
--- a/net/disk_cache/blockfile/entry_impl.cc
+++ b/net/disk_cache/blockfile/entry_impl.cc
@@ -19,6 +19,8 @@
#include "net/disk_cache/blockfile/sparse_control.h"
#include "net/disk_cache/cache_util.h"
#include "net/disk_cache/net_log_parameters.h"
+#include "net/log/net_log_event_type.h"
+#include "net/log/net_log_source_type.h"
// Provide a BackendImpl object to macros from histogram_macros.h.
#define CACHE_UMA_BACKEND_IMPL_OBJ backend_
@@ -40,7 +42,7 @@ class SyncCallback: public disk_cache::FileIOCallback {
// discard, or when the NetLog is not set to log all events.
SyncCallback(disk_cache::EntryImpl* entry, net::IOBuffer* buffer,
const net::CompletionCallback& callback,
- net::NetLog::EventType end_event_type)
+ net::NetLogEventType end_event_type)
: entry_(entry), callback_(callback), buf_(buffer),
start_(TimeTicks::Now()), end_event_type_(end_event_type) {
entry->AddRef();
@@ -56,7 +58,7 @@ class SyncCallback: public disk_cache::FileIOCallback {
net::CompletionCallback callback_;
scoped_refptr<net::IOBuffer> buf_;
TimeTicks start_;
- const net::NetLog::EventType end_event_type_;
+ const net::NetLogEventType end_event_type_;
DISALLOW_COPY_AND_ASSIGN(SyncCallback);
};
@@ -319,7 +321,7 @@ int EntryImpl::ReadDataImpl(int index, int offset, IOBuffer* buf, int buf_len,
const CompletionCallback& callback) {
if (net_log_.IsCapturing()) {
net_log_.BeginEvent(
- net::NetLog::TYPE_ENTRY_READ_DATA,
+ net::NetLogEventType::ENTRY_READ_DATA,
CreateNetLogReadWriteDataCallback(index, offset, buf_len, false));
}
@@ -327,7 +329,7 @@ int EntryImpl::ReadDataImpl(int index, int offset, IOBuffer* buf, int buf_len,
if (result != net::ERR_IO_PENDING && net_log_.IsCapturing()) {
net_log_.EndEvent(
- net::NetLog::TYPE_ENTRY_READ_DATA,
+ net::NetLogEventType::ENTRY_READ_DATA,
CreateNetLogReadWriteCompleteCallback(result));
}
return result;
@@ -338,7 +340,7 @@ int EntryImpl::WriteDataImpl(int index, int offset, IOBuffer* buf, int buf_len,
bool truncate) {
if (net_log_.IsCapturing()) {
net_log_.BeginEvent(
- net::NetLog::TYPE_ENTRY_WRITE_DATA,
+ net::NetLogEventType::ENTRY_WRITE_DATA,
CreateNetLogReadWriteDataCallback(index, offset, buf_len, truncate));
}
@@ -347,7 +349,7 @@ int EntryImpl::WriteDataImpl(int index, int offset, IOBuffer* buf, int buf_len,
if (result != net::ERR_IO_PENDING && net_log_.IsCapturing()) {
net_log_.EndEvent(
- net::NetLog::TYPE_ENTRY_WRITE_DATA,
+ net::NetLogEventType::ENTRY_WRITE_DATA,
CreateNetLogReadWriteCompleteCallback(result));
}
return result;
@@ -466,7 +468,7 @@ bool EntryImpl::IsSameEntry(const std::string& key, uint32_t hash) {
}
void EntryImpl::InternalDoom() {
- net_log_.AddEvent(net::NetLog::TYPE_ENTRY_DOOM);
+ net_log_.AddEvent(net::NetLogEventType::ENTRY_DOOM);
DCHECK(node_.HasData());
if (!node_.Data()->dirty) {
node_.Data()->dirty = backend_->GetCurrentEntryId();
@@ -732,9 +734,9 @@ void EntryImpl::ReportIOTime(Operation op, const base::TimeTicks& start) {
void EntryImpl::BeginLogging(net::NetLog* net_log, bool created) {
DCHECK(!net_log_.net_log());
net_log_ = net::BoundNetLog::Make(
- net_log, net::NetLog::SOURCE_DISK_CACHE_ENTRY);
+ net_log, net::NetLogSourceType::DISK_CACHE_ENTRY);
net_log_.BeginEvent(
- net::NetLog::TYPE_DISK_CACHE_ENTRY_IMPL,
+ net::NetLogEventType::DISK_CACHE_ENTRY_IMPL,
CreateNetLogEntryCreationCallback(this, created));
}
@@ -951,7 +953,7 @@ EntryImpl::~EntryImpl() {
#if defined(NET_BUILD_STRESS_CACHE)
SanityCheck();
#endif
- net_log_.AddEvent(net::NetLog::TYPE_ENTRY_CLOSE);
+ net_log_.AddEvent(net::NetLogEventType::ENTRY_CLOSE);
bool ret = true;
for (int index = 0; index < kNumStreams; index++) {
if (user_buffers_[index].get()) {
@@ -978,7 +980,7 @@ EntryImpl::~EntryImpl() {
}
Trace("~EntryImpl out 0x%p", reinterpret_cast<void*>(this));
- net_log_.EndEvent(net::NetLog::TYPE_DISK_CACHE_ENTRY_IMPL);
+ net_log_.EndEvent(net::NetLogEventType::DISK_CACHE_ENTRY_IMPL);
backend_->OnEntryDestroyEnd();
}
@@ -1046,7 +1048,7 @@ int EntryImpl::InternalReadData(int index, int offset,
SyncCallback* io_callback = NULL;
if (!callback.is_null()) {
io_callback = new SyncCallback(this, buf, callback,
- net::NetLog::TYPE_ENTRY_READ_DATA);
+ net::NetLogEventType::ENTRY_READ_DATA);
}
TimeTicks start_async = TimeTicks::Now();
@@ -1150,7 +1152,7 @@ int EntryImpl::InternalWriteData(int index, int offset,
SyncCallback* io_callback = NULL;
if (!callback.is_null()) {
io_callback = new SyncCallback(this, buf, callback,
- net::NetLog::TYPE_ENTRY_WRITE_DATA);
+ net::NetLogEventType::ENTRY_WRITE_DATA);
}
TimeTicks start_async = TimeTicks::Now();

Powered by Google App Engine
This is Rietveld 408576698