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

Unified Diff: base/files/file_proxy.h

Issue 231703002: Base: Make FileProxy automaticaly close the file on a worker thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: base/files/file_proxy.h
diff --git a/base/files/file_proxy.h b/base/files/file_proxy.h
index f02960b8580889ff83d9ba320ee435322b4951f1..3c834f673eac90570c6be71095768ca8f90fdebf 100644
--- a/base/files/file_proxy.h
+++ b/base/files/file_proxy.h
@@ -25,11 +25,8 @@ class Time;
// same rules of the equivalent File method, as they are implemented by bouncing
// the operation to File using a TaskRunner.
//
-// This class does NOT perform automatic proxying to close the underlying file
-// at destruction, which means that it may potentially close the file in the
-// wrong thread (the current thread). If that is not appropriate, the caller
-// must ensure that Close() is called, so that the operation happens on the
-// desired thread.
+// This class performs automatic proxying to close the underlying file at
+// destruction.
//
// The TaskRunner is in charge of any sequencing of the operations, but a single
// operation can be proxied at a time, regardless of the use of a callback.
@@ -131,6 +128,7 @@ class BASE_EXPORT FileProxy : public SupportsWeakPtr<FileProxy> {
private:
friend class FileHelper;
void SetFile(File file);
+ TaskRunner* task_runner() { return task_runner_.get(); }
willchan no longer on Chromium 2014/04/10 20:27:47 I don't really care, but why not just access the t
rvargas (doing something else) 2014/04/10 22:03:51 I think it's a little cleaner if friends' access g
scoped_refptr<TaskRunner> task_runner_;
File file_;
« no previous file with comments | « base/files/file.cc ('k') | base/files/file_proxy.cc » ('j') | base/files/file_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698