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

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

Issue 1062413002: Remove unnecessary instrumentation for several jank bugs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes Created 5 years, 8 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/cert/x509_certificate.cc ('k') | net/disk_cache/blockfile/in_flight_io.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/in_flight_backend_io.cc
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.cc b/net/disk_cache/blockfile/in_flight_backend_io.cc
index 5b3b90430390fa82e83b2b2b1be44b2a0e091e22..28d7114ba610313a76a4878a3d1460f2c1cacd64 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.cc
+++ b/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -8,7 +8,6 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
-#include "base/profiler/scoped_tracker.h"
#include "base/single_thread_task_runner.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/blockfile/backend_impl.h"
@@ -65,14 +64,8 @@ void BackendIO::OnDone(bool cancel) {
if (result() == net::OK) {
static_cast<EntryImpl*>(*entry_ptr_)->OnEntryCreated(backend_);
- if (cancel) {
- // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is
- // fixed.
- tracked_objects::ScopedTracker tracking_profile(
- FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 BackendIO::OnDone"));
-
+ if (cancel)
(*entry_ptr_)->Close();
- }
}
}
@@ -341,57 +334,35 @@ InFlightBackendIO::~InFlightBackendIO() {
}
void InFlightBackendIO::Init(const net::CompletionCallback& callback) {
- // TODO(vadimt): Remove wrapping the callback with
- // ScopedTracker::TrackCallback() once crbug.com/422516 is fixed.
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_,
- tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 InFlightBackendIO::Init"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->Init();
PostOperation(operation.get());
}
void InFlightBackendIO::OpenEntry(const std::string& key, Entry** entry,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::OpenEntry"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->OpenEntry(key, entry);
PostOperation(operation.get());
}
void InFlightBackendIO::CreateEntry(const std::string& key, Entry** entry,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::CreateEntry"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->CreateEntry(key, entry);
PostOperation(operation.get());
}
void InFlightBackendIO::DoomEntry(const std::string& key,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::DoomEntry"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->DoomEntry(key);
PostOperation(operation.get());
}
void InFlightBackendIO::DoomAllEntries(
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::DoomAllEntries"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->DoomAllEntries();
PostOperation(operation.get());
}
@@ -399,22 +370,14 @@ void InFlightBackendIO::DoomAllEntries(
void InFlightBackendIO::DoomEntriesBetween(const base::Time initial_time,
const base::Time end_time,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::DoomEntriesBetween"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->DoomEntriesBetween(initial_time, end_time);
PostOperation(operation.get());
}
void InFlightBackendIO::DoomEntriesSince(
const base::Time initial_time, const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::DoomEntriesSince"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->DoomEntriesSince(initial_time);
PostOperation(operation.get());
}
@@ -422,11 +385,7 @@ void InFlightBackendIO::DoomEntriesSince(
void InFlightBackendIO::OpenNextEntry(Rankings::Iterator* iterator,
Entry** next_entry,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::OpenNextEntry"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->OpenNextEntry(iterator, next_entry);
PostOperation(operation.get());
}
@@ -461,22 +420,14 @@ void InFlightBackendIO::DoomEntryImpl(EntryImpl* entry) {
}
void InFlightBackendIO::FlushQueue(const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::FlushQueue"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->FlushQueue();
PostOperation(operation.get());
}
void InFlightBackendIO::RunTask(
const base::Closure& task, const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_,
- tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 InFlightBackendIO::RunTask"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->RunTask(task);
PostOperation(operation.get());
}
@@ -484,11 +435,7 @@ void InFlightBackendIO::RunTask(
void InFlightBackendIO::ReadData(EntryImpl* entry, int index, int offset,
net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::ReadData"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->ReadData(entry, index, offset, buf, buf_len);
PostOperation(operation.get());
}
@@ -497,11 +444,7 @@ void InFlightBackendIO::WriteData(EntryImpl* entry, int index, int offset,
net::IOBuffer* buf, int buf_len,
bool truncate,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::WriteData"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->WriteData(entry, index, offset, buf, buf_len, truncate);
PostOperation(operation.get());
}
@@ -509,11 +452,7 @@ void InFlightBackendIO::WriteData(EntryImpl* entry, int index, int offset,
void InFlightBackendIO::ReadSparseData(
EntryImpl* entry, int64 offset, net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::ReadSparseData"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->ReadSparseData(entry, offset, buf, buf_len);
PostOperation(operation.get());
}
@@ -521,11 +460,7 @@ void InFlightBackendIO::ReadSparseData(
void InFlightBackendIO::WriteSparseData(
EntryImpl* entry, int64 offset, net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::WriteSparseData"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->WriteSparseData(entry, offset, buf, buf_len);
PostOperation(operation.get());
}
@@ -533,11 +468,7 @@ void InFlightBackendIO::WriteSparseData(
void InFlightBackendIO::GetAvailableRange(
EntryImpl* entry, int64 offset, int len, int64* start,
const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::GetAvailableRange"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->GetAvailableRange(entry, offset, len, start);
PostOperation(operation.get());
}
@@ -551,11 +482,7 @@ void InFlightBackendIO::CancelSparseIO(EntryImpl* entry) {
void InFlightBackendIO::ReadyForSparseIO(
EntryImpl* entry, const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(
- this, backend_, tracked_objects::ScopedTracker::TrackCallback(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::CancelSparseIO"),
- callback)));
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
operation->ReadyForSparseIO(entry);
PostOperation(operation.get());
}
@@ -569,14 +496,8 @@ void InFlightBackendIO::OnOperationComplete(BackgroundIO* operation,
BackendIO* op = static_cast<BackendIO*>(operation);
op->OnDone(cancel);
- if (!op->callback().is_null() && (!cancel || op->IsEntryOperation())) {
- // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
- tracked_objects::ScopedTracker tracking_profile(
- FROM_HERE_WITH_EXPLICIT_FUNCTION(
- "422516 InFlightBackendIO::OnOperationComplete"));
-
+ if (!op->callback().is_null() && (!cancel || op->IsEntryOperation()))
op->callback().Run(op->result());
- }
}
void InFlightBackendIO::PostOperation(BackendIO* operation) {
« no previous file with comments | « net/cert/x509_certificate.cc ('k') | net/disk_cache/blockfile/in_flight_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698