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 "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 entry_(NULL) { | 82 entry_(NULL) { |
83 } | 83 } |
84 | 84 |
85 DirectoryReader::~DirectoryReader() { | 85 DirectoryReader::~DirectoryReader() { |
86 } | 86 } |
87 | 87 |
88 const PPB_DirectoryReader_Dev* DirectoryReader::GetInterface() { | 88 const PPB_DirectoryReader_Dev* DirectoryReader::GetInterface() { |
89 return &ppb_directoryreader; | 89 return &ppb_directoryreader; |
90 } | 90 } |
91 | 91 |
| 92 DirectoryReader* DirectoryReader::AsDirectoryReader() { |
| 93 return this; |
| 94 } |
| 95 |
92 int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry_Dev* entry, | 96 int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry_Dev* entry, |
93 PP_CompletionCallback callback) { | 97 PP_CompletionCallback callback) { |
94 if (directory_ref_->GetFileSystemType() == PP_FILESYSTEMTYPE_EXTERNAL) | 98 if (directory_ref_->GetFileSystemType() == PP_FILESYSTEMTYPE_EXTERNAL) |
95 return PP_ERROR_FAILED; | 99 return PP_ERROR_FAILED; |
96 | 100 |
97 entry_ = entry; | 101 entry_ = entry; |
98 if (FillUpEntry()) { | 102 if (FillUpEntry()) { |
99 entry_ = NULL; | 103 entry_ = NULL; |
100 return PP_OK; | 104 return PP_OK; |
101 } | 105 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 151 |
148 if (!has_more_) { | 152 if (!has_more_) { |
149 entry_->file_ref = 0; | 153 entry_->file_ref = 0; |
150 return true; | 154 return true; |
151 } | 155 } |
152 | 156 |
153 return false; | 157 return false; |
154 } | 158 } |
155 | 159 |
156 } // namespace pepper | 160 } // namespace pepper |
OLD | NEW |