#include "components/update_client/update_query_params.h"
#include "base/check.h"
#include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/update_client/update_query_params_delegate.h"
#include "components/version_info/version_info.h"
#if BUILDFLAG(IS_WIN)
#include "base/win/windows_version.h"
#endif
namespace update_client {
namespace {
const char kUnknown[] = …;
const char kOs[] = …"mac";
#elif BUILDFLAG(IS_WIN)
"win";
#elif BUILDFLAG(IS_ANDROID)
"android";
#elif BUILDFLAG(IS_CHROMEOS)
"cros";
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
"linux";
#elif BUILDFLAG(IS_FUCHSIA)
"fuchsia";
#elif BUILDFLAG(IS_OPENBSD)
"openbsd";
#else
#error "unknown os"
#endif
const char kArch[] = …;
#elif defined(ARCH_CPU_X86)
"x86";
#elif defined(ARCH_CPU_ARMEL)
"arm";
#elif defined(ARCH_CPU_ARM64)
"arm64";
#elif defined(ARCH_CPU_MIPS64EL)
"mips64el";
#elif defined(ARCH_CPU_MIPSEL)
"mipsel";
#elif defined(__powerpc64__)
"ppc64";
#elif defined(ARCH_CPU_LOONGARCH32)
"loongarch32";
#elif defined(ARCH_CPU_LOONGARCH64)
"loongarch64";
#elif defined(ARCH_CPU_RISCV64)
"riscv64";
#else
#error "unknown arch"
#endif
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
const char kChrome[] = "chrome";
const char kCrx[] = "chromecrx";
const char kWebView[] = "googleandroidwebview";
#else
const char kChrome[] = …;
const char kCrx[] = …;
const char kWebView[] = …;
#endif
UpdateQueryParamsDelegate* g_delegate = …;
}
std::string UpdateQueryParams::Get(ProdId prod) { … }
const char* UpdateQueryParams::GetProdIdString(UpdateQueryParams::ProdId prod) { … }
const char* UpdateQueryParams::GetOS() { … }
const char* UpdateQueryParams::GetArch() { … }
const char* UpdateQueryParams::GetNaclArch() { … }
std::string UpdateQueryParams::GetProdVersion() { … }
void UpdateQueryParams::SetDelegate(UpdateQueryParamsDelegate* delegate) { … }
}