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

Issue 673833002: scheduler: Don't access weak pointers on foreign threads (Closed)

Created:
6 years, 2 months ago by Sami
Modified:
6 years, 2 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, mkwst+moarreviews-renderer_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

scheduler: Don't access weak pointers on foreign threads The Task Queue Manager previously would give clients a SingleThreadTaskRunner which held a weak pointer back to the manager in order to post tasks. This is wrong because the task runner and hence the weak pointer may be accessed from arbitrary threads, which is not safe. This patch corrects the problem by combining the task runner and the incoming task queue into a single task queue object which owns both the incoming task as well as the pointer back to the task queue manager. This allows us to protect the incoming task queue and the pointer using the same lock. BUG=391005 Committed: https://crrev.com/b03818a3791ae90d3cf7014de69bfe44f831d192 Cr-Commit-Position: refs/heads/master@{#301085}

Patch Set 1 #

Patch Set 2 : Added test. #

Total comments: 6

Patch Set 3 : Ross's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+183 lines, -119 lines) Patch
M content/renderer/scheduler/task_queue_manager.h View 5 chunks +10 lines, -15 lines 0 comments Download
M content/renderer/scheduler/task_queue_manager.cc View 1 2 6 chunks +146 lines, -104 lines 0 comments Download
M content/renderer/scheduler/task_queue_manager_unittest.cc View 1 2 chunks +27 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Sami
Ross, could you do the first pass here? I ended up having to shuffle things ...
6 years, 2 months ago (2014-10-23 17:46:41 UTC) #2
rmcilroy
Overall looks good, thanks. A couple of comments. https://codereview.chromium.org/673833002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/673833002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode37 content/renderer/scheduler/task_queue_manager.cc:37: void ...
6 years, 2 months ago (2014-10-24 09:36:41 UTC) #3
Sami
Thanks for the review! https://codereview.chromium.org/673833002/diff/20001/content/renderer/scheduler/task_queue_manager.cc File content/renderer/scheduler/task_queue_manager.cc (right): https://codereview.chromium.org/673833002/diff/20001/content/renderer/scheduler/task_queue_manager.cc#newcode37 content/renderer/scheduler/task_queue_manager.cc:37: void PumpQueueLocked(); On 2014/10/24 09:36:41, ...
6 years, 2 months ago (2014-10-24 09:59:12 UTC) #4
rmcilroy
On 2014/10/24 09:59:12, Sami wrote: > Thanks for the review! > > https://codereview.chromium.org/673833002/diff/20001/content/renderer/scheduler/task_queue_manager.cc > File ...
6 years, 2 months ago (2014-10-24 11:08:51 UTC) #5
Sami
Here's another scheduler patch. It looks scarier than it is -- honest! :) It effectively ...
6 years, 2 months ago (2014-10-24 11:11:37 UTC) #7
jochen (gone - plz use gerrit)
rubberstamp lgtm
6 years, 2 months ago (2014-10-24 11:42:51 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/673833002/40001
6 years, 2 months ago (2014-10-24 11:53:47 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
6 years, 2 months ago (2014-10-24 12:39:11 UTC) #11
commit-bot: I haz the power
6 years, 2 months ago (2014-10-24 12:39:56 UTC) #12
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/b03818a3791ae90d3cf7014de69bfe44f831d192
Cr-Commit-Position: refs/heads/master@{#301085}

Powered by Google App Engine
This is Rietveld 408576698