|
|
83db2ad |
From f08cb0022527081c078e8b96062e6c9b4fbda151 Mon Sep 17 00:00:00 2001
|
|
|
83db2ad |
From: Jose Dapena Paz <jose.dapena@lge.com>
|
|
|
83db2ad |
Date: Fri, 26 Jul 2019 16:48:06 +0000
|
|
|
83db2ad |
Subject: [PATCH] BinaryUploadService: change parameter passing that cannot afford abstract class
|
|
|
83db2ad |
|
|
|
83db2ad |
The method UploadForDeepScanning gets a Request as parameter. But Request is an
|
|
|
83db2ad |
abstract class, so GCC will not allow that declaration (polimorphycs should be
|
|
|
83db2ad |
passed by reference). Use std::unique_ptr so BinaryUploadService can assume
|
|
|
83db2ad |
ownership.
|
|
|
83db2ad |
|
|
|
83db2ad |
Bug: 819294
|
|
|
83db2ad |
Change-Id: I9e8c75cc92b01abd704d9049b0421555377da5ba
|
|
|
83db2ad |
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713550
|
|
|
83db2ad |
Reviewed-by: Daniel Rubery <drubery@chromium.org>
|
|
|
83db2ad |
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
|
|
|
83db2ad |
Cr-Commit-Position: refs/heads/master@{#681333}
|
|
|
83db2ad |
---
|
|
|
83db2ad |
|
|
|
83db2ad |
diff --git a/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc b/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc
|
|
|
83db2ad |
index 6430c89..4e90487 100644
|
|
|
83db2ad |
--- a/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc
|
|
|
83db2ad |
+++ b/chrome/browser/safe_browsing/download_protection/binary_upload_service.cc
|
|
|
83db2ad |
@@ -10,7 +10,7 @@
|
|
|
83db2ad |
namespace safe_browsing {
|
|
|
83db2ad |
|
|
|
83db2ad |
void BinaryUploadService::UploadForDeepScanning(
|
|
|
83db2ad |
- BinaryUploadService::Request request) {
|
|
|
83db2ad |
+ std::unique_ptr<BinaryUploadService::Request> request) {
|
|
|
83db2ad |
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
|
|
83db2ad |
NOTREACHED();
|
|
|
83db2ad |
}
|
|
|
83db2ad |
diff --git a/chrome/browser/safe_browsing/download_protection/binary_upload_service.h b/chrome/browser/safe_browsing/download_protection/binary_upload_service.h
|
|
|
83db2ad |
index d2dfd83..9b6f395 100644
|
|
|
83db2ad |
--- a/chrome/browser/safe_browsing/download_protection/binary_upload_service.h
|
|
|
83db2ad |
+++ b/chrome/browser/safe_browsing/download_protection/binary_upload_service.h
|
|
|
83db2ad |
@@ -5,6 +5,8 @@
|
|
|
83db2ad |
#ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_
|
|
|
83db2ad |
#define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_PROTECTION_BINARY_UPLOAD_SERVICE_H_
|
|
|
83db2ad |
|
|
|
83db2ad |
+#include <memory>
|
|
|
83db2ad |
+
|
|
|
83db2ad |
#include "base/callback.h"
|
|
|
83db2ad |
#include "components/safe_browsing/proto/webprotect.pb.h"
|
|
|
83db2ad |
|
|
|
83db2ad |
@@ -40,6 +42,7 @@
|
|
|
83db2ad |
public:
|
|
|
83db2ad |
// |callback| will run on the UI thread.
|
|
|
83db2ad |
explicit Request(Callback callback);
|
|
|
83db2ad |
+ virtual ~Request() = default;
|
|
|
83db2ad |
Request(const Request&) = delete;
|
|
|
83db2ad |
Request& operator=(const Request&) = delete;
|
|
|
83db2ad |
|
|
|
83db2ad |
@@ -67,7 +70,7 @@
|
|
|
83db2ad |
// Upload the given file contents for deep scanning. The results will be
|
|
|
83db2ad |
// returned asynchronously by calling |request|'s |callback|. This must be
|
|
|
83db2ad |
// called on the UI thread.
|
|
|
83db2ad |
- void UploadForDeepScanning(Request request);
|
|
|
83db2ad |
+ void UploadForDeepScanning(std::unique_ptr<Request> request);
|
|
|
83db2ad |
};
|
|
|
83db2ad |
|
|
|
83db2ad |
} // namespace safe_browsing
|