Commit f08cb002 authored by Jose Dapena Paz's avatar Jose Dapena Paz Committed by Commit Bot

BinaryUploadService: change parameter passing that cannot afford abstract class

The method UploadForDeepScanning gets a Request as parameter. But Request is an
abstract class, so GCC will not allow that declaration (polimorphycs should be
passed by reference). Use std::unique_ptr so BinaryUploadService can assume
ownership.

Bug: 819294
Change-Id: I9e8c75cc92b01abd704d9049b0421555377da5ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713550Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Cr-Commit-Position: refs/heads/master@{#681333}
parent 776b8ced
......@@ -10,7 +10,7 @@
namespace safe_browsing {
void BinaryUploadService::UploadForDeepScanning(
BinaryUploadService::Request request) {
std::unique_ptr<BinaryUploadService::Request> request) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
NOTREACHED();
}
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_
#define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_
#include <memory>
#include "base/callback.h"
#include "components/safe_browsing/proto/webprotect.pb.h"
......@@ -40,6 +42,7 @@ class BinaryUploadService {
public:
// |callback| will run on the UI thread.
explicit Request(Callback callback);
virtual ~Request() = default;
Request(const Request&) = delete;
Request& operator=(const Request&) = delete;
......@@ -67,7 +70,7 @@ class BinaryUploadService {
// Upload the given file contents for deep scanning. The results will be
// returned asynchronously by calling |request|'s |callback|. This must be
// called on the UI thread.
void UploadForDeepScanning(Request request);
void UploadForDeepScanning(std::unique_ptr<Request> request);
};
} // namespace safe_browsing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment