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 PPAPI_CPP_FILE_SYSTEM_H_ | 5 #ifndef PPAPI_CPP_FILE_SYSTEM_H_ |
6 #define PPAPI_CPP_FILE_SYSTEM_H_ | 6 #define PPAPI_CPP_FILE_SYSTEM_H_ |
7 | 7 |
8 #include "ppapi/c/pp_file_info.h" | 8 #include "ppapi/c/pp_file_info.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 /// The <code>FileSystem</code> class identifies the file system type | 22 /// The <code>FileSystem</code> class identifies the file system type |
23 /// associated with a file. | 23 /// associated with a file. |
24 class FileSystem : public Resource { | 24 class FileSystem : public Resource { |
25 public: | 25 public: |
26 /// Constructs an is_null() filesystem resource. If you use this constructor, | 26 /// Constructs an is_null() filesystem resource. If you use this constructor, |
27 /// you will have to assign it to a "real" FileSystem object before you can | 27 /// you will have to assign it to a "real" FileSystem object before you can |
28 /// use it. | 28 /// use it. |
29 FileSystem(); | 29 FileSystem(); |
30 | 30 |
| 31 /// A constructor used when you have received a PP_Resource as a return |
| 32 /// value that has already been reference counted. |
| 33 /// |
| 34 /// @param[in] resource A PP_Resource corresponding to a PPB_FileSystem. |
| 35 FileSystem(PassRef, PP_Resource resource); |
| 36 |
31 /// This constructor creates a file system object of the given type. | 37 /// This constructor creates a file system object of the given type. |
32 /// | 38 /// |
33 /// @param[in] instance The instance with which this resource will be | 39 /// @param[in] instance The instance with which this resource will be |
34 /// associated. | 40 /// associated. |
35 /// | 41 /// |
36 /// @param[in] type A file system type as defined by | 42 /// @param[in] type A file system type as defined by |
37 /// <code>PP_FileSystemType</code> enum. | 43 /// <code>PP_FileSystemType</code> enum. |
38 FileSystem(const InstanceHandle& instance, PP_FileSystemType type); | 44 FileSystem(const InstanceHandle& instance, PP_FileSystemType type); |
39 | 45 |
40 /// Open() opens the file system. A file system must be opened before running | 46 /// Open() opens the file system. A file system must be opened before running |
41 /// any other operation on it. | 47 /// any other operation on it. |
42 /// | 48 /// |
43 /// @param[in] expected_size The expected size of the file system. Note that | 49 /// @param[in] expected_size The expected size of the file system. Note that |
44 /// this does not request quota; to do that, you must either invoke | 50 /// this does not request quota; to do that, you must either invoke |
45 /// requestQuota from JavaScript: | 51 /// requestQuota from JavaScript: |
46 /// http://www.html5rocks.com/en/tutorials/file/filesystem/#toc-requesting-quo
ta | 52 /// http://www.html5rocks.com/en/tutorials/file/filesystem/#toc-requesting-quo
ta |
47 /// or set the unlimitedStorage permission for Chrome Web Store apps: | 53 /// or set the unlimitedStorage permission for Chrome Web Store apps: |
48 /// http://code.google.com/chrome/extensions/manifest.html#permissions | 54 /// http://code.google.com/chrome/extensions/manifest.html#permissions |
49 /// | 55 /// |
50 /// @param[in] cc A <code>PP_CompletionCallback</code> to be called upon | 56 /// @param[in] cc A <code>PP_CompletionCallback</code> to be called upon |
51 /// completion of Open(). | 57 /// completion of Open(). |
52 /// | 58 /// |
53 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 59 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
54 int32_t Open(int64_t expected_size, const CompletionCallback& cc); | 60 int32_t Open(int64_t expected_size, const CompletionCallback& cc); |
55 }; | 61 }; |
56 | 62 |
57 } // namespace pp | 63 } // namespace pp |
58 | 64 |
59 #endif // PPAPI_CPP_FILE_SYSTEM_H_ | 65 #endif // PPAPI_CPP_FILE_SYSTEM_H_ |
OLD | NEW |