#include "chrome/browser/safe_browsing/download_protection/download_feedback.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/task/task_runner.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/multipart_uploader.h"
#include "components/safe_browsing/core/common/proto/csd.pb.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_errors.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace safe_browsing {
namespace {
enum UploadResultType { … };
class DownloadFeedbackImpl : public DownloadFeedback { … };
DownloadFeedbackImpl::DownloadFeedbackImpl(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const base::FilePath& file_path,
uint64_t file_size,
const std::string& ping_request,
const std::string& ping_response)
: … { … }
DownloadFeedbackImpl::~DownloadFeedbackImpl() { … }
void DownloadFeedbackImpl::Start(base::OnceClosure finish_callback) { … }
void DownloadFeedbackImpl::FinishedUpload(base::OnceClosure finish_callback,
bool success,
int response_code,
const std::string& response_data) { … }
}
const int64_t DownloadFeedback::kMaxUploadSize = …;
const char DownloadFeedback::kSbFeedbackURL[] = …;
DownloadFeedbackFactory* DownloadFeedback::factory_ = …;
std::unique_ptr<DownloadFeedback> DownloadFeedback::Create(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const base::FilePath& file_path,
uint64_t file_size,
const std::string& ping_request,
const std::string& ping_response) { … }
}