Skip to content

Commit 8d92e73

Browse files
wu-huia-maurice
authored andcommitted
[C++] Provide a default executor with settings on iOS
PiperOrigin-RevId: 314233757
1 parent 4687e2f commit 8d92e73

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

firestore/src/common/settings.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const char kDefaultHost[] = "firestore.googleapis.com";
1717

1818
}
1919

20+
#if !defined(__APPLE__)
2021
Settings::Settings() : host_(kDefaultHost) {}
22+
#endif
2123

2224
void Settings::set_host(std::string host) { host_ = firebase::Move(host); }
2325

firestore/src/common/settings_ios.mm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
namespace firebase {
99
namespace firestore {
1010

11+
namespace {
12+
13+
const char kDefaultHost[] = "firestore.googleapis.com";
14+
15+
}
16+
1117
using util::Executor;
1218
using util::ExecutorLibdispatch;
1319

20+
Settings::Settings()
21+
: host_(kDefaultHost),
22+
executor_(absl::make_unique<ExecutorLibdispatch>(dispatch_queue_create(
23+
"com.google.firebase.firestore.callback", DISPATCH_QUEUE_SERIAL))) {}
24+
1425
std::unique_ptr<Executor> Settings::CreateExecutor() const {
1526
return absl::make_unique<ExecutorLibdispatch>(dispatch_queue());
1627
}

0 commit comments

Comments
 (0)