#include "components/policy/core/common/cloud/dmserver_job_configurations.h"
#include "base/containers/contains.h"
#include "base/strings/string_number_conversions.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/policy_logger.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "net/base/url_util.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "url/gurl.h"
em;
namespace policy {
namespace {
const char* JobTypeToRequestType(
DeviceManagementService::JobConfiguration::JobType type) { … }
}
DMServerJobConfiguration::CreateParams
DMServerJobConfiguration::CreateParams::WithClient(JobType type,
CloudPolicyClient* client) { … }
DMServerJobConfiguration::CreateParams::CreateParams(
DMServerJobConfiguration::CreateParams&&) = default;
DMServerJobConfiguration::CreateParams&
DMServerJobConfiguration::CreateParams::operator=(
DMServerJobConfiguration::CreateParams&&) = default;
DMServerJobConfiguration::CreateParams
DMServerJobConfiguration::CreateParams::WithoutClient(
JobType type,
DeviceManagementService* service,
const std::string& client_id,
scoped_refptr<network::SharedURLLoaderFactory> factory) { … }
DMServerJobConfiguration::CreateParams
DMServerJobConfiguration::CreateParams::WithParams(
DeviceManagementService* service,
JobType type,
const std::string& client_id,
bool critical,
DMAuth auth_data,
std::optional<std::string> oauth_token,
scoped_refptr<network::SharedURLLoaderFactory> factory,
Callback callback) { … }
DMServerJobConfiguration::CreateParams::CreateParams() = default;
DMServerJobConfiguration::CreateParams::~CreateParams() = default;
DMServerJobConfiguration::DMServerJobConfiguration(CreateParams params)
: … { … }
DMServerJobConfiguration::DMServerJobConfiguration(
DeviceManagementService* service,
JobType type,
const std::string& client_id,
bool critical,
DMAuth auth_data,
std::optional<std::string>&& oauth_token,
scoped_refptr<network::SharedURLLoaderFactory> factory,
Callback callback)
: … { … }
DMServerJobConfiguration::DMServerJobConfiguration(
JobType type,
CloudPolicyClient* client,
bool critical,
DMAuth auth_data,
std::optional<std::string>&& oauth_token,
Callback callback)
: … { … }
DMServerJobConfiguration::~DMServerJobConfiguration() { … }
DeviceManagementStatus
DMServerJobConfiguration::MapNetErrorAndResponseToDMStatus(
int net_error,
int response_code,
const std::string& response_body) { … }
std::string DMServerJobConfiguration::GetPayload() { … }
std::string DMServerJobConfiguration::GetUmaName() { … }
void DMServerJobConfiguration::OnURLLoadComplete(
DeviceManagementService::Job* job,
int net_error,
int response_code,
const std::string& response_body) { … }
GURL DMServerJobConfiguration::GetURL(int last_error) const { … }
RegistrationJobConfiguration::RegistrationJobConfiguration(CreateParams params)
: … { … }
void RegistrationJobConfiguration::SetTimeoutDuration(base::TimeDelta timeout) { … }
void RegistrationJobConfiguration::OnBeforeRetry(
int response_code,
const std::string& response_body) { … }
}