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

Unified Diff: components/feedback/feedback_data.cc

Issue 2773473002: Use TaskScheduler instead of blocking pool in feedback_data.cc. (Closed)
Patch Set: MayBlock Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/feedback/feedback_data.cc
diff --git a/components/feedback/feedback_data.cc b/components/feedback/feedback_data.cc
index 215e07dce6cb99abc6fd10e5769cd2bee6a17d9a..f73b1d484960a6a5d5f12b72a1758d9d70a40f78 100644
--- a/components/feedback/feedback_data.cc
+++ b/components/feedback/feedback_data.cc
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/task_scheduler/post_task.h"
#include "base/values.h"
#include "components/feedback/feedback_util.h"
#include "components/feedback/tracing_manager.h"
@@ -63,8 +64,11 @@ void FeedbackData::SetAndCompressSystemInfo(
if (sys_info) {
++pending_op_count_;
AddLogs(std::move(sys_info));
- BrowserThread::PostBlockingPoolTaskAndReply(
- FROM_HERE, base::Bind(&FeedbackData::CompressLogs, this),
+ base::PostTaskWithTraitsAndReply(
+ FROM_HERE,
+ base::TaskTraits().MayBlock().WithPriority(
+ base::TaskPriority::BACKGROUND),
+ base::Bind(&FeedbackData::CompressLogs, this),
base::Bind(&FeedbackData::OnCompressComplete, this));
}
}
@@ -76,8 +80,10 @@ void FeedbackData::SetAndCompressHistograms(
if (!histograms)
return;
++pending_op_count_;
- BrowserThread::PostBlockingPoolTaskAndReply(
+ base::PostTaskWithTraitsAndReply(
FROM_HERE,
+ base::TaskTraits().MayBlock().WithPriority(
+ base::TaskPriority::BACKGROUND),
base::Bind(&FeedbackData::CompressFile, this,
base::FilePath(kHistogramsFilename), kHistogramsAttachmentName,
base::Passed(&histograms)),
@@ -93,9 +99,12 @@ void FeedbackData::AttachAndCompressFileData(
++pending_op_count_;
base::FilePath attached_file =
base::FilePath::FromUTF8Unsafe(attached_filename_);
- BrowserThread::PostBlockingPoolTaskAndReply(
- FROM_HERE, base::Bind(&FeedbackData::CompressFile, this, attached_file,
- std::string(), base::Passed(&attached_filedata)),
+ base::PostTaskWithTraitsAndReply(
+ FROM_HERE,
+ base::TaskTraits().MayBlock().WithPriority(
+ base::TaskPriority::BACKGROUND),
+ base::Bind(&FeedbackData::CompressFile, this, attached_file,
+ std::string(), base::Passed(&attached_filedata)),
base::Bind(&FeedbackData::OnCompressComplete, this));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698