Fix some includes.

GitOrigin-RevId: 4c81e2fd0101f3c5bb23912681e7d02a60da5622
This commit is contained in:
levlam 2018-10-28 20:30:47 +03:00
parent 6a402ee0a3
commit 51eec319b8
27 changed files with 120 additions and 97 deletions

View File

@ -16,7 +16,7 @@ function disjoint_set_union(&$parents, $x, $y) {
$parents[$x] = $y;
} else {
$parents[$y] = $x;
}
}
}
}
@ -107,7 +107,7 @@ function split_file($file, $chunks, $undo) {
$common .= $line;
continue;
}
if (strpos($line, 'static ') === 0 && $depth === $target_depth) {
$is_static = true;
}

View File

@ -6,7 +6,6 @@
//
#include "td/telegram/AudiosManager.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/Td.h"

View File

@ -17,6 +17,7 @@
#include "td/telegram/net/NetType.h"
#include "td/telegram/net/PublicRsaKeyShared.h"
#include "td/telegram/net/Session.h"
#include "td/telegram/StateManager.h"
#if !TD_EMSCRIPTEN //FIXME
#include "td/net/HttpQuery.h"

View File

@ -70,4 +70,5 @@ class ConfigManager : public NetQueryCallback {
void save_dc_options_update(DcOptions dc_options);
DcOptions load_dc_options_update();
};
} // namespace td

View File

@ -11,6 +11,7 @@
#include "td/telegram/AnimationsManager.hpp"
#include "td/telegram/MessageEntity.hpp"
#include "td/telegram/Photo.hpp"
#include "td/telegram/Td.h"
#include "td/telegram/Version.h"
#include "td/utils/tl_helpers.h"

View File

@ -11,6 +11,7 @@
#include "td/telegram/net/MtprotoHeader.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/net/TempAuthKeyWatchdog.h"
#include "td/telegram/StateManager.h"
#include "td/telegram/TdDb.h"
#include "td/actor/PromiseFuture.h"

View File

@ -33,14 +33,14 @@
namespace td {
class AnimationsManager;
class CallManager;
class ConfigShared;
class ConfigManager;
class ConfigShared;
class ConnectionCreator;
class ContactsManager;
class FileManager;
class LanguagePackManager;
class MtprotoHeader;
class MessagesManager;
class MtprotoHeader;
class NetQueryDispatcher;
class PasswordManager;
class SecretChatsManager;
@ -139,84 +139,20 @@ class Global : public ActorContext {
ActorId<Td> td() const {
return td_;
}
ActorId<AnimationsManager> animations_manager() const {
return animations_manager_;
}
void set_animations_manager(ActorId<AnimationsManager> animations_manager) {
animations_manager_ = animations_manager;
}
ActorId<ContactsManager> contacts_manager() const {
return contacts_manager_;
}
void set_contacts_manager(ActorId<ContactsManager> contacts_manager) {
contacts_manager_ = contacts_manager;
}
ActorId<FileManager> file_manager() const {
return file_manager_;
}
void set_file_manager(ActorId<FileManager> file_manager) {
file_manager_ = std::move(file_manager);
}
ActorId<LanguagePackManager> language_pack_manager() const {
return language_pack_manager_;
}
void set_language_pack_manager(ActorId<LanguagePackManager> language_pack_manager) {
language_pack_manager_ = language_pack_manager;
}
ActorId<MessagesManager> messages_manager() const {
return messages_manager_;
}
void set_messages_manager(ActorId<MessagesManager> messages_manager) {
messages_manager_ = messages_manager;
}
ActorId<PasswordManager> password_manager() const {
return password_manager_;
}
void set_password_manager(ActorId<PasswordManager> password_manager) {
password_manager_ = password_manager;
}
ActorId<SecretChatsManager> secret_chats_manager() const {
return secret_chats_manager_;
}
void set_secret_chats_manager(ActorId<SecretChatsManager> secret_chats_manager) {
secret_chats_manager_ = secret_chats_manager;
}
ActorId<CallManager> call_manager() const {
return call_manager_;
}
void set_call_manager(ActorId<CallManager> call_manager) {
call_manager_ = call_manager;
}
ActorId<StickersManager> stickers_manager() const {
return stickers_manager_;
}
void set_stickers_manager(ActorId<StickersManager> stickers_manager) {
stickers_manager_ = stickers_manager;
}
ActorId<StorageManager> storage_manager() const {
return storage_manager_;
}
void set_storage_manager(ActorId<StorageManager> storage_manager) {
storage_manager_ = storage_manager;
}
ActorId<TopDialogManager> top_dialog_manager() const {
return top_dialog_manager_;
}
void set_top_dialog_manager(ActorId<TopDialogManager> top_dialog_manager) {
top_dialog_manager_ = top_dialog_manager;
}
ActorId<UpdatesManager> updates_manager() const {
return updates_manager_;
}
void set_updates_manager(ActorId<UpdatesManager> updates_manager) {
updates_manager_ = updates_manager;
}
ActorId<WebPagesManager> web_pages_manager() const {
return web_pages_manager_;
}
void set_web_pages_manager(ActorId<WebPagesManager> web_pages_manager) {
web_pages_manager_ = web_pages_manager;
}
ActorId<ConfigManager> config_manager() const {
return config_manager_;
@ -225,6 +161,83 @@ class Global : public ActorContext {
config_manager_ = config_manager;
}
ActorId<ContactsManager> contacts_manager() const {
return contacts_manager_;
}
void set_contacts_manager(ActorId<ContactsManager> contacts_manager) {
contacts_manager_ = contacts_manager;
}
ActorId<FileManager> file_manager() const {
return file_manager_;
}
void set_file_manager(ActorId<FileManager> file_manager) {
file_manager_ = std::move(file_manager);
}
ActorId<LanguagePackManager> language_pack_manager() const {
return language_pack_manager_;
}
void set_language_pack_manager(ActorId<LanguagePackManager> language_pack_manager) {
language_pack_manager_ = language_pack_manager;
}
ActorId<MessagesManager> messages_manager() const {
return messages_manager_;
}
void set_messages_manager(ActorId<MessagesManager> messages_manager) {
messages_manager_ = messages_manager;
}
ActorId<PasswordManager> password_manager() const {
return password_manager_;
}
void set_password_manager(ActorId<PasswordManager> password_manager) {
password_manager_ = password_manager;
}
ActorId<SecretChatsManager> secret_chats_manager() const {
return secret_chats_manager_;
}
void set_secret_chats_manager(ActorId<SecretChatsManager> secret_chats_manager) {
secret_chats_manager_ = secret_chats_manager;
}
ActorId<StickersManager> stickers_manager() const {
return stickers_manager_;
}
void set_stickers_manager(ActorId<StickersManager> stickers_manager) {
stickers_manager_ = stickers_manager;
}
ActorId<StorageManager> storage_manager() const {
return storage_manager_;
}
void set_storage_manager(ActorId<StorageManager> storage_manager) {
storage_manager_ = storage_manager;
}
ActorId<TopDialogManager> top_dialog_manager() const {
return top_dialog_manager_;
}
void set_top_dialog_manager(ActorId<TopDialogManager> top_dialog_manager) {
top_dialog_manager_ = top_dialog_manager;
}
ActorId<UpdatesManager> updates_manager() const {
return updates_manager_;
}
void set_updates_manager(ActorId<UpdatesManager> updates_manager) {
updates_manager_ = updates_manager;
}
ActorId<WebPagesManager> web_pages_manager() const {
return web_pages_manager_;
}
void set_web_pages_manager(ActorId<WebPagesManager> web_pages_manager) {
web_pages_manager_ = web_pages_manager;
}
ActorId<ConnectionCreator> connection_creator() const;
void set_connection_creator(ActorOwn<ConnectionCreator> connection_creator);
@ -314,19 +327,19 @@ class Global : public ActorContext {
ActorId<Td> td_;
ActorId<AnimationsManager> animations_manager_;
ActorId<CallManager> call_manager_;
ActorId<ConfigManager> config_manager_;
ActorId<ContactsManager> contacts_manager_;
ActorId<FileManager> file_manager_;
ActorId<MessagesManager> messages_manager_;
ActorId<LanguagePackManager> language_pack_manager_;
ActorId<MessagesManager> messages_manager_;
ActorId<PasswordManager> password_manager_;
ActorId<SecretChatsManager> secret_chats_manager_;
ActorId<CallManager> call_manager_;
ActorId<StickersManager> stickers_manager_;
ActorId<StorageManager> storage_manager_;
ActorId<TopDialogManager> top_dialog_manager_;
ActorId<UpdatesManager> updates_manager_;
ActorId<WebPagesManager> web_pages_manager_;
ActorId<ConfigManager> config_manager_;
ActorOwn<ConnectionCreator> connection_creator_;
ActorOwn<TempAuthKeyWatchdog> temp_auth_key_watchdog_;

View File

@ -31,10 +31,8 @@
#include "td/telegram/ReplyMarkup.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/VideoNotesManager.h"
#include "td/telegram/VideosManager.h"
#include "td/telegram/VoiceNotesManager.h"
#include "td/telegram/WebPagesManager.h"
#include "td/telegram/net/DcId.h"

View File

@ -10,6 +10,7 @@
#include "td/telegram/Global.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/misc.h"
#include "td/telegram/net/DcId.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/Td.h"

View File

@ -8,6 +8,8 @@
#include "td/telegram/Logging.h"
#include "td/telegram/td_api.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"

View File

@ -6,8 +6,8 @@
//
#include "td/telegram/Logging.h"
#include "td/telegram/net/ConnectionCreator.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/net/ConnectionCreator.h"
#include "td/telegram/Td.h"
#include "tddb/td/db/binlog/BinlogEvent.h"

View File

@ -10,6 +10,7 @@
#include "td/utils/logging.h"
namespace td {
// It is not about handling gaps.
// It is about finding mem processed pts.
// All checks must be done before.
@ -54,4 +55,5 @@ class PtsManager {
int32 mem_pts_ = -1;
ChangesProcessor<int32> state_helper_;
};
} // namespace td

View File

@ -9,6 +9,11 @@
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/AuthManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/td_api.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Status.h"
@ -17,8 +22,6 @@
namespace td {
class Td;
template <class T = Unit>
class RequestActor : public Actor {
public:

View File

@ -19,7 +19,6 @@
#include "td/telegram/DhConfig.h"
#include "td/telegram/logevent/SecretChatEvent.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/PtsManager.h"
#include "td/telegram/SecretChatDb.h"
#include "td/telegram/SecretChatId.h"
#include "td/telegram/UserId.h"

View File

@ -16,6 +16,7 @@
#include "td/telegram/MessagesManager.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/SequenceDispatcher.h"
#include "td/telegram/StateManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/secret_api.h"

View File

@ -10,7 +10,6 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/Td.h"

View File

@ -11,7 +11,6 @@
#include "td/telegram/telegram_api.h"
#include "td/telegram/AuthManager.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/Td.h"

View File

@ -10,7 +10,6 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/Td.h"

View File

@ -42,8 +42,10 @@
#include "td/db/SqliteKeyValueAsync.h"
#include "td/utils/buffer.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/Slice.h"
#include "td/utils/StringBuilder.h"
#include "td/utils/tl_helpers.h"

View File

@ -416,7 +416,7 @@ class CliClient final : public Actor {
break;
case td_api::authorizationStateClosed::ID:
LOG(WARNING) << "TD closed";
td_.reset();
td_client_.reset();
if (!close_flag_) {
create_td("ClientActor3");
}
@ -676,7 +676,7 @@ class CliClient final : public Actor {
LOG(WARNING) << "QUIT";
close_flag_ = true;
dump_memory_usage();
td_.reset();
td_client_.reset();
Scheduler::unsubscribe(stdin_.get_poll_info().get_pollable_fd_ref());
is_stdin_reader_stopped_ = true;
yield();
@ -737,7 +737,7 @@ class CliClient final : public Actor {
uint64 generation_;
};
td_ = create_actor<ClientActor>(name, make_unique<TdCallbackImpl>(this, ++generation_));
td_client_ = create_actor<ClientActor>(name, make_unique<TdCallbackImpl>(this, ++generation_));
}
void init_td() {
@ -753,7 +753,7 @@ class CliClient final : public Actor {
create_td("ClientActor2");
for (int i = 0; i < 4; i++) {
send_closure_later(td_, &ClientActor::request, std::numeric_limits<uint64>::max(),
send_closure_later(td_client_, &ClientActor::request, std::numeric_limits<uint64>::max(),
td_api::make_object<td_api::setAlarm>(0.001 + 1000 * (i / 2)));
}
@ -1142,9 +1142,9 @@ class CliClient final : public Actor {
uint64 send_request(tl_object_ptr<td_api::Function> f) {
static uint64 query_num = 1;
if (!td_.empty()) {
if (!td_client_.empty()) {
auto id = query_num++;
send_closure_later(td_, &ClientActor::request, id, std::move(f));
send_closure_later(td_client_, &ClientActor::request, id, std::move(f));
return id;
} else {
LOG(ERROR) << "Failed to send: " << to_string(f);
@ -3536,7 +3536,7 @@ class CliClient final : public Actor {
ConcurrentScheduler *scheduler_{nullptr};
bool use_test_dc_ = false;
ActorOwn<ClientActor> td_;
ActorOwn<ClientActor> td_client_;
std::queue<string> cmd_queue_;
bool close_flag_ = false;
bool ready_to_stop_ = false;

View File

@ -9,7 +9,6 @@
#include "td/telegram/files/ResourceManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/Td.h"
#include "td/telegram/UniqueId.h"
#include "td/utils/format.h"

View File

@ -13,7 +13,6 @@
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/Global.h"
#include "td/telegram/misc.h"
#include "td/telegram/Td.h"
#include "td/utils/base64.h"
#include "td/utils/format.h"

View File

@ -19,6 +19,7 @@
#include <memory>
namespace td {
class DcAuthManager : public NetQueryCallback {
public:
explicit DcAuthManager(ActorShared<> parent);
@ -56,4 +57,5 @@ class DcAuthManager : public NetQueryCallback {
void loop() override;
};
} // namespace td

View File

@ -15,6 +15,7 @@
#include "td/utils/logging.h"
#include "td/utils/MpscPollableQueue.h"
#include "td/utils/Observer.h"
#include "td/utils/port/detail/PollableFd.h"
#include "td/utils/port/FileFd.h"
#include "td/utils/port/thread.h"
#include "td/utils/Slice.h"

View File

@ -172,7 +172,7 @@ class Variant {
void init_empty(T &&t) {
CHECK(offset_ == npos) << offset_
#if TD_CLANG || TD_GCC
<< __PRETTY_FUNCTION__
<< ' ' << __PRETTY_FUNCTION__
#endif
;
offset_ = offset<T>();

View File

@ -16,6 +16,7 @@
#include "td/utils/port/detail/PollableFd.h"
#include "td/utils/port/PollFlags.h"
#include "td/utils/port/sleep.h"
#include "td/utils/ScopeGuard.h"
#include "td/utils/StringBuilder.h"
#include <cstring>

View File

@ -67,7 +67,7 @@ class TestClient : public Actor {
};
void close(Promise<> close_promise) {
close_promise_ = std::move(close_promise);
td_.reset();
td_client_.reset();
}
unique_ptr<TdCallback> make_td_callback() {
@ -142,10 +142,10 @@ class TestClient : public Actor {
set_tag(name_);
LOG(INFO) << "START UP!";
td_ = create_actor<ClientActor>("Td-proxy", make_td_callback());
td_client_ = create_actor<ClientActor>("Td-proxy", make_td_callback());
}
ActorOwn<ClientActor> td_;
ActorOwn<ClientActor> td_client_;
string name_;
@ -177,7 +177,7 @@ class Task : public TestClient::Listener {
void send_query(tl_object_ptr<td_api::Function> function, F callback) {
auto id = current_query_id_++;
sent_queries_[id] = std::forward<F>(callback);
send_closure(client_->td_, &ClientActor::request, id, std::move(function));
send_closure(client_->td_client_, &ClientActor::request, id, std::move(function));
}
protected: