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 #include "nacl_io/html5fs/html5_fs.h" | 5 #include "nacl_io/html5fs/html5_fs.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 return EEXIST; | 68 return EEXIST; |
69 | 69 |
70 ScopedResource fileref_resource( | 70 ScopedResource fileref_resource( |
71 ppapi(), | 71 ppapi(), |
72 ppapi()->GetFileRefInterface()->Create(filesystem_resource_, | 72 ppapi()->GetFileRefInterface()->Create(filesystem_resource_, |
73 path.Join().c_str())); | 73 path.Join().c_str())); |
74 if (!fileref_resource.pp_resource()) | 74 if (!fileref_resource.pp_resource()) |
75 return ENOENT; | 75 return ENOENT; |
76 | 76 |
77 int32_t result = ppapi()->GetFileRefInterface()->MakeDirectory( | 77 int32_t result = ppapi()->GetFileRefInterface()->MakeDirectory( |
78 fileref_resource.pp_resource(), PP_FALSE, PP_BlockUntilComplete()); | 78 fileref_resource.pp_resource(), PP_MAKEDIRECTORYFLAG_NONE, |
| 79 PP_BlockUntilComplete()); |
79 if (result != PP_OK) | 80 if (result != PP_OK) |
80 return PPErrorToErrno(result); | 81 return PPErrorToErrno(result); |
81 | 82 |
82 return 0; | 83 return 0; |
83 } | 84 } |
84 | 85 |
85 Error Html5Fs::Rmdir(const Path& path) { return Remove(path); } | 86 Error Html5Fs::Rmdir(const Path& path) { return Remove(path); } |
86 | 87 |
87 Error Html5Fs::Remove(const Path& path) { | 88 Error Html5Fs::Remove(const Path& path) { |
88 Error error = BlockUntilFilesystemOpen(); | 89 Error error = BlockUntilFilesystemOpen(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 202 } |
202 | 203 |
203 void Html5Fs::FilesystemOpenCallback(int32_t result) { | 204 void Html5Fs::FilesystemOpenCallback(int32_t result) { |
204 AUTO_LOCK(filesysem_open_lock_); | 205 AUTO_LOCK(filesysem_open_lock_); |
205 filesystem_open_has_result_ = true; | 206 filesystem_open_has_result_ = true; |
206 filesystem_open_error_ = PPErrorToErrno(result); | 207 filesystem_open_error_ = PPErrorToErrno(result); |
207 pthread_cond_signal(&filesystem_open_cond_); | 208 pthread_cond_signal(&filesystem_open_cond_); |
208 } | 209 } |
209 | 210 |
210 } // namespace nacl_io | 211 } // namespace nacl_io |
OLD | NEW |