#include "components/optimization_guide/core/optimization_guide_util.h"
#include "base/containers/flat_set.h"
#include "base/notreached.h"
#include "build/build_config.h"
#include "components/optimization_guide/core/model_execution/feature_keys.h"
#include "components/optimization_guide/core/optimization_guide_decision.h"
#include "components/optimization_guide/core/optimization_guide_enums.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/optimization_guide/core/optimization_guide_logger.h"
#include "components/optimization_guide/core/optimization_guide_prefs.h"
#include "components/prefs/pref_service.h"
#include "google_apis/common/api_key_request_util.h"
#include "net/base/url_util.h"
#include "net/http/http_request_headers.h"
#include "services/network/public/cpp/resource_request.h"
#include "url/url_canon.h"
namespace {
constexpr char kAuthHeaderBearer[] = …;
optimization_guide::proto::Platform GetPlatform() { … }
}
namespace optimization_guide {
std::string_view GetStringNameForModelExecutionFeature(
std::optional<UserVisibleFeatureKey> feature) { … }
std::string_view GetStringNameForModelExecutionFeature(
ModelBasedCapabilityKey feature) { … }
std::string_view GetStringNameForModelExecutionFeature(
proto::ModelExecutionFeature feature) { … }
bool IsHostValidToFetchFromRemoteOptimizationGuide(const std::string& host) { … }
std::string GetStringForOptimizationGuideDecision(
OptimizationGuideDecision decision) { … }
optimization_guide::proto::OriginInfo GetClientOriginInfo() { … }
void LogFeatureFlagsInfo(OptimizationGuideLogger* optimization_guide_logger,
bool is_off_the_record,
PrefService* pref_service) { … }
void PopulateAuthorizationRequestHeader(
network::ResourceRequest* resource_request,
std::string_view access_token) { … }
void PopulateApiKeyRequestHeader(network::ResourceRequest* resource_request,
std::string_view api_key) { … }
bool ShouldStartModelValidator() { … }
}