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

Issue 8048008: Add new helper that can adapt Callbacks with return values for Closures. (Closed)

Created:
9 years, 2 months ago by awong
Modified:
9 years, 2 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org, darin (slow to review), akalin
Visibility:
Public.

Description

Add new helper that can adapt Callbacks with return values for Closures. This is helpful for reducing manually written static functions that just effectively just invoke the function and ignore the return value. BUG=87287 TEST=new unittest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=103060

Patch Set 1 #

Total comments: 5

Patch Set 2 : Fix comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -9 lines) Patch
M base/bind_helpers.h View 1 5 chunks +27 lines, -3 lines 0 comments Download
M base/bind_unittest.cc View 2 chunks +9 lines, -6 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
awong
9 years, 2 months ago (2011-09-26 23:21:20 UTC) #1
willchan no longer on Chromium
LGTM but wait for Darin too.
9 years, 2 months ago (2011-09-27 03:30:45 UTC) #2
darin (slow to review)
http://codereview.chromium.org/8048008/diff/1/base/bind_helpers.h File base/bind_helpers.h (right): http://codereview.chromium.org/8048008/diff/1/base/bind_helpers.h#newcode56 base/bind_helpers.h:56: // int DoSomething(int arg) { cout << arg << ...
9 years, 2 months ago (2011-09-27 16:48:00 UTC) #3
awong
On Tue, Sep 27, 2011 at 9:48 AM, <darin@chromium.org> wrote: > > http://codereview.chromium.**org/8048008/diff/1/base/bind_**helpers.h<http://codereview.chromium.org/8048008/diff/1/base/bind_helpers.h> > File ...
9 years, 2 months ago (2011-09-27 16:56:05 UTC) #4
willchan no longer on Chromium
Roughly agreed with Albert although I'd push back on the implicit conversion harder. I'm in ...
9 years, 2 months ago (2011-09-27 17:02:23 UTC) #5
darin (slow to review)
On Tue, Sep 27, 2011 at 9:55 AM, Albert J. Wong (王重傑) <ajwong@chromium.org>wrote: > > ...
9 years, 2 months ago (2011-09-27 17:31:50 UTC) #6
awong
9 years, 2 months ago (2011-09-27 21:35:00 UTC) #7
comments fixed. Submitting.

http://codereview.chromium.org/8048008/diff/1/base/bind_helpers.h
File base/bind_helpers.h (right):

http://codereview.chromium.org/8048008/diff/1/base/bind_helpers.h#newcode56
base/bind_helpers.h:56: //   int DoSomething(int arg) { cout << arg << end; }
On 2011/09/27 16:48:01, darin wrote:
> nit: "end" -> "endl"

Done.

http://codereview.chromium.org/8048008/diff/1/base/bind_helpers.h#newcode57
base/bind_helpers.h:57: //   Callback <int(void)> cb = Bind(&DoSomething, 1);
On 2011/09/27 16:48:01, darin wrote:
> nit: no space before "<"

Done.

Powered by Google App Engine
This is Rietveld 408576698