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"
13 class SequencedTaskRunner
;
14 class SingleThreadTaskRunner
;
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
{
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();
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_