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

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

Issue 2657003003: Avoid unneeded refcount bump on disk_cache::File (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/file_posix.cc
diff --git a/net/disk_cache/blockfile/file_posix.cc b/net/disk_cache/blockfile/file_posix.cc
index 828200588a9b66ac7a9d2ec14e304cca6a354c54..1297cf07144d3910f0242802f544c79f438b0a79 100644
--- a/net/disk_cache/blockfile/file_posix.cc
+++ b/net/disk_cache/blockfile/file_posix.cc
@@ -97,7 +97,8 @@ bool File::Read(void* buffer, size_t buffer_len, size_t offset,
base::PostTaskAndReplyWithResult(
s_worker_pool.Pointer(), FROM_HERE,
- base::Bind(&File::DoRead, this, buffer, buffer_len, offset),
+ base::Bind(&File::DoRead, base::Unretained(this), buffer, buffer_len,
+ offset),
base::Bind(&File::OnOperationComplete, this, callback));
*completed = false;
@@ -120,7 +121,8 @@ bool File::Write(const void* buffer, size_t buffer_len, size_t offset,
base::PostTaskAndReplyWithResult(
s_worker_pool.Pointer(), FROM_HERE,
- base::Bind(&File::DoWrite, this, buffer, buffer_len, offset),
+ base::Bind(&File::DoWrite, base::Unretained(this), buffer, buffer_len,
+ offset),
base::Bind(&File::OnOperationComplete, this, callback));
*completed = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698