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 "webkit/glue/plugins/pepper_directory_reader.h" | 5 #include "webkit/glue/plugins/pepper_directory_reader.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/ppapi/c/pp_completion_callback.h" | 8 #include "third_party/ppapi/c/pp_completion_callback.h" |
9 #include "third_party/ppapi/c/pp_errors.h" | 9 #include "third_party/ppapi/c/pp_errors.h" |
10 #include "webkit/glue/plugins/pepper_file_ref.h" | 10 #include "webkit/glue/plugins/pepper_file_ref.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool IsDirectoryReader(PP_Resource resource) { | 28 bool IsDirectoryReader(PP_Resource resource) { |
29 return !!Resource::GetAs<DirectoryReader>(resource).get(); | 29 return !!Resource::GetAs<DirectoryReader>(resource).get(); |
30 } | 30 } |
31 | 31 |
32 int32_t GetNextEntry(PP_Resource reader_id, | 32 int32_t GetNextEntry(PP_Resource reader_id, |
33 PP_DirectoryEntry* entry, | 33 PP_DirectoryEntry* entry, |
34 PP_CompletionCallback callback) { | 34 PP_CompletionCallback callback) { |
35 scoped_refptr<DirectoryReader> reader( | 35 scoped_refptr<DirectoryReader> reader( |
36 Resource::GetAs<DirectoryReader>(reader_id)); | 36 Resource::GetAs<DirectoryReader>(reader_id)); |
37 if (!reader.get()) | 37 if (!reader.get()) |
38 return PP_Error_BadResource; | 38 return PP_ERROR_BADRESOURCE; |
39 | 39 |
40 return reader->GetNextEntry(entry, callback); | 40 return reader->GetNextEntry(entry, callback); |
41 } | 41 } |
42 | 42 |
43 const PPB_DirectoryReader ppb_directoryreader = { | 43 const PPB_DirectoryReader ppb_directoryreader = { |
44 &Create, | 44 &Create, |
45 &IsDirectoryReader, | 45 &IsDirectoryReader, |
46 &GetNextEntry | 46 &GetNextEntry |
47 }; | 47 }; |
48 | 48 |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 DirectoryReader::DirectoryReader(FileRef* directory_ref) | 51 DirectoryReader::DirectoryReader(FileRef* directory_ref) |
52 : Resource(directory_ref->module()), | 52 : Resource(directory_ref->module()), |
53 directory_ref_(directory_ref) { | 53 directory_ref_(directory_ref) { |
54 } | 54 } |
55 | 55 |
56 DirectoryReader::~DirectoryReader() { | 56 DirectoryReader::~DirectoryReader() { |
57 } | 57 } |
58 | 58 |
59 const PPB_DirectoryReader* DirectoryReader::GetInterface() { | 59 const PPB_DirectoryReader* DirectoryReader::GetInterface() { |
60 return &ppb_directoryreader; | 60 return &ppb_directoryreader; |
61 } | 61 } |
62 | 62 |
63 int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry* entry, | 63 int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry* entry, |
64 PP_CompletionCallback callback) { | 64 PP_CompletionCallback callback) { |
65 NOTIMPLEMENTED(); // TODO(darin): Implement me! | 65 NOTIMPLEMENTED(); // TODO(darin): Implement me! |
66 return PP_Error_Failed; | 66 return PP_ERROR_FAILED; |
67 } | 67 } |
68 | 68 |
69 } // namespace pepper | 69 } // namespace pepper |
OLD | NEW |