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

Issue 8965072: Add function support for Sleep and MessageLoop with TimeDelta input. (Closed)

Created:
8 years, 12 months ago by Ted Vessenes
Modified:
8 years, 12 months ago
Reviewers:
brettw
CC:
chromium-reviews, Paweł Hajdan Jr.
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add function support for Sleep with TimeDelta input. This is the first step of fixing issue 108171 (converting calls of Sleep() to use TimeDelta instead of ints in milliseconds). I checked platform_thread_unittests.cc for any tests explicitly for Sleep but found none, so I didn't add any for this interface. There will be a bit more implementation juggling here once the Sleep(int ms) interface is removed, but that's coming in a later CL. BUG=108171 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=116012

Patch Set 1 #

Patch Set 2 : Add TimeDelay interfaces for message loop code. #

Total comments: 2

Patch Set 3 : Reimplement posix Sleep(ms) in terms of Sleep(TimeDelta). #

Total comments: 1

Patch Set 4 : Fix comment spacing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -9 lines) Patch
M base/message_loop.h View 1 3 chunks +20 lines, -0 lines 0 comments Download
M base/message_loop.cc View 1 2 5 chunks +30 lines, -1 line 0 comments Download
M base/threading/platform_thread.h View 2 chunks +4 lines, -0 lines 0 comments Download
M base/threading/platform_thread_posix.cc View 1 2 3 1 chunk +13 lines, -6 lines 0 comments Download
M base/threading/platform_thread_win.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M base/threading/thread_unittest.cc View 1 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Ted Vessenes
I added interfaces for Sleep and MessageLoop with TimeDelta. This is the first step. Next ...
8 years, 12 months ago (2011-12-28 05:40:58 UTC) #1
brettw
http://codereview.chromium.org/8965072/diff/2001/base/message_loop.cc File base/message_loop.cc (right): http://codereview.chromium.org/8965072/diff/2001/base/message_loop.cc#newcode330 base/message_loop.cc:330: const tracked_objects::Location& from_here, const base::Closure& task, The closure should ...
8 years, 12 months ago (2011-12-28 20:10:27 UTC) #2
Ted Vessenes
I think it's reasonable to support microsecond level sleeping if that's what people want to ...
8 years, 12 months ago (2011-12-29 20:10:10 UTC) #3
brettw
lgtm http://codereview.chromium.org/8965072/diff/5001/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (right): http://codereview.chromium.org/8965072/diff/5001/base/threading/platform_thread_posix.cc#newcode169 base/threading/platform_thread_posix.cc:169: sleep_time.tv_nsec = duration.InMicroseconds() * 1000; // nanoseconds Two ...
8 years, 12 months ago (2011-12-29 23:16:45 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tedvessenes@gmail.com/8965072/10001
8 years, 12 months ago (2011-12-29 23:47:15 UTC) #5
commit-bot: I haz the power
8 years, 12 months ago (2011-12-30 01:04:37 UTC) #6
Change committed as 116012

Powered by Google App Engine
This is Rietveld 408576698