Improve NetQueryCreator constructor.
This commit is contained in:
parent
bbae7be409
commit
a160241db7
@ -108,6 +108,7 @@ class Global final : public ActorContext {
|
||||
}
|
||||
|
||||
void set_net_query_stats(std::shared_ptr<NetQueryStats> net_query_stats);
|
||||
|
||||
void set_net_query_dispatcher(unique_ptr<NetQueryDispatcher> net_query_dispatcher);
|
||||
|
||||
NetQueryDispatcher &net_query_dispatcher() {
|
||||
|
@ -20,6 +20,11 @@
|
||||
|
||||
namespace td {
|
||||
|
||||
NetQueryCreator::NetQueryCreator(std::shared_ptr<NetQueryStats> net_query_stats)
|
||||
: net_query_stats_(std::move(net_query_stats)) {
|
||||
object_pool_.set_check_empty(true);
|
||||
}
|
||||
|
||||
NetQueryPtr NetQueryCreator::create(const telegram_api::Function &function, DcId dc_id, NetQuery::Type type) {
|
||||
return create(UniqueId::next(), function, dc_id, type, NetQuery::AuthFlag::On);
|
||||
}
|
||||
|
@ -23,10 +23,7 @@ class Function;
|
||||
|
||||
class NetQueryCreator {
|
||||
public:
|
||||
explicit NetQueryCreator(std::shared_ptr<NetQueryStats> net_query_stats = {}) {
|
||||
net_query_stats_ = std::move(net_query_stats);
|
||||
object_pool_.set_check_empty(true);
|
||||
}
|
||||
explicit NetQueryCreator(std::shared_ptr<NetQueryStats> net_query_stats);
|
||||
|
||||
void stop_check() {
|
||||
object_pool_.set_check_empty(false);
|
||||
|
@ -562,7 +562,7 @@ class FakeSecretChatContext final : public SecretChatActor::Context {
|
||||
|
||||
std::shared_ptr<SecretChatDb> secret_chat_db_;
|
||||
};
|
||||
NetQueryCreator FakeSecretChatContext::net_query_creator_;
|
||||
NetQueryCreator FakeSecretChatContext::net_query_creator_{nullptr};
|
||||
|
||||
class Master final : public Actor {
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user