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

Unified Diff: net/disk_cache/sparse_control.cc

Issue 6005015: Revert 70618 - First pass at adding http/backend cache events to the NetLog. ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/entry_impl.cc ('k') | net/disk_cache/stress_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/sparse_control.cc
===================================================================
--- net/disk_cache/sparse_control.cc (revision 70618)
+++ net/disk_cache/sparse_control.cc (working copy)
@@ -138,29 +138,6 @@
this, &ChildrenDeleter::DeleteChildren));
}
-// Logs the end event for |operation|, if all events are being logged.
-void LogOperationEnd(const net::BoundNetLog& net_log,
- disk_cache::SparseControl::SparseOperation operation,
- int result) {
- if (net_log.IsLoggingAllEvents()) {
- net::NetLog::EventType event_type;
- switch (operation) {
- case disk_cache::SparseControl::kReadOperation:
- event_type = net::NetLog::TYPE_SPARSE_CONTROL_READ;
- break;
- case disk_cache::SparseControl::kWriteOperation:
- event_type = net::NetLog::TYPE_SPARSE_CONTROL_WRITE;
- break;
- case disk_cache::SparseControl::kGetRangeOperation:
- event_type = net::NetLog::TYPE_SPARSE_CONTROL_GET_RANGE;
- break;
- default:
- NOTREACHED();
- }
- net_log.EndEventWithNetErrorCode(event_type, result);
- }
-}
-
} // namespace.
namespace disk_cache {
@@ -246,7 +223,6 @@
finished_ = false;
abort_ = false;
- entry_->net_log().BeginEvent(net::NetLog::TYPE_SPARSE_CONTROL, NULL);
DoChildrenIO();
if (!pending_) {
@@ -634,11 +610,8 @@
void SparseControl::DoChildrenIO() {
while (DoChildIO()) continue;
- if (finished_) {
- entry_->net_log().EndEvent(net::NetLog::TYPE_SPARSE_CONTROL, NULL);
- if (pending_)
- DoUserCallback();
- }
+ if (pending_ && finished_)
+ DoUserCallback();
}
bool SparseControl::DoChildIO() {
@@ -659,32 +632,14 @@
int rv = 0;
switch (operation_) {
case kReadOperation:
- if (entry_->net_log().IsLoggingAllEvents()) {
- entry_->net_log().BeginEvent(
- net::NetLog::TYPE_SPARSE_CONTROL_READ,
- make_scoped_refptr(new net::NetLogSourceParameter(
- "source_dependency",
- child_->net_log().source())));
- }
rv = child_->ReadDataImpl(kSparseData, child_offset_, user_buf_,
child_len_, callback);
break;
case kWriteOperation:
- if (entry_->net_log().IsLoggingAllEvents()) {
- entry_->net_log().BeginEvent(
- net::NetLog::TYPE_SPARSE_CONTROL_WRITE,
- make_scoped_refptr(new net::NetLogSourceParameter(
- "source_dependency",
- child_->net_log().source())));
- }
rv = child_->WriteDataImpl(kSparseData, child_offset_, user_buf_,
child_len_, callback, false);
break;
case kGetRangeOperation:
- if (entry_->net_log().IsLoggingAllEvents()) {
- entry_->net_log().BeginEvent(net::NetLog::TYPE_SPARSE_CONTROL_GET_RANGE,
- NULL);
- }
rv = DoGetAvailableRange();
break;
default:
@@ -757,7 +712,6 @@
}
void SparseControl::DoChildIOCompleted(int result) {
- LogOperationEnd(entry_->net_log(), operation_, result);
if (result < 0) {
// We fail the whole operation if we encounter an error.
result_ = result;
@@ -783,8 +737,6 @@
// 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;
- entry_->net_log().AddEvent(net::NetLog::TYPE_CANCELLED, NULL);
- entry_->net_log().EndEvent(net::NetLog::TYPE_SPARSE_CONTROL, NULL);
DoUserCallback();
return DoAbortCallbacks();
}
« no previous file with comments | « net/disk_cache/entry_impl.cc ('k') | net/disk_cache/stress_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698