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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 2606843002: Improve memory usage of safe browsing navigation oberver manager. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/download_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index bd74a18665d0af6060544d040ab74cc94e331f1d..cc34930f95ae5da4d718050233bcc952f30bcbf4 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -1358,10 +1358,9 @@ class DownloadProtectionService::PPAPIDownloadRequest
*(request.add_alternate_extensions()) =
base::FilePath(default_file_path_.FinalExtension()).AsUTF8Unsafe();
}
- service_->AddReferrerChainToClientDownloadRequest(
- requestor_url_,
- nullptr,
- &request);
+
+ // TODO(676691): We should add reliable download referrer chain for PPAPI
+ // downloads too.
if (!request.SerializeToString(&client_download_request_data_)) {
// More of an internal error than anything else. Note that the UNKNOWN
@@ -1821,7 +1820,7 @@ void DownloadProtectionService::AddReferrerChainToClientDownloadRequest(
"SafeBrowsing.ReferrerAttributionResult.DownloadAttribution", result,
SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX);
for (auto entry : attribution_chain)
- *out_request->add_referrer_chain() = std::move(entry);
+ out_request->add_referrer_chain()->Swap(&entry);
}
} // namespace safe_browsing
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698