Chromium Code Reviews| Index: chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc |
| diff --git a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc |
| index f207502a3ac742370b8253646d1c654def211c02..10c3b6c1f254c1564ba026c466ad86587f6e9603 100644 |
| --- a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc |
| +++ b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/cpu.h" |
| #include "base/sys_info.h" |
| +#include "base/threading/platform_thread.h" |
| #include "chrome/common/channel_info.h" |
| #include "chrome/common/safe_browsing/csd.pb.h" |
| #include "components/version_info/version_info.h" |
| @@ -62,6 +63,11 @@ void CollectProcessData(ClientIncidentReport_EnvironmentData_Process* process) { |
| } // namespace |
| void CollectEnvironmentData(ClientIncidentReport_EnvironmentData* data) { |
| + // Lower priority for this task. |
|
gab
2015/12/08 16:21:33
If we're going to do this I think we should add:
proberge
2015/12/08 16:39:03
Done.
|
| + auto previous_priority = base::PlatformThread::GetCurrentThreadPriority(); |
| + base::PlatformThread::SetCurrentThreadPriority( |
| + base::ThreadPriority::BACKGROUND); |
| + |
| // OS |
| { |
| ClientIncidentReport_EnvironmentData_OS* os = data->mutable_os(); |
| @@ -82,6 +88,9 @@ void CollectEnvironmentData(ClientIncidentReport_EnvironmentData* data) { |
| // Process |
| CollectProcessData(data->mutable_process()); |
| + |
| + // Reset the thread priority. |
| + base::PlatformThread::SetCurrentThreadPriority(previous_priority); |
| } |
| #if !defined(OS_WIN) |