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

Unified Diff: content/browser/download/base_file_win.cc

Issue 21355004: [Downloads] Move client guid for AV scanning of downloaded files to chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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
« no previous file with comments | « content/browser/download/base_file.cc ('k') | content/browser/download/download_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/base_file_win.cc
diff --git a/content/browser/download/base_file_win.cc b/content/browser/download/base_file_win.cc
index 398e5fc214ff4c80201048dbe376435d9afe0fcb..252f0495d7da5ba1446d1a9a766849e873fc37dc 100644
--- a/content/browser/download/base_file_win.cc
+++ b/content/browser/download/base_file_win.cc
@@ -5,9 +5,12 @@
#include "content/browser/download/base_file.h"
#include <windows.h>
+#include <cguid.h>
+#include <objbase.h>
#include <shellapi.h>
#include "base/file_util.h"
+#include "base/guid.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
@@ -326,7 +329,16 @@ DownloadInterruptReason BaseFile::AnnotateWithSourceInformation() {
bound_net_log_.BeginEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED);
DownloadInterruptReason result = DOWNLOAD_INTERRUPT_REASON_NONE;
- HRESULT hr = ScanAndSaveDownloadedFile(full_path_, source_url_);
+ std::string braces_guid = "{" + client_guid_ + "}";
+ GUID guid = GUID_NULL;
+ if (base::IsValidGUID(client_guid_)) {
+ HRESULT hr = CLSIDFromString(
+ base::UTF8ToUTF16(braces_guid).c_str(), &guid);
+ if (FAILED(hr))
+ guid = GUID_NULL;
+ }
+
+ HRESULT hr = AVScanFile(full_path_, source_url_.spec(), guid);
// If the download file is missing after the call, then treat this as an
// interrupted download.
« no previous file with comments | « content/browser/download/base_file.cc ('k') | content/browser/download/download_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698