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

Issue 8139028: Add WorkerPool::PostTaskAndReply and use in DHCP code. (Closed)

Created:
9 years, 2 months ago by Jói
Modified:
9 years, 2 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Add WorkerPool::PostTaskAndReply and use in DHCP code. This factors out the PostTaskAndReply implementation out of MessageLoopProxy so that it can be used for any destination thread accessible via a PostTask-like interface, and uses that code from both MessageLoopProxy and WorkerPool. The DhcpProxyScriptFetcherWin and DhcpProxyScriptAdapterFetcher classes were both using a PostTaskAndReply-like mechanism with a WorkerPool thread, and on inspection it looks like there are several places in net/ where this is done, and this motivated the larger change (vs. patch set 1 which was a mechanical switch to base::Bind from NewRunnableMethod). BUG=97516 TEST=net_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105512

Patch Set 1 #

Patch Set 2 : Refactor PostTaskAndReply for reuse in WorkerPool, and switch to that in the DHCP classes. #

Patch Set 3 : Naming and comment fixes based on self-review. #

Total comments: 10

Patch Set 4 : Addressing review comments. Fixing flakiness in reuse test. #

Total comments: 7

Patch Set 5 : Addressing review comments. Merging to lkgr. #

Patch Set 6 : Merge to lkgr #

Total comments: 11

Patch Set 7 : Address review comments. Fix compile issue after merge to lkgr. #

Total comments: 4

Patch Set 8 : Mark private #

Unified diffs Side-by-side diffs Delta from patch set Stats (+305 lines, -281 lines) Patch
M base/base.gypi View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M base/message_loop_proxy.cc View 1 2 3 4 5 6 7 2 chunks +12 lines, -55 lines 0 comments Download
A base/threading/post_task_and_reply_impl.h View 1 2 3 4 5 6 1 chunk +43 lines, -0 lines 0 comments Download
A + base/threading/post_task_and_reply_impl.cc View 1 2 3 3 chunks +5 lines, -10 lines 0 comments Download
M base/threading/worker_pool.h View 1 1 chunk +8 lines, -0 lines 0 comments Download
A base/threading/worker_pool.cc View 1 2 3 4 5 6 7 1 chunk +40 lines, -0 lines 0 comments Download
M base/threading/worker_pool_unittest.cc View 1 2 3 4 5 6 3 chunks +60 lines, -0 lines 0 comments Download
M net/proxy/dhcp_proxy_script_adapter_fetcher_win.h View 1 2 3 4 5 6 2 chunks +19 lines, -42 lines 0 comments Download
M net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc View 1 2 3 4 5 6 5 chunks +26 lines, -43 lines 0 comments Download
M net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc View 1 4 chunks +11 lines, -13 lines 0 comments Download
M net/proxy/dhcp_proxy_script_fetcher_win.h View 1 2 3 2 chunks +19 lines, -43 lines 0 comments Download
M net/proxy/dhcp_proxy_script_fetcher_win.cc View 1 2 3 4 5 6 5 chunks +35 lines, -43 lines 0 comments Download
M net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc View 1 8 chunks +24 lines, -32 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Jói
ajwong: Main reviewer for base/ changes since they are all about PostTaskAndReply. willchan: Main reviewer ...
9 years, 2 months ago (2011-10-05 16:35:27 UTC) #1
awong
Thanks for doing this! Haven't looked at the net stuff, but need to run and ...
9 years, 2 months ago (2011-10-05 17:27:01 UTC) #2
Jói
Thanks, I've uploaded a new version that addresses some of your review comments (others are ...
9 years, 2 months ago (2011-10-06 14:20:31 UTC) #3
awong
http://codereview.chromium.org/8139028/diff/3001/base/threading/post_task_and_reply_impl.h File base/threading/post_task_and_reply_impl.h (right): http://codereview.chromium.org/8139028/diff/3001/base/threading/post_task_and_reply_impl.h#newcode26 base/threading/post_task_and_reply_impl.h:26: class PostTaskAndReplyImpl { On 2011/10/06 14:20:31, Jói wrote: > ...
9 years, 2 months ago (2011-10-06 19:53:52 UTC) #4
Jói
> The shared code is pretty short and is just the standard pattern of [...] ...
9 years, 2 months ago (2011-10-07 17:17:08 UTC) #5
awong
Fair enough about the possible future divergence. I agree it is a tossup. There really ...
9 years, 2 months ago (2011-10-07 17:53:22 UTC) #6
Jói
Thanks for the review. I uploaded a new version that addresses your comments. Cheers, Jói ...
9 years, 2 months ago (2011-10-11 19:51:02 UTC) #7
awong
LGTM
9 years, 2 months ago (2011-10-12 08:21:23 UTC) #8
willchan no longer on Chromium
On 2011/10/12 08:21:23, awong wrote: > LGTM I'll take a look today. Ping me if ...
9 years, 2 months ago (2011-10-12 16:10:40 UTC) #9
Jói
Will: Friendly ping. Beware my viking wrath, for I am less than 50 feet from ...
9 years, 2 months ago (2011-10-13 18:16:44 UTC) #10
willchan no longer on Chromium
I was hoping to get to this before lunch, but I'm too hungry. Eating first. ...
9 years, 2 months ago (2011-10-13 19:36:38 UTC) #11
Jói
http://codereview.chromium.org/8139028/diff/33001/base/threading/post_task_and_reply_impl.h File base/threading/post_task_and_reply_impl.h (right): http://codereview.chromium.org/8139028/diff/33001/base/threading/post_task_and_reply_impl.h#newcode35 base/threading/post_task_and_reply_impl.h:35: protected: On 2011/10/13 19:36:38, willchan wrote: > Why is ...
9 years, 2 months ago (2011-10-13 20:27:58 UTC) #12
willchan no longer on Chromium
On Thu, Oct 13, 2011 at 1:27 PM, <joi@chromium.org> wrote: > > http://codereview.chromium.**org/8139028/diff/33001/base/** > threading/post_task_and_reply_**impl.h<http://codereview.chromium.org/8139028/diff/33001/base/threading/post_task_and_reply_impl.h> ...
9 years, 2 months ago (2011-10-13 20:30:02 UTC) #13
willchan no longer on Chromium
http://codereview.chromium.org/8139028/diff/33001/base/message_loop_proxy.cc File base/message_loop_proxy.cc (right): http://codereview.chromium.org/8139028/diff/33001/base/message_loop_proxy.cc#newcode22 base/message_loop_proxy.cc:22: bool PostTask(const tracked_objects::Location& from_here, Please use the virtual keyword ...
9 years, 2 months ago (2011-10-13 22:33:45 UTC) #14
Jói
PTAL, and thanks for a careful review. http://codereview.chromium.org/8139028/diff/33001/base/message_loop_proxy.cc File base/message_loop_proxy.cc (right): http://codereview.chromium.org/8139028/diff/33001/base/message_loop_proxy.cc#newcode22 base/message_loop_proxy.cc:22: bool PostTask(const ...
9 years, 2 months ago (2011-10-13 22:46:07 UTC) #15
willchan no longer on Chromium
lgtm http://codereview.chromium.org/8139028/diff/33002/base/message_loop_proxy.cc File base/message_loop_proxy.cc (right): http://codereview.chromium.org/8139028/diff/33002/base/message_loop_proxy.cc#newcode22 base/message_loop_proxy.cc:22: protected: private http://codereview.chromium.org/8139028/diff/33002/base/threading/worker_pool.cc File base/threading/worker_pool.cc (right): http://codereview.chromium.org/8139028/diff/33002/base/threading/worker_pool.cc#newcode21 base/threading/worker_pool.cc:21: ...
9 years, 2 months ago (2011-10-13 22:59:56 UTC) #16
Jói
9 years, 2 months ago (2011-10-13 23:02:49 UTC) #17
http://codereview.chromium.org/8139028/diff/33002/base/message_loop_proxy.cc
File base/message_loop_proxy.cc (right):

http://codereview.chromium.org/8139028/diff/33002/base/message_loop_proxy.cc#...
base/message_loop_proxy.cc:22: protected:
On 2011/10/13 22:59:56, willchan wrote:
> private

Done.

http://codereview.chromium.org/8139028/diff/33002/base/threading/worker_pool.cc
File base/threading/worker_pool.cc (right):

http://codereview.chromium.org/8139028/diff/33002/base/threading/worker_pool....
base/threading/worker_pool.cc:21: virtual bool PostTask(const
tracked_objects::Location& from_here,
On 2011/10/13 22:59:56, willchan wrote:
> private

Done.

Powered by Google App Engine
This is Rietveld 408576698