#include "components/update_client/update_checker.h"
#include <stddef.h>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "components/update_client/activity_data_service.h"
#include "components/update_client/component.h"
#include "components/update_client/configurator.h"
#include "components/update_client/persisted_data.h"
#include "components/update_client/protocol_definition.h"
#include "components/update_client/protocol_handler.h"
#include "components/update_client/protocol_serializer.h"
#include "components/update_client/request_sender.h"
#include "components/update_client/task_traits.h"
#include "components/update_client/update_client.h"
#include "components/update_client/update_engine.h"
#include "components/update_client/utils.h"
#include "url/gurl.h"
namespace update_client {
namespace {
class UpdateCheckerImpl : public UpdateChecker { … };
UpdateCheckerImpl::UpdateCheckerImpl(scoped_refptr<Configurator> config,
PersistedData* metadata)
: … { … }
UpdateCheckerImpl::~UpdateCheckerImpl() { … }
void UpdateCheckerImpl::CheckForUpdates(
scoped_refptr<UpdateContext> context,
const base::flat_map<std::string, std::string>& additional_attributes,
UpdateCheckCallback update_check_callback) { … }
UpdaterStateAttributes UpdateCheckerImpl::ReadUpdaterStateAttributes(
UpdaterStateProvider update_state_provider,
bool is_machine) { … }
void UpdateCheckerImpl::CheckForUpdatesHelper(
scoped_refptr<UpdateContext> context,
const std::vector<GURL>& urls,
const base::flat_map<std::string, std::string>& additional_attributes,
const UpdaterStateAttributes& updater_state_attributes,
const std::set<std::string>& active_ids) { … }
void UpdateCheckerImpl::OnRequestSenderComplete(
scoped_refptr<UpdateContext> context,
std::optional<base::OnceClosure> fallback,
int error,
const std::string& response,
int retry_after_sec) { … }
void UpdateCheckerImpl::UpdateCheckSucceeded(
scoped_refptr<UpdateContext> context,
const ProtocolParser::Results& results,
int retry_after_sec) { … }
void UpdateCheckerImpl::UpdateCheckFailed(ErrorCategory error_category,
int error,
int retry_after_sec) { … }
}
std::unique_ptr<UpdateChecker> UpdateChecker::Create(
scoped_refptr<Configurator> config,
PersistedData* persistent) { … }
}