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

Issue 7210053: Implementation of PostTaskAndReply() in MessageLoopProxy and BrowserThread. (Closed)

Created:
9 years, 5 months ago by awong
Modified:
9 years, 4 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, Dai Mikurube (NOT FULLTIME)
Visibility:
Public.

Description

Implementation of PostTaskAndReply() in MessageLoopProxy and BrowserThread. This ensures that the request/reply closures are always deleted on the origin thread, or leaked if the task cannot be completed (due to message loop shutdown). BUG=86301 TEST=new unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97387

Patch Set 1 #

Total comments: 15

Patch Set 2 : Real implementation #

Patch Set 3 : missed something small #

Total comments: 4

Patch Set 4 : rebased and turned into methods #

Total comments: 4

Patch Set 5 : Added unittests #

Total comments: 6

Patch Set 6 : Move PTAR to message_loop_proxy.h and add more unittests. #

Patch Set 7 : revert useless changes #

Patch Set 8 : iwyu #

Total comments: 8

Patch Set 9 : Address Darin's comments. #

Patch Set 10 : don't hang browserthread. #

Total comments: 4

Patch Set 11 : address Darin's latest comments. #

Patch Set 12 : upload the correct version #

Patch Set 13 : add supression #

Total comments: 5

Patch Set 14 : add in a bug #

Patch Set 15 : copyright #

Unified diffs Side-by-side diffs Delta from patch set Stats (+440 lines, -4 lines) Patch
M base/base.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M base/message_loop.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M base/message_loop_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +45 lines, -0 lines 0 comments Download
M base/message_loop_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +76 lines, -1 line 0 comments Download
A base/message_loop_proxy_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +263 lines, -0 lines 0 comments Download
M base/task.h View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download
M base/threading/thread_collision_warner.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/browser/browser_thread.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/browser_thread.cc View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/browser_thread_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +17 lines, -1 line 0 comments Download
M tools/valgrind/memcheck/suppressions.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
awong
This is a (nearly) simplest-possible implementation. Darin, would this be useful enough for you to ...
9 years, 5 months ago (2011-07-01 02:11:45 UTC) #1
darin (slow to review)
Yeah, this looks like a good approach. http://codereview.chromium.org/7210053/diff/1/base/task.cc File base/task.cc (right): http://codereview.chromium.org/7210053/diff/1/base/task.cc#newcode54 base/task.cc:54: origin_loop_->PostTask( what ...
9 years, 5 months ago (2011-07-01 04:15:32 UTC) #2
willchan no longer on Chromium
http://codereview.chromium.org/7210053/diff/1/base/task.cc File base/task.cc (right): http://codereview.chromium.org/7210053/diff/1/base/task.cc#newcode54 base/task.cc:54: origin_loop_->PostTask( On 2011/07/01 04:15:32, darin wrote: > what if ...
9 years, 5 months ago (2011-07-01 15:13:54 UTC) #3
awong
Okay, here is draft 2. The main differences are: 1) no templates 2) readding refcounting ...
9 years, 5 months ago (2011-07-02 00:36:56 UTC) #4
darin (slow to review)
On Fri, Jul 1, 2011 at 5:36 PM, <ajwong@chromium.org> wrote: > Okay, here is draft ...
9 years, 5 months ago (2011-07-06 19:46:41 UTC) #5
awong
On Wed, Jul 6, 2011 at 12:46 PM, Darin Fisher <darin@chromium.org> wrote: > > > ...
9 years, 5 months ago (2011-07-06 19:50:24 UTC) #6
darin (slow to review)
On Wed, Jul 6, 2011 at 12:49 PM, Albert J. Wong (王重傑) <ajwong@chromium.org>wrote: > > ...
9 years, 5 months ago (2011-07-06 20:07:04 UTC) #7
willchan no longer on Chromium
I don't know that I have any opinion on whether this needs to be a ...
9 years, 5 months ago (2011-07-06 22:10:26 UTC) #8
awong
I'll remove the refcount, and move it to a member function on the various classes. ...
9 years, 5 months ago (2011-07-07 20:31:16 UTC) #9
awong
PTAL. Still need unittest. http://codereview.chromium.org/7210053/diff/4002/base/task.cc File base/task.cc (right): http://codereview.chromium.org/7210053/diff/4002/base/task.cc#newcode85 base/task.cc:85: void PostTaskAndReply(MessageLoop* loop, On 2011/07/06 ...
9 years, 4 months ago (2011-08-15 22:07:55 UTC) #10
willchan no longer on Chromium
things are looking fine to me, would love to see tests http://codereview.chromium.org/7210053/diff/20012/base/task.cc File base/task.cc (right): ...
9 years, 4 months ago (2011-08-16 02:00:12 UTC) #11
awong
http://codereview.chromium.org/7210053/diff/20012/base/task.cc File base/task.cc (right): http://codereview.chromium.org/7210053/diff/20012/base/task.cc#newcode93 base/task.cc:93: void PostTaskAndReplyRelay::RunReplyAndSelfDestruct() { On 2011/08/16 02:00:12, willchan wrote: > ...
9 years, 4 months ago (2011-08-16 02:12:13 UTC) #12
willchan no longer on Chromium
http://codereview.chromium.org/7210053/diff/20012/base/task.cc File base/task.cc (right): http://codereview.chromium.org/7210053/diff/20012/base/task.cc#newcode93 base/task.cc:93: void PostTaskAndReplyRelay::RunReplyAndSelfDestruct() { On 2011/08/16 02:12:13, awong wrote: > ...
9 years, 4 months ago (2011-08-16 14:50:55 UTC) #13
awong
Unittest added. Please let me know what you think. FYI, the unittest introduces an intentional ...
9 years, 4 months ago (2011-08-17 03:36:58 UTC) #14
willchan no longer on Chromium
What do you think about adding a test that enforces the destruction order of task ...
9 years, 4 months ago (2011-08-17 04:36:07 UTC) #15
awong
I can try to add something that checks destruction order tomorrow. http://codereview.chromium.org/7210053/diff/29001/base/task_unittest.cc File base/task_unittest.cc (right): ...
9 years, 4 months ago (2011-08-17 05:16:00 UTC) #16
awong
Beefed up the tests a bit more and moved some files around. Also fixed an ...
9 years, 4 months ago (2011-08-17 15:34:03 UTC) #17
darin (slow to review)
What's the plan for using PostTaskAndReply to compute a result on a background thread and ...
9 years, 4 months ago (2011-08-17 17:20:39 UTC) #18
awong
As is, the framework does not pass the return value along. The expectation is the ...
9 years, 4 months ago (2011-08-17 18:46:45 UTC) #19
darin (slow to review)
On Wed, Aug 17, 2011 at 11:46 AM, <ajwong@chromium.org> wrote: > As is, the framework ...
9 years, 4 months ago (2011-08-17 21:36:12 UTC) #20
darin (slow to review)
LGTM http://codereview.chromium.org/7210053/diff/29020/base/message_loop_proxy.h File base/message_loop_proxy.h (right): http://codereview.chromium.org/7210053/diff/29020/base/message_loop_proxy.h#newcode86 base/message_loop_proxy.h:86: // while |task| may still be executing. it ...
9 years, 4 months ago (2011-08-17 21:40:49 UTC) #21
awong
Beefed up the comments. I can't really fix the FROM_HERE thing because the FROM_HERE locaion ...
9 years, 4 months ago (2011-08-17 22:34:17 UTC) #22
darin (slow to review)
On Wed, Aug 17, 2011 at 3:34 PM, <ajwong@chromium.org> wrote: > Beefed up the comments. ...
9 years, 4 months ago (2011-08-17 22:39:56 UTC) #23
darin (slow to review)
LGTM
9 years, 4 months ago (2011-08-17 22:42:01 UTC) #24
willchan no longer on Chromium
Lgtm2! Thanks for all the hard work Albert. On Aug 17, 2011 3:42 PM, <darin@chromium.org> ...
9 years, 4 months ago (2011-08-17 23:01:53 UTC) #25
awong
yay!! Will checkin after try bots to green. I filed a bug for the Location ...
9 years, 4 months ago (2011-08-18 00:37:48 UTC) #26
awong
Hey Nico, Mind looking at the valgrind suppression? -Albert
9 years, 4 months ago (2011-08-18 18:01:41 UTC) #27
Nico
looks good I think…just make sure to watch the waterfall for a few h after ...
9 years, 4 months ago (2011-08-18 18:05:28 UTC) #28
awong
http://codereview.chromium.org/7210053/diff/38003/tools/valgrind/memcheck/suppressions.txt File tools/valgrind/memcheck/suppressions.txt (right): http://codereview.chromium.org/7210053/diff/38003/tools/valgrind/memcheck/suppressions.txt#newcode748 tools/valgrind/memcheck/suppressions.txt:748: This test explicitly verifies PostTaskAndReply leaks the task if ...
9 years, 4 months ago (2011-08-18 18:18:56 UTC) #29
Nico
http://codereview.chromium.org/7210053/diff/38003/tools/valgrind/memcheck/suppressions.txt File tools/valgrind/memcheck/suppressions.txt (right): http://codereview.chromium.org/7210053/diff/38003/tools/valgrind/memcheck/suppressions.txt#newcode748 tools/valgrind/memcheck/suppressions.txt:748: This test explicitly verifies PostTaskAndReply leaks the task if ...
9 years, 4 months ago (2011-08-18 18:32:34 UTC) #30
awong
Hey Nico, updated stuff. Let me know what you think.
9 years, 4 months ago (2011-08-18 23:05:05 UTC) #31
Nico
9 years, 4 months ago (2011-08-18 23:09:50 UTC) #32
valgrind change lgtm

Powered by Google App Engine
This is Rietveld 408576698