Only sync parent directory once after a leveldb file rename.
[chromium-blink-merge.git] / webkit / fileapi / file_system_task_runners.h
blobaabb9aba03295c98c64274303c15bf71306284e4
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_TASK_RUNNERS_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_TASK_RUNNERS_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "webkit/storage/webkit_storage_export.h"
12 namespace base {
13 class SequencedTaskRunner;
14 class SingleThreadTaskRunner;
15 } // namespace
17 namespace fileapi {
19 WEBKIT_STORAGE_EXPORT extern const char kMediaTaskRunnerName[];
21 // This class holds task runners used for filesystem related stuff.
22 class WEBKIT_STORAGE_EXPORT FileSystemTaskRunners {
23 public:
24 FileSystemTaskRunners(
25 base::SingleThreadTaskRunner* io_task_runner,
26 base::SingleThreadTaskRunner* file_task_runner,
27 base::SequencedTaskRunner* media_task_runner);
29 ~FileSystemTaskRunners();
31 static scoped_ptr<FileSystemTaskRunners> CreateMockTaskRunners();
33 base::SingleThreadTaskRunner* io_task_runner() {
34 return io_task_runner_.get();
37 base::SingleThreadTaskRunner* file_task_runner() {
38 return file_task_runner_.get();
41 base::SequencedTaskRunner* media_task_runner() {
42 return media_task_runner_.get();
45 private:
46 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
47 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
48 scoped_refptr<base::SequencedTaskRunner> media_task_runner_;
50 DISALLOW_COPY_AND_ASSIGN(FileSystemTaskRunners);
53 } // namespace fileapi
55 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_TASK_RUNNERS_H_