Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_HTML5FS_HTML5_FS_H_ | 5 #ifndef LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_H_ |
| 6 #define LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_H_ | 6 #define LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_H_ |
| 7 | 7 |
| 8 #include <pthread.h> | 8 #include <pthread.h> |
| 9 | 9 |
| 10 #include "nacl_io/filesystem.h" | 10 #include "nacl_io/filesystem.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 virtual Error Open(const Path& path, int mode, ScopedNode* out_node); | 22 virtual Error Open(const Path& path, int mode, ScopedNode* out_node); |
| 23 virtual Error Unlink(const Path& path); | 23 virtual Error Unlink(const Path& path); |
| 24 virtual Error Mkdir(const Path& path, int permissions); | 24 virtual Error Mkdir(const Path& path, int permissions); |
| 25 virtual Error Rmdir(const Path& path); | 25 virtual Error Rmdir(const Path& path); |
| 26 virtual Error Remove(const Path& path); | 26 virtual Error Remove(const Path& path); |
| 27 virtual Error Rename(const Path& path, const Path& newpath); | 27 virtual Error Rename(const Path& path, const Path& newpath); |
| 28 | 28 |
| 29 PP_Resource filesystem_resource() { return filesystem_resource_; } | 29 PP_Resource filesystem_resource() { return filesystem_resource_; } |
| 30 | 30 |
| 31 protected: | 31 protected: |
| 32 static const int REMOVE_DIR = 1; | |
| 33 static const int REMOVE_FILE = 2; | |
| 34 static const int REMOVE_ALL = REMOVE_DIR | REMOVE_FILE; | |
| 35 | |
| 32 Html5Fs(); | 36 Html5Fs(); |
| 33 | 37 |
| 34 virtual Error Init(const FsInitArgs& args); | 38 virtual Error Init(const FsInitArgs& args); |
| 35 virtual void Destroy(); | 39 virtual void Destroy(); |
| 36 | 40 |
| 41 virtual Error RemoveInternal(const Path& path, int remove_type); | |
|
binji
2014/06/09 20:54:29
does this need to be virtual?
| |
| 37 Error BlockUntilFilesystemOpen(); | 42 Error BlockUntilFilesystemOpen(); |
| 38 | 43 |
| 39 private: | 44 private: |
| 40 static void FilesystemOpenCallbackThunk(void* user_data, int32_t result); | 45 static void FilesystemOpenCallbackThunk(void* user_data, int32_t result); |
| 41 void FilesystemOpenCallback(int32_t result); | 46 void FilesystemOpenCallback(int32_t result); |
| 47 Path GetFullPath(const Path& path); | |
| 42 | 48 |
| 43 PP_Resource filesystem_resource_; | 49 PP_Resource filesystem_resource_; |
| 44 bool filesystem_open_has_result_; // protected by lock_. | 50 bool filesystem_open_has_result_; // protected by lock_. |
| 45 Error filesystem_open_error_; // protected by lock_. | 51 Error filesystem_open_error_; // protected by lock_. |
| 46 | 52 |
| 47 pthread_cond_t filesystem_open_cond_; | 53 pthread_cond_t filesystem_open_cond_; |
| 48 sdk_util::SimpleLock filesysem_open_lock_; | 54 sdk_util::SimpleLock filesysem_open_lock_; |
| 55 std::string prefix_; | |
| 49 | 56 |
| 50 friend class TypedFsFactory<Html5Fs>; | 57 friend class TypedFsFactory<Html5Fs>; |
| 51 }; | 58 }; |
| 52 | 59 |
| 53 } // namespace nacl_io | 60 } // namespace nacl_io |
| 54 | 61 |
| 55 #endif // LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_H_ | 62 #endif // LIBRARIES_NACL_IO_HTML5FS_HTML5_FS_H_ |
| OLD | NEW |