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 11 matching lines...) Expand all Loading... |
22 namespace { | 22 namespace { |
23 | 23 |
24 #if defined(WIN32) | 24 #if defined(WIN32) |
25 int64_t strtoull(const char* nptr, char** endptr, int base) { | 25 int64_t strtoull(const char* nptr, char** endptr, int base) { |
26 return _strtoui64(nptr, endptr, base); | 26 return _strtoui64(nptr, endptr, base); |
27 } | 27 } |
28 #endif | 28 #endif |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 Error Html5Fs::Open(const Path& path, int open_flags, ScopedNode* out_node) { | 32 Error Html5Fs::OpenWithMode(const Path& path, int open_flags, mode_t mode, |
| 33 ScopedNode* out_node) { |
33 out_node->reset(NULL); | 34 out_node->reset(NULL); |
34 Error error = BlockUntilFilesystemOpen(); | 35 Error error = BlockUntilFilesystemOpen(); |
35 if (error) | 36 if (error) |
36 return error; | 37 return error; |
37 | 38 |
38 PP_Resource fileref = file_ref_iface_->Create( | 39 PP_Resource fileref = file_ref_iface_->Create( |
39 filesystem_resource_, GetFullPath(path).Join().c_str()); | 40 filesystem_resource_, GetFullPath(path).Join().c_str()); |
40 if (!fileref) | 41 if (!fileref) |
41 return ENOENT; | 42 return ENOENT; |
42 | 43 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 292 } |
292 | 293 |
293 void Html5Fs::FilesystemOpenCallback(int32_t result) { | 294 void Html5Fs::FilesystemOpenCallback(int32_t result) { |
294 AUTO_LOCK(filesysem_open_lock_); | 295 AUTO_LOCK(filesysem_open_lock_); |
295 filesystem_open_has_result_ = true; | 296 filesystem_open_has_result_ = true; |
296 filesystem_open_error_ = PPErrorToErrno(result); | 297 filesystem_open_error_ = PPErrorToErrno(result); |
297 pthread_cond_signal(&filesystem_open_cond_); | 298 pthread_cond_signal(&filesystem_open_cond_); |
298 } | 299 } |
299 | 300 |
300 } // namespace nacl_io | 301 } // namespace nacl_io |
OLD | NEW |