Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6608)

Unified Diff: chrome/browser/safe_browsing/ping_manager.h

Issue 2624193004: Submit a sample of notification images to Safe Browsing (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/ping_manager.h
diff --git a/chrome/browser/safe_browsing/ping_manager.h b/chrome/browser/safe_browsing/ping_manager.h
index 9f0c1977ce8617790536e7b4ad1326e04f01ae35..7c54e840395e37bba2412fe4a7cc02e5277dc5f2 100644
--- a/chrome/browser/safe_browsing/ping_manager.h
+++ b/chrome/browser/safe_browsing/ping_manager.h
@@ -23,12 +23,15 @@
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h"
+class SkBitmap;
+
namespace net {
class URLRequestContextGetter;
} // namespace net
namespace safe_browsing {
+class NotificationImageReporter;
class PermissionReporter;
class SafeBrowsingPingManager : public net::URLFetcherDelegate {
@@ -55,6 +58,11 @@ class SafeBrowsingPingManager : public net::URLFetcherDelegate {
// Report permission action to SafeBrowsing servers.
void ReportPermissionAction(const PermissionReportInfo& report_info);
+ // Report notification content image to SafeBrowsing CSD server if necessary.
+ void ReportNotificationImage(Profile* profile,
+ const GURL& origin,
+ const SkBitmap& image);
+
private:
friend class PermissionReporterBrowserTest;
friend class SafeBrowsingPingManagerTest;
@@ -102,6 +110,9 @@ class SafeBrowsingPingManager : public net::URLFetcherDelegate {
// Sends reports of permission actions.
std::unique_ptr<PermissionReporter> permission_reporter_;
+ // Sends reports of notification content images.
+ scoped_refptr<NotificationImageReporter> notification_image_reporter_;
Peter Beverloo 2017/01/11 18:23:56 Higher level question: we could avoid ref counting
johnme 2017/01/11 20:05:07 I considered this, but it needs to be possible to
Nathan Parker 2017/01/11 22:34:38 It feels like a weak_ptr would be safer, since the
johnme 2017/01/13 02:38:16 Switched to WeakPtrs. The trick was to only derefe
+
net::NetLogWithSource net_log_;
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager);

Powered by Google App Engine
This is Rietveld 408576698