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

Issue 2379913004: Do not call SequencedWorkerPool::GetWorkerPoolForCurrentThread() from CollectEnvironmentData(). (Closed)

Created:
4 years, 2 months ago by fdoray
Modified:
4 years, 2 months ago
Reviewers:
gab, grt (UTC plus 2)
CC:
chromium-reviews, grt+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not call SequencedWorkerPool::GetWorkerPoolForCurrentThread() from CollectEnvironmentData(). SequencedWorkerPool::GetWorkerPoolForCurrentThread() returns nullptr when called from a SequencedWorkerPool task redirected to the TaskScheduler. Note: Code archeology reveals that a reviewer asked to use SequencedWorkerPool::GetWorkerPoolForCurrentThread() instead of content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread() to avoid a dependance on BrowserThread. I think it's better to temporarily introduce a dependance on BrowserThread with this CL than to make SequencedWorkerPool::GetWorkerPoolForCurrentThread() work from SequencedWorkerPool tasks redirected to TaskScheduler just for this call site. https://codereview.chromium.org/1505813003/diff/20001/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc#newcode68 BUG=622400 Committed: https://crrev.com/fdb23ec2e44b83f4fc8debbdb43ed5775cb5d92d Cr-Commit-Position: refs/heads/master@{#422118}

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -1 line) Patch
M chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc View 3 chunks +5 lines, -1 line 3 comments Download

Messages

Total messages: 14 (6 generated)
fdoray
PTAL
4 years, 2 months ago (2016-09-30 13:35:20 UTC) #2
grt (UTC plus 2)
yeah, okay. :-) i like how this will go away in the future. lgtm.
4 years, 2 months ago (2016-09-30 13:55:57 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2379913004/20001
4 years, 2 months ago (2016-09-30 14:38:33 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 2 months ago (2016-09-30 15:25:34 UTC) #9
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/fdb23ec2e44b83f4fc8debbdb43ed5775cb5d92d Cr-Commit-Position: refs/heads/master@{#422118}
4 years, 2 months ago (2016-09-30 15:31:04 UTC) #11
gab
https://codereview.chromium.org/2379913004/diff/20001/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc File chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc (right): https://codereview.chromium.org/2379913004/diff/20001/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc#newcode73 chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc:73: DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); I think such a call site once again ...
4 years, 2 months ago (2016-09-30 15:48:56 UTC) #12
gab
https://codereview.chromium.org/2379913004/diff/20001/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc File chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc (right): https://codereview.chromium.org/2379913004/diff/20001/chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc#newcode73 chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc:73: DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); Thinking about this some more, WDYT of DCHECK(!base::ThreadTaskRunnerHandle::IsSet()); ...
4 years, 2 months ago (2016-09-30 19:21:04 UTC) #13
gab
4 years, 2 months ago (2016-10-03 19:47:34 UTC) #14
Message was sent while issue was closed.
https://codereview.chromium.org/2379913004/diff/20001/chrome/browser/safe_bro...
File
chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc
(right):

https://codereview.chromium.org/2379913004/diff/20001/chrome/browser/safe_bro...
chrome/browser/safe_browsing/incident_reporting/environment_data_collection.cc:73:
DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
On 2016/09/30 19:21:03, gab wrote:
> Thinking about this some more, WDYT of
> DCHECK(!base::ThreadTaskRunnerHandle::IsSet()); here? That would also match
> "only makes sense in a thread pool" which is really  meant to say "doesn't
make
> sense in a single-threaded environment"

ping ^^?

Powered by Google App Engine
This is Rietveld 408576698