OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "ppapi/cpp/dev/file_ref_dev.h" | 5 #include "ppapi/cpp/dev/file_ref_dev.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/cpp/completion_callback.h" | 8 #include "ppapi/cpp/completion_callback.h" |
9 #include "ppapi/cpp/dev/file_system_dev.h" | 9 #include "ppapi/cpp/dev/file_system_dev.h" |
10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 int32_t FileRef_Dev::MakeDirectoryIncludingAncestors( | 79 int32_t FileRef_Dev::MakeDirectoryIncludingAncestors( |
80 const CompletionCallback& cc) { | 80 const CompletionCallback& cc) { |
81 if (!has_interface<PPB_FileRef_Dev>()) | 81 if (!has_interface<PPB_FileRef_Dev>()) |
82 return PP_ERROR_NOINTERFACE; | 82 return PP_ERROR_NOINTERFACE; |
83 return get_interface<PPB_FileRef_Dev>()->MakeDirectory( | 83 return get_interface<PPB_FileRef_Dev>()->MakeDirectory( |
84 pp_resource(), | 84 pp_resource(), |
85 PP_TRUE, // make_ancestors | 85 PP_TRUE, // make_ancestors |
86 cc.pp_completion_callback()); | 86 cc.pp_completion_callback()); |
87 } | 87 } |
88 | 88 |
89 int32_t FileRef_Dev::Query(PP_FileInfo_Dev* result_buf, | |
90 const CompletionCallback& cc) { | |
91 if (!has_interface<PPB_FileRef_Dev>()) | |
92 return PP_ERROR_NOINTERFACE; | |
93 return get_interface<PPB_FileRef_Dev>()->Query( | |
94 pp_resource(), result_buf, cc.pp_completion_callback()); | |
95 } | |
96 | |
97 int32_t FileRef_Dev::Touch(PP_Time last_access_time, | 89 int32_t FileRef_Dev::Touch(PP_Time last_access_time, |
98 PP_Time last_modified_time, | 90 PP_Time last_modified_time, |
99 const CompletionCallback& cc) { | 91 const CompletionCallback& cc) { |
100 if (!has_interface<PPB_FileRef_Dev>()) | 92 if (!has_interface<PPB_FileRef_Dev>()) |
101 return PP_ERROR_NOINTERFACE; | 93 return PP_ERROR_NOINTERFACE; |
102 return get_interface<PPB_FileRef_Dev>()->Touch( | 94 return get_interface<PPB_FileRef_Dev>()->Touch( |
103 pp_resource(), last_access_time, last_modified_time, | 95 pp_resource(), last_access_time, last_modified_time, |
104 cc.pp_completion_callback()); | 96 cc.pp_completion_callback()); |
105 } | 97 } |
106 | 98 |
107 int32_t FileRef_Dev::Delete(const CompletionCallback& cc) { | 99 int32_t FileRef_Dev::Delete(const CompletionCallback& cc) { |
108 if (!has_interface<PPB_FileRef_Dev>()) | 100 if (!has_interface<PPB_FileRef_Dev>()) |
109 return PP_ERROR_NOINTERFACE; | 101 return PP_ERROR_NOINTERFACE; |
110 return get_interface<PPB_FileRef_Dev>()->Delete( | 102 return get_interface<PPB_FileRef_Dev>()->Delete( |
111 pp_resource(), cc.pp_completion_callback()); | 103 pp_resource(), cc.pp_completion_callback()); |
112 } | 104 } |
113 | 105 |
114 int32_t FileRef_Dev::Rename(const FileRef_Dev& new_file_ref, | 106 int32_t FileRef_Dev::Rename(const FileRef_Dev& new_file_ref, |
115 const CompletionCallback& cc) { | 107 const CompletionCallback& cc) { |
116 if (!has_interface<PPB_FileRef_Dev>()) | 108 if (!has_interface<PPB_FileRef_Dev>()) |
117 return PP_ERROR_NOINTERFACE; | 109 return PP_ERROR_NOINTERFACE; |
118 return get_interface<PPB_FileRef_Dev>()->Rename( | 110 return get_interface<PPB_FileRef_Dev>()->Rename( |
119 pp_resource(), new_file_ref.pp_resource(), cc.pp_completion_callback()); | 111 pp_resource(), new_file_ref.pp_resource(), cc.pp_completion_callback()); |
120 } | 112 } |
121 | 113 |
122 } // namespace pp | 114 } // namespace pp |
OLD | NEW |