| Index: chrome/browser/safe_browsing/safe_browsing_service.cc
|
| ===================================================================
|
| --- chrome/browser/safe_browsing/safe_browsing_service.cc (revision 66642)
|
| +++ chrome/browser/safe_browsing/safe_browsing_service.cc (working copy)
|
| @@ -13,6 +13,7 @@
|
| #include "chrome/browser/metrics/metrics_service.h"
|
| #include "chrome/browser/prefs/pref_service.h"
|
| #include "chrome/browser/profile_manager.h"
|
| +#include "chrome/browser/safe_browsing/malware_report.h"
|
| #include "chrome/browser/safe_browsing/protocol_manager.h"
|
| #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
|
| #include "chrome/browser/safe_browsing/safe_browsing_database.h"
|
| @@ -34,11 +35,12 @@
|
| using base::TimeDelta;
|
|
|
| // The default URL prefix where browser fetches chunk updates, hashes,
|
| -// and reports malware.
|
| +// and reports safe browsing hits.
|
| static const char* const kSbDefaultInfoURLPrefix =
|
| "http://safebrowsing.clients.google.com/safebrowsing";
|
|
|
| // The default URL prefix where browser fetches MAC client key.
|
| +// Also used for advanced malware reports.
|
| static const char* const kSbDefaultMacKeyURLPrefix =
|
| "https://sb-ssl.google.com/safebrowsing";
|
|
|
| @@ -832,3 +834,14 @@
|
| referrer_url, is_subresource,
|
| threat_type);
|
| }
|
| +
|
| +// Called after the user has opted in to send the malware |report|.
|
| +void SafeBrowsingService::SendMalwareReport(
|
| + scoped_refptr<SafeBrowsingMalwareReport> report) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| + scoped_ptr<const std::string> serialized(report->GetSerializedReport());
|
| + if (!serialized->empty()) {
|
| + DVLOG(1) << "Sending serialized report.";
|
| + protocol_manager_->SendMalwareReport(*serialized);
|
| + }
|
| +}
|
|
|