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

Issue 296043005: cc: Add UniqueNotifier to cc/base. (Closed)

Created:
6 years, 7 months ago by vmpstr
Modified:
6 years, 6 months ago
Reviewers:
reveman
CC:
chromium-reviews, cc-bugs_chromium.org
Visibility:
Public.

Description

cc: Add UniqueNotifier to cc/base. This patch adds a unique notifier, a class that supports scheduling a callback. It also supports calling additional schedules which effectively cancel a previous callback and reschedule a new one. Both version with delayed tasks and immediate tasks are supported. R=reveman BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273433

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : typo #

Total comments: 6

Patch Set 4 : split delayed #

Total comments: 5

Patch Set 5 : update #

Total comments: 2

Patch Set 6 : update #

Total comments: 1

Patch Set 7 : add cancel #

Total comments: 8

Patch Set 8 : update #

Total comments: 11

Patch Set 9 : #

Patch Set 10 : #

Total comments: 7

Patch Set 11 : #

Patch Set 12 : update #

Patch Set 13 : #

Total comments: 4

Patch Set 14 : update #

Unified diffs Side-by-side diffs Delta from patch set Stats (+543 lines, -0 lines) Patch
A cc/base/delayed_unique_notifier.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +58 lines, -0 lines 0 comments Download
A cc/base/delayed_unique_notifier.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +74 lines, -0 lines 0 comments Download
A cc/base/delayed_unique_notifier_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +257 lines, -0 lines 0 comments Download
A cc/base/unique_notifier.h View 1 2 3 1 chunk +44 lines, -0 lines 0 comments Download
A cc/base/unique_notifier.cc View 1 2 3 1 chunk +42 lines, -0 lines 0 comments Download
A cc/base/unique_notifier_unittest.cc View 1 2 3 4 5 1 chunk +62 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M cc/cc_tests.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
vmpstr
Please take a look when you have time. I was kind of working with the ...
6 years, 7 months ago (2014-05-20 19:54:52 UTC) #1
reveman
It would be nice if we could also use this in ThreadProxy::RenewTreePriority. https://codereview.chromium.org/296043005/diff/40001/cc/base/unique_notifier.cc File cc/base/unique_notifier.cc ...
6 years, 7 months ago (2014-05-21 17:03:36 UTC) #2
vmpstr
PTAL https://codereview.chromium.org/296043005/diff/40001/cc/base/unique_notifier.cc File cc/base/unique_notifier.cc (right): https://codereview.chromium.org/296043005/diff/40001/cc/base/unique_notifier.cc#newcode26 cc/base/unique_notifier.cc:26: weak_ptr_factory_.InvalidateWeakPtrs(); On 2014/05/21 17:03:37, reveman wrote: > No ...
6 years, 7 months ago (2014-05-21 17:41:01 UTC) #3
reveman
https://codereview.chromium.org/296043005/diff/50001/cc/base/unique_notifier_unittest.cc File cc/base/unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/50001/cc/base/unique_notifier_unittest.cc#newcode39 cc/base/unique_notifier_unittest.cc:39: run_loop_->Run(); I think you can replace all this with: ...
6 years, 7 months ago (2014-05-21 18:08:31 UTC) #4
vmpstr
PTAL https://codereview.chromium.org/296043005/diff/50001/cc/base/unique_notifier_unittest.cc File cc/base/unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/50001/cc/base/unique_notifier_unittest.cc#newcode39 cc/base/unique_notifier_unittest.cc:39: run_loop_->Run(); On 2014/05/21 18:08:31, reveman wrote: > I ...
6 years, 7 months ago (2014-05-21 18:54:53 UTC) #5
reveman
https://codereview.chromium.org/296043005/diff/50001/cc/base/unique_notifier_unittest.cc File cc/base/unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/50001/cc/base/unique_notifier_unittest.cc#newcode70 cc/base/unique_notifier_unittest.cc:70: notifier_->Schedule(); I liked this part of test. Could you ...
6 years, 7 months ago (2014-05-21 19:42:44 UTC) #6
vmpstr
PTAL.
6 years, 7 months ago (2014-05-21 19:57:59 UTC) #7
reveman
https://codereview.chromium.org/296043005/diff/90001/cc/base/delayed_unique_notifier_unittest.cc File cc/base/delayed_unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/90001/cc/base/delayed_unique_notifier_unittest.cc#newcode28 cc/base/delayed_unique_notifier_unittest.cc:28: void RunForTime(base::TimeDelta delay) { RunLoop::RunUntilIdle() doesn't wait for delayed ...
6 years, 7 months ago (2014-05-21 20:01:56 UTC) #8
vmpstr
On 2014/05/21 20:01:56, reveman wrote: > https://codereview.chromium.org/296043005/diff/90001/cc/base/delayed_unique_notifier_unittest.cc > File cc/base/delayed_unique_notifier_unittest.cc (right): > > https://codereview.chromium.org/296043005/diff/90001/cc/base/delayed_unique_notifier_unittest.cc#newcode28 > ...
6 years, 7 months ago (2014-05-21 20:02:51 UTC) #9
reveman
On 2014/05/21 20:02:51, vmpstr wrote: > On 2014/05/21 20:01:56, reveman wrote: > > > https://codereview.chromium.org/296043005/diff/90001/cc/base/delayed_unique_notifier_unittest.cc ...
6 years, 7 months ago (2014-05-21 20:15:01 UTC) #10
vmpstr
On 2014/05/21 20:15:01, reveman wrote: > On 2014/05/21 20:02:51, vmpstr wrote: > > On 2014/05/21 ...
6 years, 7 months ago (2014-05-21 20:17:23 UTC) #11
reveman
On 2014/05/21 20:17:23, vmpstr wrote: > On 2014/05/21 20:15:01, reveman wrote: > > On 2014/05/21 ...
6 years, 7 months ago (2014-05-21 22:18:24 UTC) #12
vmpstr
On 2014/05/21 22:18:24, reveman wrote: > On 2014/05/21 20:17:23, vmpstr wrote: > > On 2014/05/21 ...
6 years, 7 months ago (2014-05-21 22:21:43 UTC) #13
vmpstr
On 2014/05/21 22:21:43, vmpstr wrote: > On 2014/05/21 22:18:24, reveman wrote: > > On 2014/05/21 ...
6 years, 7 months ago (2014-05-21 22:23:13 UTC) #14
reveman
I think you need to remove/replace the unit tests that depend on timers. You can ...
6 years, 7 months ago (2014-05-22 23:24:27 UTC) #15
vmpstr
PTAL https://codereview.chromium.org/296043005/diff/110001/cc/base/delayed_unique_notifier.cc File cc/base/delayed_unique_notifier.cc (right): https://codereview.chromium.org/296043005/diff/110001/cc/base/delayed_unique_notifier.cc#newcode43 cc/base/delayed_unique_notifier.cc:43: weak_ptr_factory_.InvalidateWeakPtrs(); On 2014/05/22 23:24:28, reveman wrote: > This ...
6 years, 6 months ago (2014-05-27 18:14:58 UTC) #16
reveman
https://codereview.chromium.org/296043005/diff/130001/cc/base/delayed_unique_notifier_unittest.cc File cc/base/delayed_unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/130001/cc/base/delayed_unique_notifier_unittest.cc#newcode36 cc/base/delayed_unique_notifier_unittest.cc:36: void RunForTime(base::TimeDelta delay) { On 2014/05/27 18:14:59, vmpstr wrote: ...
6 years, 6 months ago (2014-05-27 19:02:17 UTC) #17
vmpstr
PTAL https://codereview.chromium.org/296043005/diff/130001/cc/base/delayed_unique_notifier_unittest.cc File cc/base/delayed_unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/130001/cc/base/delayed_unique_notifier_unittest.cc#newcode36 cc/base/delayed_unique_notifier_unittest.cc:36: void RunForTime(base::TimeDelta delay) { On 2014/05/27 19:02:17, reveman ...
6 years, 6 months ago (2014-05-27 19:25:49 UTC) #18
reveman
Please add a test with delay=0. I'm still wondering if we shouldn't add a simple ...
6 years, 6 months ago (2014-05-27 21:20:24 UTC) #19
vmpstr
On 2014/05/27 21:20:24, reveman wrote: > Please add a test with delay=0. Done. > I'm ...
6 years, 6 months ago (2014-05-27 21:50:31 UTC) #20
vmpstr
PTAL. https://codereview.chromium.org/296043005/diff/170001/cc/base/delayed_unique_notifier_unittest.cc File cc/base/delayed_unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/170001/cc/base/delayed_unique_notifier_unittest.cc#newcode45 cc/base/delayed_unique_notifier_unittest.cc:45: // Pump through the remained or messages. On ...
6 years, 6 months ago (2014-05-27 21:50:41 UTC) #21
reveman
On 2014/05/27 21:50:31, vmpstr wrote: > On 2014/05/27 21:20:24, reveman wrote: > > Please add ...
6 years, 6 months ago (2014-05-28 04:08:29 UTC) #22
vmpstr
PTAL. The test now doesn't use either the run loop or real time.
6 years, 6 months ago (2014-05-28 19:16:02 UTC) #23
vmpstr
PTAL. The test now doesn't use either the run loop or real time.
6 years, 6 months ago (2014-05-28 19:16:04 UTC) #24
reveman
thanks! lgtm with one small test request https://codereview.chromium.org/296043005/diff/230001/cc/base/delayed_unique_notifier_unittest.cc File cc/base/delayed_unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/230001/cc/base/delayed_unique_notifier_unittest.cc#newcode25 cc/base/delayed_unique_notifier_unittest.cc:25: virtual base::TimeTicks ...
6 years, 6 months ago (2014-05-28 19:50:01 UTC) #25
vmpstr
https://codereview.chromium.org/296043005/diff/230001/cc/base/delayed_unique_notifier_unittest.cc File cc/base/delayed_unique_notifier_unittest.cc (right): https://codereview.chromium.org/296043005/diff/230001/cc/base/delayed_unique_notifier_unittest.cc#newcode25 cc/base/delayed_unique_notifier_unittest.cc:25: virtual base::TimeTicks Now() const OVERRIDE { return now_; } ...
6 years, 6 months ago (2014-05-28 20:17:13 UTC) #26
vmpstr
The CQ bit was checked by vmpstr@chromium.org
6 years, 6 months ago (2014-05-28 20:17:21 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vmpstr@chromium.org/296043005/240001
6 years, 6 months ago (2014-05-28 20:18:11 UTC) #28
commit-bot: I haz the power
6 years, 6 months ago (2014-05-29 01:47:59 UTC) #29
Message was sent while issue was closed.
Change committed as 273433

Powered by Google App Engine
This is Rietveld 408576698