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

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: Remove safe_util_win 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
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..f31216019c2a7dd7281dea80725ef518b39c1fef 100644
--- a/content/browser/download/base_file_win.cc
+++ b/content/browser/download/base_file_win.cc
@@ -4,16 +4,18 @@
#include "content/browser/download/base_file.h"
+#include <objbase.h>
#include <windows.h>
Lei Zhang 2013/08/07 01:03:05 nit: I think <windows.h> usually goes first?
Greg Billock 2013/08/07 17:00:56 we got some of both. I'll change it here though.
+#include <cguid.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"
#include "content/browser/download/download_interrupt_reasons_impl.h"
#include "content/browser/download/download_stats.h"
-#include "content/browser/safe_util_win.h"
#include "content/public/browser/browser_thread.h"
namespace content {
@@ -326,7 +328,14 @@ 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_);
+ GUID guid = GUID_NULL;
+ if (!client_guid_.empty() && base::IsValidGUID(client_guid_)) {
asanka 2013/08/07 16:42:36 Skip this validation step and just DCHECK the retu
Greg Billock 2013/08/07 17:42:56 I wasn't sure what bad thing CLSIDFromString might
+ HRESULT hr = CLSIDFromString(
asanka 2013/08/07 16:42:36 Have you looked at using UuidFromString() instead?
Greg Billock 2013/08/07 17:42:56 I saw UuidFromString(), but it isn't used elsewher
asanka 2013/08/07 19:56:12 I don't consider myself to be an expert on this, s
Greg Billock 2013/08/07 23:10:31 Tried UuidFromString. This is part of the RPC libr
+ base::UTF8ToUTF16(client_guid_).c_str(), &guid);
+ if (FAILED(hr))
+ guid = GUID_NULL;
+ }
+ HRESULT hr = base::AVScanFile(full_path_, source_url_.spec(), guid);
// If the download file is missing after the call, then treat this as an
// interrupted download.

Powered by Google App Engine
This is Rietveld 408576698