| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_TASK_RUNNERS_H_ | |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_TASK_RUNNERS_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "webkit/storage/webkit_storage_export.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class SequencedTaskRunner; | |
| 14 class SingleThreadTaskRunner; | |
| 15 } // namespace | |
| 16 | |
| 17 namespace fileapi { | |
| 18 | |
| 19 WEBKIT_STORAGE_EXPORT extern const char kMediaTaskRunnerName[]; | |
| 20 | |
| 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); | |
| 28 | |
| 29 ~FileSystemTaskRunners(); | |
| 30 | |
| 31 static scoped_ptr<FileSystemTaskRunners> CreateMockTaskRunners(); | |
| 32 | |
| 33 base::SingleThreadTaskRunner* io_task_runner() { | |
| 34 return io_task_runner_.get(); | |
| 35 } | |
| 36 | |
| 37 base::SingleThreadTaskRunner* file_task_runner() { | |
| 38 return file_task_runner_.get(); | |
| 39 } | |
| 40 | |
| 41 base::SequencedTaskRunner* media_task_runner() { | |
| 42 return media_task_runner_.get(); | |
| 43 } | |
| 44 | |
| 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_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(FileSystemTaskRunners); | |
| 51 }; | |
| 52 | |
| 53 } // namespace fileapi | |
| 54 | |
| 55 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_TASK_RUNNERS_H_ | |
| OLD | NEW |