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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc

Issue 2379913004: Do not call SequencedWorkerPool::GetWorkerPoolForCurrentThread() from CollectEnvironmentData(). (Closed)
Patch Set: rebase Created 4 years, 3 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: 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 0d0b7d308833718e4e2baaf68d16d39b7368e9db..97b8344ebb214f88742d46392447ee5a52771b37 100644
--- a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/cpu.h"
+#include "base/logging.h"
#include "base/sys_info.h"
#include "base/threading/platform_thread.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -16,6 +17,7 @@
#include "chrome/common/channel_info.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "components/version_info/version_info.h"
+#include "content/public/browser/browser_thread.h"
namespace safe_browsing {
@@ -68,8 +70,10 @@ void CollectProcessData(ClientIncidentReport_EnvironmentData_Process* process) {
void CollectEnvironmentData(ClientIncidentReport_EnvironmentData* data) {
// Toggling priority only makes sense in a thread pool.
- DCHECK(base::SequencedWorkerPool::GetWorkerPoolForCurrentThread());
+ DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
gab 2016/09/30 15:48:56 I think such a call site once again argues for som
gab 2016/09/30 19:21:03 Thinking about this some more, WDYT of DCHECK(!bas
gab 2016/10/03 19:47:34 ping ^^?
// Reset priority when done with this task.
+ // TODO(fdoray): Post this task to the TaskScheduler with a BACKGROUND
+ // priority instead of toggling the priority within the task.
base::ScopedClosureRunner restore_priority(
base::Bind(&base::PlatformThread::SetCurrentThreadPriority,
base::PlatformThread::GetCurrentThreadPriority()));
« 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