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

Unified Diff: webkit/fileapi/file_system_context.h

Issue 10197007: Change webkit/{fileapi,quota} code to use TaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixesz Created 8 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: webkit/fileapi/file_system_context.h
diff --git a/webkit/fileapi/file_system_context.h b/webkit/fileapi/file_system_context.h
index d72a3ca745fdef0a1e2b6d2d962bbeca866482a3..59a5a4b7b1adfe6f00c6537eeecad122e1f797da 100644
--- a/webkit/fileapi/file_system_context.h
+++ b/webkit/fileapi/file_system_context.h
@@ -18,7 +18,8 @@ class FilePath;
class GURL;
namespace base {
-class MessageLoopProxy;
+class SingleThreadTaskRunner;
+class SequencedTaskRunner;
michaeln 2012/04/27 22:31:08 nit(picky-nit): alpha ordering
kinuko 2012/05/04 19:05:35 Done.
}
namespace quota {
@@ -49,10 +50,15 @@ class FileSystemContext
: public base::RefCountedThreadSafe<FileSystemContext,
DefaultContextDeleter> {
public:
+ // |file_task_runner| is used for all file operations and file related
+ // meta operations.
+ // The code assumes that file_task_runner->RunsTasksOnCurrentThread() returns
+ // false if the current task is not running on the thread that allows
michaeln 2012/04/27 22:31:08 fyi: the semantics/implemetation of RunsTasksOnCur
kinuko 2012/05/04 19:05:35 Yes, I had read this comment and how they are impl
+ // blocking file operations (like SequencedWorkerPool implementation does).
FileSystemContext(
- scoped_refptr<base::MessageLoopProxy> file_message_loop,
- scoped_refptr<base::MessageLoopProxy> io_message_loop,
- scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy,
+ base::SequencedTaskRunner* file_task_runner,
+ base::SingleThreadTaskRunner* io_task_runner,
+ quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy,
const FilePath& profile_path,
const FileSystemOptions& options);
@@ -114,9 +120,7 @@ class FileSystemContext
// and calling the provider's corresponding CreateFileSystemOperation method.
// The resolved MountPointProvider could perform further specialization
// depending on the filesystem type pointed by the |url|.
- FileSystemOperationInterface* CreateFileSystemOperation(
- const GURL& url,
- base::MessageLoopProxy* file_proxy);
+ FileSystemOperationInterface* CreateFileSystemOperation(const GURL& url);
// Creates new FileReader instance to read a file pointed by the given
// filesystem URL |url| starting from |offset|.
@@ -126,15 +130,14 @@ class FileSystemContext
// depending on the filesystem type pointed by the |url|.
webkit_blob::FileReader* CreateFileReader(
const GURL& url,
- int64 offset,
- base::MessageLoopProxy* file_proxy);
+ int64 offset);
private:
friend struct DefaultContextDeleter;
void DeleteOnCorrectThread() const;
- scoped_refptr<base::MessageLoopProxy> file_message_loop_;
- scoped_refptr<base::MessageLoopProxy> io_message_loop_;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;

Powered by Google App Engine
This is Rietveld 408576698