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

Issue 1193303002: base/threading: restrict to set only current thread priority (Closed)

Created:
5 years, 6 months ago by Takashi Toyoshima
Modified:
5 years, 5 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, jam, enne (OOO), Nico
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

base/threading: restrict to set only current thread priority On some platforms, e.g., Linux, changing other thread's priority is not permitted by sandbox mechanisms for a security reason. Since there are no real use cases that really need to change another thread's priority for now, I'll replace the base API with the one that change the current thread priority to avoid confusion. BUG=468793, 505474 TEST=base_unittests TEST=sudo base_unittests --gtest_filter='Thread*' TEST=git cl try Committed: https://crrev.com/7c0e19558a837263c1c447a237b699f1fd17c7ee Cr-Commit-Position: refs/heads/master@{#338661}

Patch Set 1 #

Patch Set 2 : android and mac fix #

Total comments: 4

Patch Set 3 : two more android fix and review #2 #

Total comments: 29

Patch Set 4 : gab's review (though it sill contains parts that are split to others) #

Patch Set 5 : rebase (win and linux changes are removed) #

Patch Set 6 : rebase (hide compositor change) #

Patch Set 7 : s/CurrentHandle().id()/CurrentId()/ #

Patch Set 8 : (rebase for review) #

Total comments: 14

Patch Set 9 : #21, git cl format, fix win build #

Total comments: 6

Patch Set 10 : fix nits (#24) #

Total comments: 2

Patch Set 11 : rebase, review #29 #

Total comments: 2

Patch Set 12 : rebase only #

Patch Set 13 : run the last test in a separate thread #

Total comments: 8

Patch Set 14 : review #48 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+157 lines, -192 lines) Patch
M base/threading/platform_thread.h View 1 2 3 11 4 chunks +12 lines, -12 lines 0 comments Download
M base/threading/platform_thread_android.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -6 lines 0 comments Download
M base/threading/platform_thread_freebsd.cc View 2 chunks +2 lines, -8 lines 0 comments Download
M base/threading/platform_thread_internal_posix.h View 1 2 3 1 chunk +9 lines, -11 lines 0 comments Download
M base/threading/platform_thread_linux.cc View 1 2 3 4 3 chunks +3 lines, -9 lines 0 comments Download
M base/threading/platform_thread_mac.mm View 2 chunks +4 lines, -4 lines 0 comments Download
M base/threading/platform_thread_posix.cc View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -23 lines 0 comments Download
M base/threading/platform_thread_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +95 lines, -98 lines 0 comments Download
M base/threading/platform_thread_win.cc View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -13 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M content/gpu/gpu_child_thread.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M content/renderer/gpu/compositor_output_surface.cc View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 54 (17 generated)
Lei Zhang
looking good https://codereview.chromium.org/1193303002/diff/20001/base/threading/platform_thread_internal_posix.h File base/threading/platform_thread_internal_posix.h (right): https://codereview.chromium.org/1193303002/diff/20001/base/threading/platform_thread_internal_posix.h#newcode34 base/threading/platform_thread_internal_posix.h:34: // Returns true if there is a ...
5 years, 6 months ago (2015-06-23 05:20:08 UTC) #2
Takashi Toyoshima
https://codereview.chromium.org/1193303002/diff/20001/base/threading/platform_thread_internal_posix.h File base/threading/platform_thread_internal_posix.h (right): https://codereview.chromium.org/1193303002/diff/20001/base/threading/platform_thread_internal_posix.h#newcode34 base/threading/platform_thread_internal_posix.h:34: // Returns true if there is a platform-specific ThreadPriority ...
5 years, 6 months ago (2015-06-23 11:42:22 UTC) #3
Takashi Toyoshima
+kbr@ for content/renderer/gpu since I'm applying non-mechanical changes on compositor_output_surface.cc.
5 years, 6 months ago (2015-06-23 11:46:21 UTC) #5
gab
lg https://codereview.chromium.org/1193303002/diff/40001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/1193303002/diff/40001/base/threading/platform_thread.h#newcode194 base/threading/platform_thread.h:194: // Toggles the current thread's priority at runtime. ...
5 years, 6 months ago (2015-06-23 17:01:33 UTC) #7
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/1193303002/diff/40001/content/renderer/gpu/compositor_output_surface.h File content/renderer/gpu/compositor_output_surface.h (right): https://codereview.chromium.org/1193303002/diff/40001/content/renderer/gpu/compositor_output_surface.h#newcode109 content/renderer/gpu/compositor_output_surface.h:109: scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_; On 2015/06/23 17:01:32, gab wrote: > Please ...
5 years, 6 months ago (2015-06-23 21:08:40 UTC) #8
Ken Russell (switch to Gerrit)
Also, +enne, who's a better reviewer for compositor_output_surface than me.
5 years, 6 months ago (2015-06-23 21:09:23 UTC) #10
Takashi Toyoshima
Here is a separated CL for the CompositorOutputSurface. https://codereview.chromium.org/1205783002/ I added enne@ for the CL ...
5 years, 6 months ago (2015-06-24 02:17:34 UTC) #11
Takashi Toyoshima
Another separated CL for a bug sticking to READLTIME_AUDIO. https://codereview.chromium.org/1205703005/
5 years, 6 months ago (2015-06-24 03:26:05 UTC) #12
Takashi Toyoshima
Thank you gab. I uploaded a new patch set that fix your points. But it ...
5 years, 6 months ago (2015-06-24 04:15:39 UTC) #13
Takashi Toyoshima
FYI, here is a split CL for Windows https://codereview.chromium.org/1199313004/
5 years, 6 months ago (2015-06-24 04:54:22 UTC) #14
gab
Thanks, please ping after rebasing and I'll do another round then. https://codereview.chromium.org/1193303002/diff/40001/base/threading/platform_thread_unittest.cc File base/threading/platform_thread_unittest.cc (right): ...
5 years, 5 months ago (2015-06-25 14:49:00 UTC) #16
Ken Russell (switch to Gerrit)
content/gpu and content/renderer/gpu lgtm
5 years, 5 months ago (2015-06-25 21:40:21 UTC) #17
Takashi Toyoshima
gab@, now child CLs were submitted and this main CL was rebased to be ready ...
5 years, 5 months ago (2015-06-26 12:28:53 UTC) #18
Takashi Toyoshima
+jam especially for content/browser where no one reviewed.
5 years, 5 months ago (2015-06-26 12:32:37 UTC) #20
gab
lg, mostly nits + desire to get tests for Android for all priority levels but ...
5 years, 5 months ago (2015-06-26 15:57:13 UTC) #21
Takashi Toyoshima
https://codereview.chromium.org/1193303002/diff/40001/base/threading/platform_thread_unittest.cc File base/threading/platform_thread_unittest.cc (left): https://codereview.chromium.org/1193303002/diff/40001/base/threading/platform_thread_unittest.cc#oldcode185 base/threading/platform_thread_unittest.cc:185: ThreadPriority::NORMAL Oh, that's right. I missed the point that ...
5 years, 5 months ago (2015-06-29 05:48:51 UTC) #23
gab
lgtm w/ nits, please add to the CL description why this change is required (for ...
5 years, 5 months ago (2015-06-29 13:04:00 UTC) #24
Takashi Toyoshima
Thanks, gab. I'll wait for the final OWNERS stamp from jam@ https://codereview.chromium.org/1193303002/diff/160013/base/threading/platform_thread_unittest.cc File base/threading/platform_thread_unittest.cc (right): ...
5 years, 5 months ago (2015-06-29 16:21:11 UTC) #25
Takashi Toyoshima
hum, jam@ seems to be in vacation. kinuko@ can you give me a stamp for ...
5 years, 5 months ago (2015-07-02 05:37:15 UTC) #27
kinuko
content/ changes lgtm. It'd be still good to get clear l/g/t/m for base/ changes though.
5 years, 5 months ago (2015-07-02 05:46:07 UTC) #28
kinuko
one nit https://codereview.chromium.org/1193303002/diff/200001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/1193303002/diff/200001/base/threading/platform_thread.h#newcode92 base/threading/platform_thread.h:92: // TODO(toyoshim): Remove id() and use PlatformThread::CurrentId() ...
5 years, 5 months ago (2015-07-02 05:46:48 UTC) #29
Takashi Toyoshima
https://codereview.chromium.org/1193303002/diff/200001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/1193303002/diff/200001/base/threading/platform_thread.h#newcode92 base/threading/platform_thread.h:92: // TODO(toyoshim): Remove id() and use PlatformThread::CurrentId() instead. Done. ...
5 years, 5 months ago (2015-07-02 07:40:23 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1193303002/220001
5 years, 5 months ago (2015-07-02 07:43:09 UTC) #33
kinuko
On 2015/07/02 07:43:09, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
5 years, 5 months ago (2015-07-02 07:48:37 UTC) #34
kinuko
On 2015/07/02 07:48:37, kinuko wrote: > On 2015/07/02 07:43:09, commit-bot: I haz the power wrote: ...
5 years, 5 months ago (2015-07-02 07:50:18 UTC) #36
Takashi Toyoshima
ok, let me add Nico for base since Lei has been OOO.
5 years, 5 months ago (2015-07-02 08:14:33 UTC) #38
Takashi Toyoshima
Lei Zhang: ping for the remaining base/ OWNERS review.
5 years, 5 months ago (2015-07-14 02:27:56 UTC) #39
Nico
Sorry, feel free to ping me much sooner if I don't respond. https://codereview.chromium.org/1193303002/diff/220001/base/threading/platform_thread_unittest.cc File base/threading/platform_thread_unittest.cc ...
5 years, 5 months ago (2015-07-14 04:53:33 UTC) #42
Takashi Toyoshima
Thank you Nico. I'll try creating a new patch set to run the test in ...
5 years, 5 months ago (2015-07-14 05:21:41 UTC) #43
Takashi Toyoshima
oops, my comment was not published. https://codereview.chromium.org/1193303002/diff/220001/base/threading/platform_thread_unittest.cc File base/threading/platform_thread_unittest.cc (right): https://codereview.chromium.org/1193303002/diff/220001/base/threading/platform_thread_unittest.cc#newcode234 base/threading/platform_thread_unittest.cc:234: PlatformThread::SetCurrentThreadPriority(ThreadPriority::NORMAL); That's true. ...
5 years, 5 months ago (2015-07-14 05:22:17 UTC) #44
Lei Zhang
On 2015/07/14 05:21:41, Takashi Toyoshima (chromium) wrote: > Thank you Nico. I'll try creating a ...
5 years, 5 months ago (2015-07-14 05:36:26 UTC) #46
Takashi Toyoshima
Nico, and Lei: PTAL Patch Set 13.
5 years, 5 months ago (2015-07-14 06:04:24 UTC) #47
Lei Zhang
lgtm with some comments. https://codereview.chromium.org/1193303002/diff/280001/base/threading/platform_thread_unittest.cc File base/threading/platform_thread_unittest.cc (right): https://codereview.chromium.org/1193303002/diff/280001/base/threading/platform_thread_unittest.cc#newcode82 base/threading/platform_thread_unittest.cc:82: // Grabs |thread_id_|, runs tests, ...
5 years, 5 months ago (2015-07-14 07:54:20 UTC) #48
Takashi Toyoshima
Thanks! https://codereview.chromium.org/1193303002/diff/280001/base/threading/platform_thread_unittest.cc File base/threading/platform_thread_unittest.cc (right): https://codereview.chromium.org/1193303002/diff/280001/base/threading/platform_thread_unittest.cc#newcode82 base/threading/platform_thread_unittest.cc:82: // Grabs |thread_id_|, runs tests, signals |termination_ready_|, and ...
5 years, 5 months ago (2015-07-14 08:03:23 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1193303002/300001
5 years, 5 months ago (2015-07-14 08:06:34 UTC) #52
commit-bot: I haz the power
Committed patchset #14 (id:300001)
5 years, 5 months ago (2015-07-14 09:42:13 UTC) #53
commit-bot: I haz the power
5 years, 5 months ago (2015-07-14 09:43:14 UTC) #54
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/7c0e19558a837263c1c447a237b699f1fd17c7ee
Cr-Commit-Position: refs/heads/master@{#338661}

Powered by Google App Engine
This is Rietveld 408576698