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

Unified Diff: content/common/quarantine/quarantine_win.cc

Issue 2890853002: Downloads: replace BrowserThread::FILE with task scheduler. (Closed)
Patch Set: Add scoped COM initialization to quench a couple of assertion failures. Created 3 years, 5 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/common/quarantine/quarantine_win.cc
diff --git a/content/common/quarantine/quarantine_win.cc b/content/common/quarantine/quarantine_win.cc
index 3feb1966af8854527e17aa2f195465ce6cdcd720..1c5d0fc9b24f1c164d12250c29c32060fa7a30d1 100644
--- a/content/common/quarantine/quarantine_win.cc
+++ b/content/common/quarantine/quarantine_win.cc
@@ -25,6 +25,7 @@
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
+#include "base/win/scoped_com_initializer.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_handle.h"
#include "url/gurl.h"
@@ -302,6 +303,10 @@ QuarantineFileResult QuarantineFile(const base::FilePath& file,
const std::string& client_guid) {
base::ThreadRestrictions::AssertIOAllowed();
+ // TODO(siggi): As this is a rare operation, this seems better than putting
Sigurður Ásgeirsson 2017/07/20 12:36:34 Gab: there are two places where downloading needs
robliao 2017/07/20 18:29:17 I was actually thinking about making ScopedCOMInit
Sigurður Ásgeirsson 2017/07/20 19:48:15 I'm not sure, but I'm pretty sure it's out of scop
robliao 2017/07/20 20:15:53 Dropping all of downloads in a COM STA sounds fine
+ // all download activity on a COM STA sequence.
+ base::win::ScopedCOMInitializer com_initializer;
+
int64_t file_size = 0;
if (!base::PathExists(file) || !base::GetFileSize(file, &file_size))
return QuarantineFileResult::FILE_MISSING;

Powered by Google App Engine
This is Rietveld 408576698