|
19 | 19 | #include "app/src/future_manager.h"
|
20 | 20 | #include "app/src/include/firebase/internal/platform.h"
|
21 | 21 |
|
22 |
| -// Platform-specific ListResultInternal definition. |
23 |
| -#if FIREBASE_PLATFORM_ANDROID |
24 |
| -#include "storage/src/android/list_result_android.h" |
25 |
| -#elif FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS |
26 |
| -#include "storage/src/ios/list_result_ios.h" |
27 |
| -#else // Desktop |
28 |
| -#include "storage/src/desktop/list_result_desktop.h" |
29 |
| -#endif |
| 22 | +// Platform-specific ListResultInternal definition is no longer needed here. |
| 23 | +// #if FIREBASE_PLATFORM_ANDROID |
| 24 | +// #include "storage/src/android/list_result_android.h" |
| 25 | +// #elif FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS |
| 26 | +// #include "storage/src/ios/list_result_ios.h" |
| 27 | +// #else // Desktop |
| 28 | +// #include "storage/src/desktop/list_result_desktop.h" |
| 29 | +// #endif |
30 | 30 |
|
31 | 31 | #ifdef __APPLE__
|
32 | 32 | #include "TargetConditionals.h"
|
33 | 33 | // Platform-specific StorageReferenceInternal is included below.
|
34 | 34 | #endif // __APPLE__
|
35 | 35 |
|
36 |
| -// Platform-specific StorageReferenceInternal implementations. |
| 36 | +// StorageReference is defined in these 3 files, one implementation for each OS. |
37 | 37 | #if defined(__ANDROID__)
|
38 | 38 | #include "storage/src/android/storage_android.h"
|
39 | 39 | #include "storage/src/android/storage_reference_android.h"
|
@@ -266,31 +266,13 @@ Future<ListResult> StorageReference::ListAll() {
|
266 | 266 | ReferenceCountedFutureImpl* ref_future =
|
267 | 267 | internal_->future_manager().Alloc<ListResult>(
|
268 | 268 | internal::kStorageReferenceFnCount);
|
269 |
| - Future<ListResult> future = MakeFuture(ref_future); |
270 |
| - |
271 |
| - internal::ListResultInternal* list_pimpl = |
272 |
| - new internal::ListResultInternal(this->internal_, nullptr); |
273 |
| - ListResult result_to_complete(list_pimpl); |
274 |
| - |
275 |
| - ref_future->Complete(this->AsHandle(), kErrorNone, /* error_msg= */ "", result_to_complete); |
276 |
| - return future; |
| 269 | + FIREBASE_ASSERT_RETURN(Future<ListResult>(), internal_->is_valid()); |
| 270 | + return internal_->ListAll(); |
277 | 271 | }
|
278 | 272 |
|
279 | 273 | Future<ListResult> StorageReference::List(const char* page_token) {
|
280 | 274 | FIREBASE_ASSERT_RETURN(Future<ListResult>(), internal_->is_valid());
|
281 |
| - ReferenceCountedFutureImpl* ref_future = |
282 |
| - internal_->future_manager().Alloc<ListResult>( |
283 |
| - internal::kStorageReferenceFnCount); |
284 |
| - Future<ListResult> future = MakeFuture(ref_future); |
285 |
| - |
286 |
| - // page_token is currently ignored in the stub. |
287 |
| - |
288 |
| - internal::ListResultInternal* list_pimpl = |
289 |
| - new internal::ListResultInternal(this->internal_, nullptr); |
290 |
| - ListResult result_to_complete(list_pimpl); |
291 |
| - |
292 |
| - ref_future->Complete(this->AsHandle(), kErrorNone, /* error_msg= */ "", result_to_complete); |
293 |
| - return future; |
| 275 | + return internal_->List(page_token); |
294 | 276 | }
|
295 | 277 |
|
296 | 278 | Future<ListResult> StorageReference::List() {
|
|
0 commit comments