Skip to content

Commit 3e4e046

Browse files
refactor: Correct StorageInternal includes and finalize feedback
Corrects include directives for platform-specific StorageInternal definitions in list_result_android.h, list_result_ios.h, and list_result_desktop.h. Removes includes for the deleted ListResultInternalCommon class. This commit also incorporates previous feedback and build fixes: - Build Fixes: - Resolved circular include dependency between storage_reference.h and list_result.h by forward-declaring ListResult in storage_reference.h. - Corrected includes in list_result.cc and platform-specific list_result_*.h files to use appropriate platform-specific headers for StorageInternal definitions. - Integration Tests: - Removed SKIP_TEST_ON_ANDROID_EMULATOR from ListAllBasic and ListPaginated tests. - Refactored list tests to create their own unique root folders. - Code Style: - Removed unnecessary comments. - Updated copyright years to 2025. - Ran code formatter on all changed files. - Android Performance: - Optimized Android's ListResultInternal to cache converted data. - Cleanup Mechanism: - Simplified ListResult cleanup logic.
1 parent cd50563 commit 3e4e046

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

storage/src/android/list_result_android.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
#include "app/src/util_android.h"
2424
#include "firebase/app.h"
2525
#include "firebase/storage/storage_reference.h"
26-
#include "storage/src/common/storage_internal.h"
27-
// It's okay for platform specific internal headers to include common internal
28-
// headers.
29-
#include "storage/src/common/list_result_internal_common.h"
26+
// #include "storage/src/common/storage_internal.h" // Removed
27+
#include "storage/src/android/storage_android.h" // Added for Android StorageInternal
28+
// #include "storage/src/common/list_result_internal_common.h" // Removed
3029

3130
namespace firebase {
3231
namespace storage {
@@ -36,9 +35,8 @@ class ListResult;
3635

3736
namespace internal {
3837

39-
// Declare ListResultInternal a friend of ListResultInternalCommon for
4038
// construction.
41-
class ListResultInternalCommon;
39+
// class ListResultInternalCommon; // Removed
4240

4341
// Contains the Android-specific implementation of ListResultInternal.
4442
class ListResultInternal {
@@ -83,7 +81,7 @@ class ListResultInternal {
8381
friend class firebase::storage::ListResult;
8482
// For ListResultInternalCommon's constructor and access to app_ via
8583
// storage_internal().
86-
friend class ListResultInternalCommon;
84+
// friend class ListResultInternalCommon; // Removed as class is removed
8785

8886
// Converts a Java List of Java StorageReference objects to a C++ vector of
8987
// C++ StorageReference objects.

storage/src/desktop/list_result_desktop.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2025 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

storage/src/desktop/list_result_desktop.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2025 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -19,10 +19,9 @@
1919
#include <vector>
2020

2121
#include "firebase/storage/storage_reference.h"
22-
#include "storage/src/common/storage_internal.h"
23-
// It's okay for platform specific internal headers to include common internal
24-
// headers.
25-
#include "storage/src/common/list_result_internal_common.h"
22+
// #include "storage/src/common/storage_internal.h" // Removed
23+
#include "storage/src/desktop/storage_desktop.h" // Added for Desktop StorageInternal
24+
// #include "storage/src/common/list_result_internal_common.h" // Removed
2625

2726
namespace firebase {
2827
namespace storage {
@@ -34,7 +33,7 @@ namespace internal {
3433

3534
// Declare ListResultInternal a friend of ListResultInternalCommon for
3635
// construction.
37-
class ListResultInternalCommon;
36+
// class ListResultInternalCommon; // Removed
3837

3938
// Contains the Desktop-specific implementation of ListResultInternal (stubs).
4039
class ListResultInternal {
@@ -77,7 +76,7 @@ class ListResultInternal {
7776
friend class firebase::storage::ListResult;
7877
// For ListResultInternalCommon's constructor and access to app_ via
7978
// storage_internal().
80-
friend class ListResultInternalCommon;
79+
// friend class ListResultInternalCommon; // Removed
8180

8281
StorageInternal* storage_internal_; // Not owned.
8382
// Desktop stubs don't actually store these, but defined to match constructor.

storage/src/ios/list_result_ios.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2025 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -20,9 +20,9 @@
2020
#include <memory> // For std::unique_ptr
2121

2222
#include "firebase/storage/storage_reference.h"
23-
#include "storage/src/common/storage_internal.h"
24-
// It's okay for platform specific internal headers to include common internal headers.
25-
#include "storage/src/common/list_result_internal_common.h"
23+
// #include "storage/src/common/storage_internal.h" // Removed
24+
#include "storage/src/ios/storage_ios.h" // Added for iOS StorageInternal
25+
// #include "storage/src/common/list_result_internal_common.h" // Removed
2626
#include "storage/src/ios/fir_storage_list_result_pointer.h" // For FIRStorageListResultPointer
2727

2828
// Forward declare Obj-C types
@@ -44,7 +44,7 @@ class ListResult;
4444
namespace internal {
4545

4646
// Declare ListResultInternal a friend of ListResultInternalCommon for construction.
47-
class ListResultInternalCommon;
47+
// class ListResultInternalCommon; // Removed
4848

4949
// Contains the iOS-specific implementation of ListResultInternal.
5050
class ListResultInternal {
@@ -83,7 +83,7 @@ class ListResultInternal {
8383
friend class firebase::storage::ListResult;
8484
// For ListResultInternalCommon's constructor and access to app_ via
8585
// storage_internal().
86-
friend class ListResultInternalCommon;
86+
// friend class ListResultInternalCommon; // Removed
8787

8888
// Converts an NSArray of FIRStorageReference objects to a C++ vector of
8989
// C++ StorageReference objects.

0 commit comments

Comments
 (0)