Chromium Code Reviews| Index: components/feedback/feedback_data.cc |
| diff --git a/components/feedback/feedback_data.cc b/components/feedback/feedback_data.cc |
| index 215e07dce6cb99abc6fd10e5769cd2bee6a17d9a..2581fb291a9efd2fba5390a9d1d24dc8bb0d15af 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,10 @@ 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().WithPriority(base::TaskPriority::BACKGROUND), |
|
afakhry
2017/05/03 16:38:36
Why doesn't this have the .MayBlock() like the oth
fdoray
2017/05/03 16:41:30
Done.
|
| + base::Bind(&FeedbackData::CompressLogs, this), |
| base::Bind(&FeedbackData::OnCompressComplete, this)); |
| } |
| } |
| @@ -76,8 +79,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 +98,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)); |
| } |