| 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 "webkit/plugins/ppapi/ppb_directory_reader_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 PP_Resource PPB_DirectoryReader_Impl::Create(PP_Resource directory_ref) { | 66 PP_Resource PPB_DirectoryReader_Impl::Create(PP_Resource directory_ref) { |
| 67 EnterResourceNoLock<PPB_FileRef_API> enter(directory_ref, true); | 67 EnterResourceNoLock<PPB_FileRef_API> enter(directory_ref, true); |
| 68 if (enter.failed()) | 68 if (enter.failed()) |
| 69 return 0; | 69 return 0; |
| 70 | 70 |
| 71 PPB_DirectoryReader_Impl* reader = new PPB_DirectoryReader_Impl( | 71 PPB_DirectoryReader_Impl* reader = new PPB_DirectoryReader_Impl( |
| 72 static_cast<PPB_FileRef_Impl*>(enter.object())); | 72 static_cast<PPB_FileRef_Impl*>(enter.object())); |
| 73 return reader->GetReference(); | 73 return reader->GetReference(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 PPB_DirectoryReader_Impl* | |
| 77 PPB_DirectoryReader_Impl::AsPPB_DirectoryReader_Impl() { | |
| 78 return this; | |
| 79 } | |
| 80 | |
| 81 PPB_DirectoryReader_API* PPB_DirectoryReader_Impl::AsPPB_DirectoryReader_API() { | 76 PPB_DirectoryReader_API* PPB_DirectoryReader_Impl::AsPPB_DirectoryReader_API() { |
| 82 return this; | 77 return this; |
| 83 } | 78 } |
| 84 | 79 |
| 85 int32_t PPB_DirectoryReader_Impl::GetNextEntry( | 80 int32_t PPB_DirectoryReader_Impl::GetNextEntry( |
| 86 PP_DirectoryEntry_Dev* entry, | 81 PP_DirectoryEntry_Dev* entry, |
| 87 PP_CompletionCallback callback) { | 82 PP_CompletionCallback callback) { |
| 88 if (directory_ref_->GetFileSystemType() == PP_FILESYSTEMTYPE_EXTERNAL) | 83 if (directory_ref_->GetFileSystemType() == PP_FILESYSTEMTYPE_EXTERNAL) |
| 89 return PP_ERROR_FAILED; | 84 return PP_ERROR_FAILED; |
| 90 | 85 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if (!has_more_) { | 141 if (!has_more_) { |
| 147 entry_->file_ref = 0; | 142 entry_->file_ref = 0; |
| 148 return true; | 143 return true; |
| 149 } | 144 } |
| 150 | 145 |
| 151 return false; | 146 return false; |
| 152 } | 147 } |
| 153 | 148 |
| 154 } // namespace ppapi | 149 } // namespace ppapi |
| 155 } // namespace webkit | 150 } // namespace webkit |
| OLD | NEW |