#include "components/feed/core/v2/tasks/load_stream_task.h"
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/functional/callback_helpers.h"
#include "base/time/time.h"
#include "components/feed/core/proto/v2/wire/capability.pb.h"
#include "components/feed/core/proto/v2/wire/client_info.pb.h"
#include "components/feed/core/proto/v2/wire/feed_query.pb.h"
#include "components/feed/core/proto/v2/wire/feed_request.pb.h"
#include "components/feed/core/proto/v2/wire/reliability_logging_enums.pb.h"
#include "components/feed/core/proto/v2/wire/request.pb.h"
#include "components/feed/core/v2/config.h"
#include "components/feed/core/v2/enums.h"
#include "components/feed/core/v2/feed_network.h"
#include "components/feed/core/v2/feed_stream.h"
#include "components/feed/core/v2/feedstore_util.h"
#include "components/feed/core/v2/ios_shared_prefs.h"
#include "components/feed/core/v2/launch_reliability_logger.h"
#include "components/feed/core/v2/metrics_reporter.h"
#include "components/feed/core/v2/proto_util.h"
#include "components/feed/core/v2/protocol_translator.h"
#include "components/feed/core/v2/public/types.h"
#include "components/feed/core/v2/stream_model.h"
#include "components/feed/core/v2/tasks/upload_actions_task.h"
#include "components/feed/core/v2/types.h"
#include "components/feed/core/v2/view_demotion.h"
#include "components/feed/feed_feature_list.h"
#include "net/base/net_errors.h"
namespace feed {
namespace {
Result;
feedwire::FeedQuery::RequestReason GetRequestReason(
const StreamType& stream_type,
LoadType load_type) { … }
}
Result::Result() = default;
Result::Result(const StreamType& a_stream_type, LoadStreamStatus status)
: … { … }
Result::~Result() = default;
Result::Result(Result&&) = default;
Result& Result::operator=(Result&&) = default;
LaunchResult LoadStreamTask::LaunchResultFromNetworkInfo(
const NetworkResponseInfo& response_info,
bool has_parsed_body) { … }
LoadStreamTask::LoadStreamTask(const Options& options,
FeedStream* stream,
base::OnceCallback<void(Result)> done_callback)
: … { … }
LoadStreamTask::~LoadStreamTask() = default;
void LoadStreamTask::Run() { … }
bool LoadStreamTask::CheckPreconditions() { … }
void LoadStreamTask::CheckIfSubscriberComplete(bool is_web_feed_subscriber) { … }
void LoadStreamTask::ResumeAtStart() { … }
void LoadStreamTask::PassedPreconditions() { … }
void LoadStreamTask::LoadFromStoreComplete(
LoadStreamFromStoreTask::Result result) { … }
void LoadStreamTask::LoadFromNetwork1(
std::vector<feedstore::StoredAction> pending_actions_from_store,
bool need_to_read_pending_actions) { … }
void LoadStreamTask::LoadFromNetwork2(
std::vector<feedstore::StoredAction> pending_actions_from_store,
bool need_to_read_pending_actions,
DocViewDigest doc_view_digest) { … }
void LoadStreamTask::UploadActions(
std::vector<feedstore::StoredAction> pending_actions_from_store) { … }
void LoadStreamTask::UploadActionsComplete(UploadActionsTask::Result result) { … }
void LoadStreamTask::SendFeedQueryRequest() { … }
void LoadStreamTask::QueryRequestComplete(
FeedNetwork::QueryRequestResult result) { … }
void LoadStreamTask::QueryApiRequestComplete(
FeedNetwork::ApiResult<feedwire::Response> result) { … }
template <typename Response>
void LoadStreamTask::ProcessNetworkResponse(
std::unique_ptr<Response> response_body,
NetworkResponseInfo response_info) { … }
void LoadStreamTask::RequestFinished(LaunchResult result) { … }
void LoadStreamTask::Done(LaunchResult launch_result) { … }
LaunchReliabilityLogger& LoadStreamTask::GetLaunchReliabilityLogger() const { … }
std::ostream& operator<<(std::ostream& os,
const LoadStreamTask::Result& result) { … }
}