OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 #ifndef LIBRARIES_NACL_IO_MOUNT_HTML5FS_H_ | 5 #ifndef LIBRARIES_NACL_IO_MOUNT_HTML5FS_H_ |
6 #define LIBRARIES_NACL_IO_MOUNT_HTML5FS_H_ | 6 #define LIBRARIES_NACL_IO_MOUNT_HTML5FS_H_ |
7 | 7 |
8 #include <pthread.h> | 8 #include <pthread.h> |
9 #include "nacl_io/mount.h" | 9 #include "nacl_io/mount.h" |
10 #include "nacl_io/pepper_interface.h" | 10 #include "nacl_io/pepper_interface.h" |
11 | 11 |
12 class MountNode; | 12 class MountNode; |
13 | 13 |
14 class MountHtml5Fs : public Mount { | 14 class MountHtml5Fs : public Mount { |
15 public: | 15 public: |
| 16 virtual Error Access(const Path& path, int a_mode); |
16 virtual Error Open(const Path& path, int mode, MountNode** out_node); | 17 virtual Error Open(const Path& path, int mode, MountNode** out_node); |
17 virtual Error Unlink(const Path& path); | 18 virtual Error Unlink(const Path& path); |
18 virtual Error Mkdir(const Path& path, int permissions); | 19 virtual Error Mkdir(const Path& path, int permissions); |
19 virtual Error Rmdir(const Path& path); | 20 virtual Error Rmdir(const Path& path); |
20 virtual Error Remove(const Path& path); | 21 virtual Error Remove(const Path& path); |
21 | 22 |
22 PP_Resource filesystem_resource() { return filesystem_resource_; } | 23 PP_Resource filesystem_resource() { return filesystem_resource_; } |
23 | 24 |
24 protected: | 25 protected: |
25 MountHtml5Fs(); | 26 MountHtml5Fs(); |
26 | 27 |
27 virtual Error Init(int dev, StringMap_t& args, PepperInterface* ppapi); | 28 virtual Error Init(int dev, StringMap_t& args, PepperInterface* ppapi); |
28 virtual void Destroy(); | 29 virtual void Destroy(); |
29 | 30 |
30 Error BlockUntilFilesystemOpen(); | 31 Error BlockUntilFilesystemOpen(); |
31 | 32 |
32 private: | 33 private: |
33 static void FilesystemOpenCallbackThunk(void* user_data, int32_t result); | 34 static void FilesystemOpenCallbackThunk(void* user_data, int32_t result); |
34 void FilesystemOpenCallback(int32_t result); | 35 void FilesystemOpenCallback(int32_t result); |
35 | 36 |
36 PP_Resource filesystem_resource_; | 37 PP_Resource filesystem_resource_; |
37 bool filesystem_open_has_result_; // protected by lock_. | 38 bool filesystem_open_has_result_; // protected by lock_. |
38 Error filesystem_open_error_; // protected by lock_. | 39 Error filesystem_open_error_; // protected by lock_. |
39 pthread_cond_t filesystem_open_cond_; | 40 pthread_cond_t filesystem_open_cond_; |
40 | 41 |
41 friend class Mount; | 42 friend class Mount; |
42 }; | 43 }; |
43 | 44 |
44 #endif // LIBRARIES_NACL_IO_MOUNT_HTML5FS_H_ | 45 #endif // LIBRARIES_NACL_IO_MOUNT_HTML5FS_H_ |
OLD | NEW |