Skip to content

Commit b757139

Browse files
committed
delete includes from main
1 parent d9d5ecd commit b757139

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

firestore/src/common/local_cache_settings.cc

+21-4
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,22 @@ int64_t PersistentCacheSettings::size_bytes() const {
5555
return settings_internal_->core_settings().size_bytes();
5656
}
5757

58+
const CoreCacheSettings& PersistentCacheSettings::core_settings() const {
59+
return settings_internal_->core_settings();
60+
}
61+
5862
MemoryEagerGCSettings MemoryEagerGCSettings::Create() { return {}; }
5963

6064
MemoryEagerGCSettings::MemoryEagerGCSettings() {
6165
settings_internal_ = std::make_shared<MemoryEagerGCSettingsInternal>(
6266
CoreMemoryEagerGcSettings{});
6367
}
6468

69+
const CoreMemoryGarbageCollectorSettings& MemoryEagerGCSettings::core_settings()
70+
const {
71+
return settings_internal_->core_settings();
72+
}
73+
6574
MemoryLruGCSettings MemoryLruGCSettings::Create() { return {}; }
6675

6776
MemoryLruGCSettings::MemoryLruGCSettings() {
@@ -83,6 +92,11 @@ int64_t MemoryLruGCSettings::size_bytes() const {
8392
return settings_internal_->core_settings().size_bytes();
8493
}
8594

95+
const CoreMemoryGarbageCollectorSettings& MemoryLruGCSettings::core_settings()
96+
const {
97+
return settings_internal_->core_settings();
98+
}
99+
86100
MemoryCacheSettings MemoryCacheSettings::Create() { return {}; }
87101

88102
MemoryCacheSettings::MemoryCacheSettings() {
@@ -96,13 +110,16 @@ MemoryCacheSettings MemoryCacheSettings::WithGarbageCollectorSettings(
96110
CoreMemorySettings core_settings = result.settings_internal_->core_settings();
97111
result.settings_internal_->set_core_settings(
98112
core_settings.WithMemoryGarbageCollectorSettings(
99-
settings.internal().core_settings()));
113+
settings.core_settings()));
100114
return result;
101115
}
102116

117+
const CoreCacheSettings& MemoryCacheSettings::core_settings() const {
118+
return settings_internal_->core_settings();
119+
}
120+
103121
bool operator==(const LocalCacheSettings& lhs, const LocalCacheSettings& rhs) {
104-
return lhs.kind() == rhs.kind() &&
105-
lhs.internal().core_settings() == rhs.internal().core_settings();
122+
return lhs.kind() == rhs.kind() && lhs.core_settings() == rhs.core_settings();
106123
}
107124

108125
bool operator==(const MemoryCacheSettings& lhs,
@@ -117,7 +134,7 @@ bool operator==(const PersistentCacheSettings& lhs,
117134

118135
bool operator==(const MemoryGarbageCollectorSettings& lhs,
119136
const MemoryGarbageCollectorSettings& rhs) {
120-
return lhs.internal().core_settings() == rhs.internal().core_settings();
137+
return lhs.core_settings() == rhs.core_settings();
121138
}
122139

123140
bool operator==(const MemoryEagerGCSettings& lhs,

firestore/src/include/firebase/firestore/local_cache_settings.h

+10-17
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
#include <memory>
2222

2323
#include "firestore/src/include/firebase/firestore/settings.h"
24-
#include "firestore/src/main/local_cache_settings_main.h"
2524

2625
namespace firebase {
2726
namespace firestore {
27+
namespace api {
28+
class LocalCacheSettings;
29+
class MemoryGargabeCollectorSettings;
30+
} // namespace api
2831

29-
class LocalCacheSettingsInternal;
3032
class PersistentCacheSettingsInternal;
3133
class MemoryCacheSettingsInternal;
3234
class MemoryLruGCSettingsInternal;
@@ -58,7 +60,7 @@ class LocalCacheSettings {
5860
LocalCacheSettings() = default;
5961

6062
virtual Kind kind() const = 0;
61-
virtual const LocalCacheSettingsInternal& internal() const = 0;
63+
virtual const api::LocalCacheSettings& core_settings() const = 0;
6264
};
6365

6466
/**
@@ -112,9 +114,7 @@ class PersistentCacheSettings final : public LocalCacheSettings {
112114
}
113115

114116
// Get the corresponding settings object from the core sdk.
115-
const PersistentCacheSettingsInternal& internal() const override {
116-
return *settings_internal_;
117-
}
117+
const api::LocalCacheSettings& core_settings() const override;
118118

119119
std::shared_ptr<PersistentCacheSettingsInternal> settings_internal_;
120120
};
@@ -155,10 +155,7 @@ class MemoryCacheSettings final : public LocalCacheSettings {
155155
return LocalCacheSettings::Kind::kMemory;
156156
}
157157

158-
// Get the corresponding settings object from the core sdk.
159-
const MemoryCacheSettingsInternal& internal() const override {
160-
return *settings_internal_;
161-
}
158+
const api::LocalCacheSettings& core_settings() const override;
162159

163160
std::shared_ptr<MemoryCacheSettingsInternal> settings_internal_;
164161
};
@@ -184,7 +181,7 @@ class MemoryGarbageCollectorSettings {
184181

185182
MemoryGarbageCollectorSettings() = default;
186183

187-
virtual const MemoryGarbageCollectorSettingsInternal& internal() const = 0;
184+
virtual const api::MemoryGargabeCollectorSettings& core_settings() const = 0;
188185
};
189186

190187
/**
@@ -214,9 +211,7 @@ class MemoryEagerGCSettings final : public MemoryGarbageCollectorSettings {
214211
private:
215212
friend class MemoryCacheSettings;
216213
MemoryEagerGCSettings();
217-
const MemoryEagerGCSettingsInternal& internal() const override {
218-
return *settings_internal_;
219-
}
214+
const api::MemoryGargabeCollectorSettings& core_settings() const override;
220215

221216
std::shared_ptr<MemoryEagerGCSettingsInternal> settings_internal_;
222217
};
@@ -272,9 +267,7 @@ class MemoryLruGCSettings final : public MemoryGarbageCollectorSettings {
272267
MemoryLruGCSettings();
273268
MemoryLruGCSettings(const MemoryLruGCSettingsInternal& other);
274269

275-
const MemoryLruGCSettingsInternal& internal() const override {
276-
return *settings_internal_;
277-
}
270+
const api::MemoryGargabeCollectorSettings& core_settings() const override;
278271

279272
std::shared_ptr<MemoryLruGCSettingsInternal> settings_internal_;
280273
};

firestore/src/main/firestore_main.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ void FirestoreInternal::set_settings(Settings from) {
221221
// this special logic should go away when legacy cache config is removed.
222222
if (from.cache_settings_source_ == Settings::CacheSettingsSource::kNew) {
223223
settings.set_local_cache_settings(
224-
from.local_cache_settings().internal().core_settings());
224+
from.local_cache_settings().core_settings());
225225
} else {
226226
settings.set_persistence_enabled(from.is_persistence_enabled());
227227
settings.set_cache_size_bytes(from.cache_size_bytes());

0 commit comments

Comments
 (0)