#include "chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.h"
#include <memory>
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/proto/csd.pb.h"
#include "google_apis/google_api_keys.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
namespace safe_browsing {
namespace {
const char kSbIncidentReportUrl[] = …;
constexpr net::NetworkTrafficAnnotationTag
kSafeBrowsingIncidentTrafficAnnotation = …;
}
const int IncidentReportUploaderImpl::kTestUrlFetcherId = …;
IncidentReportUploaderImpl::~IncidentReportUploaderImpl() { … }
std::unique_ptr<IncidentReportUploader>
IncidentReportUploaderImpl::UploadReport(
OnResultCallback callback,
const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory,
const ClientIncidentReport& report) { … }
IncidentReportUploaderImpl::IncidentReportUploaderImpl(
OnResultCallback callback,
const scoped_refptr<network::SharedURLLoaderFactory>& url_loader_factory,
const std::string& post_data)
: … { … }
GURL IncidentReportUploaderImpl::GetIncidentReportUrl() { … }
void IncidentReportUploaderImpl::OnURLLoaderComplete(
std::unique_ptr<std::string> response_body) { … }
void IncidentReportUploaderImpl::OnURLLoaderCompleteInternal(
const std::string& response_body,
int response_code,
int net_error) { … }
}