#include "components/policy/core/common/cloud/reporting_job_configuration_base.h"
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include "base/functional/callback.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "components/policy/core/common/cloud/cloud_policy_util.h"
#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/cloud/dm_auth.h"
#include "components/version_info/version_info.h"
#include "google_apis/google_api_keys.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "url/gurl.h"
namespace policy {
const char
ReportingJobConfigurationBase::DeviceDictionaryBuilder::kDeviceKey[] = …;
const char ReportingJobConfigurationBase::DeviceDictionaryBuilder::kDMToken[] = …;
const char ReportingJobConfigurationBase::DeviceDictionaryBuilder::kClientId[] = …;
const char
ReportingJobConfigurationBase::DeviceDictionaryBuilder::kOSVersion[] = …;
const char
ReportingJobConfigurationBase::DeviceDictionaryBuilder::kOSPlatform[] = …;
const char ReportingJobConfigurationBase::DeviceDictionaryBuilder::kName[] = …;
base::Value::Dict
ReportingJobConfigurationBase::DeviceDictionaryBuilder::BuildDeviceDictionary(
const std::string& dm_token,
const std::string& client_id) { … }
std::string
ReportingJobConfigurationBase::DeviceDictionaryBuilder::GetDMTokenPath() { … }
std::string
ReportingJobConfigurationBase::DeviceDictionaryBuilder::GetClientIdPath() { … }
std::string
ReportingJobConfigurationBase::DeviceDictionaryBuilder::GetOSVersionPath() { … }
std::string
ReportingJobConfigurationBase::DeviceDictionaryBuilder::GetOSPlatformPath() { … }
std::string
ReportingJobConfigurationBase::DeviceDictionaryBuilder::GetNamePath() { … }
std::string
ReportingJobConfigurationBase::DeviceDictionaryBuilder::GetStringPath(
std::string_view leaf_name) { … }
const char
ReportingJobConfigurationBase::BrowserDictionaryBuilder::kBrowserKey[] = …;
const char
ReportingJobConfigurationBase::BrowserDictionaryBuilder::kBrowserId[] = …;
const char
ReportingJobConfigurationBase::BrowserDictionaryBuilder::kUserAgent[] = …;
const char
ReportingJobConfigurationBase::BrowserDictionaryBuilder::kMachineUser[] = …;
const char
ReportingJobConfigurationBase::BrowserDictionaryBuilder::kChromeVersion[] = …;
base::Value::Dict
ReportingJobConfigurationBase::BrowserDictionaryBuilder::BuildBrowserDictionary(
bool include_device_info) { … }
std::string
ReportingJobConfigurationBase::BrowserDictionaryBuilder::GetBrowserIdPath() { … }
std::string
ReportingJobConfigurationBase::BrowserDictionaryBuilder::GetUserAgentPath() { … }
std::string
ReportingJobConfigurationBase::BrowserDictionaryBuilder::GetMachineUserPath() { … }
std::string ReportingJobConfigurationBase::BrowserDictionaryBuilder::
GetChromeVersionPath() { … }
std::string
ReportingJobConfigurationBase::BrowserDictionaryBuilder::GetStringPath(
std::string_view leaf_name) { … }
std::string ReportingJobConfigurationBase::GetPayload() { … }
std::string ReportingJobConfigurationBase::GetUmaName() { … }
DeviceManagementService::Job::RetryMethod
ReportingJobConfigurationBase::ShouldRetry(int response_code,
const std::string& response_body) { … }
void ReportingJobConfigurationBase::OnBeforeRetry(
int response_code,
const std::string& response_body) { … }
void ReportingJobConfigurationBase::OnURLLoadComplete(
DeviceManagementService::Job* job,
int net_error,
int response_code,
const std::string& response_body) { … }
DeviceManagementService::Job::RetryMethod
ReportingJobConfigurationBase::ShouldRetryInternal(
int response_code,
const std::string& response_body) { … }
void ReportingJobConfigurationBase::OnBeforeRetryInternal(
int response_code,
const std::string& response_body) { … }
void ReportingJobConfigurationBase::UpdatePayloadBeforeGetInternal() { … }
GURL ReportingJobConfigurationBase::GetURL(int last_error) const { … }
ReportingJobConfigurationBase::ReportingJobConfigurationBase(
JobType type,
scoped_refptr<network::SharedURLLoaderFactory> factory,
DMAuth auth_data,
const std::string& server_url,
UploadCompleteCallback callback)
: … { … }
ReportingJobConfigurationBase::~ReportingJobConfigurationBase() = default;
void ReportingJobConfigurationBase::InitializePayloadWithDeviceInfo(
const std::string& dm_token,
const std::string& client_id) { … }
void ReportingJobConfigurationBase::InitializePayloadWithoutDeviceInfo() { … }
void ReportingJobConfigurationBase::InitializePayload(
bool include_device_info) { … }
}