OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/directory_reader_dev.h" | 5 #include "ppapi/cpp/directory_reader.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/directory_entry_dev.h" | 9 #include "ppapi/cpp/directory_entry.h" |
10 #include "ppapi/cpp/file_ref.h" | 10 #include "ppapi/cpp/file_ref.h" |
11 #include "ppapi/cpp/module.h" | 11 #include "ppapi/cpp/module.h" |
12 #include "ppapi/cpp/module_impl.h" | 12 #include "ppapi/cpp/module_impl.h" |
13 | 13 |
14 namespace pp { | 14 namespace pp { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 template <> const char* interface_name<PPB_DirectoryReader_Dev_0_6>() { | 18 template <> const char* interface_name<PPB_DirectoryReader_1_0>() { |
19 return PPB_DIRECTORYREADER_DEV_INTERFACE_0_6; | 19 return PPB_DIRECTORYREADER_INTERFACE_1_0; |
20 } | 20 } |
21 | 21 |
22 } // namespace | 22 } // namespace |
23 | 23 |
24 DirectoryReader_Dev::DirectoryReader_Dev(const FileRef& directory_ref) { | 24 DirectoryReader::DirectoryReader(const FileRef& directory_ref) { |
25 if (!has_interface<PPB_DirectoryReader_Dev_0_6>()) | 25 if (!has_interface<PPB_DirectoryReader_1_0>()) |
26 return; | 26 return; |
27 PassRefFromConstructor(get_interface<PPB_DirectoryReader_Dev_0_6>()->Create( | 27 PassRefFromConstructor(get_interface<PPB_DirectoryReader_1_0>()->Create( |
28 directory_ref.pp_resource())); | 28 directory_ref.pp_resource())); |
29 } | 29 } |
30 | 30 |
31 DirectoryReader_Dev::DirectoryReader_Dev(const DirectoryReader_Dev& other) | 31 DirectoryReader::DirectoryReader(const DirectoryReader& other) |
32 : Resource(other) { | 32 : Resource(other) { |
33 } | 33 } |
34 | 34 |
35 int32_t DirectoryReader_Dev::ReadEntries( | 35 int32_t DirectoryReader::ReadEntries( |
36 const CompletionCallbackWithOutput< std::vector<DirectoryEntry_Dev> >& | 36 const CompletionCallbackWithOutput< std::vector<DirectoryEntry> >& |
37 callback) { | 37 callback) { |
38 if (!has_interface<PPB_DirectoryReader_Dev_0_6>()) | 38 if (!has_interface<PPB_DirectoryReader_1_0>()) |
39 return callback.MayForce(PP_ERROR_NOINTERFACE); | 39 return callback.MayForce(PP_ERROR_NOINTERFACE); |
40 return get_interface<PPB_DirectoryReader_Dev_0_6>()->ReadEntries( | 40 return get_interface<PPB_DirectoryReader_1_0>()->ReadEntries( |
41 pp_resource(), callback.output(), callback.pp_completion_callback()); | 41 pp_resource(), callback.output(), callback.pp_completion_callback()); |
42 } | 42 } |
43 | 43 |
44 } // namespace pp | 44 } // namespace pp |
OLD | NEW |