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

Issue 1402523002: Allow implicitly converting a lambda to mojo::Callback using C++11 (Closed)

Created:
5 years, 2 months ago by jamesr
Modified:
5 years, 2 months ago
Reviewers:
viettrungluu
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, darin (slow to review), gregsimon, mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Allow implicitly converting a lambda to mojo::Callback using C++11 This uses C++11 type traits to check if a type is convertible to an std::function and if so uses an appropriate adaptor for mojo::Callback. This replaces the fairly hacky operator() detection that was in place. R=viettrungluu@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/bdf32e44b287cb2ddb5509d37528296b5d08a1a6

Patch Set 1 #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -60 lines) Patch
M mojo/public/cpp/bindings/callback.h View 1 2 chunks +5 lines, -4 lines 0 comments Download
M mojo/public/cpp/bindings/lib/callback_internal.h View 1 chunk +0 lines, -25 lines 0 comments Download
M mojo/public/cpp/bindings/tests/callback_unittest.cc View 1 chunk +0 lines, -31 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
jamesr
5 years, 2 months ago (2015-10-09 18:20:47 UTC) #2
viettrungluu
bots seem awfully red
5 years, 2 months ago (2015-10-09 21:10:21 UTC) #3
jamesr
Compile failure was due to other users of mojo::internal::Conditional, which are gone now. PTAL
5 years, 2 months ago (2015-10-13 22:22:05 UTC) #4
viettrungluu
lgtm
5 years, 2 months ago (2015-10-13 23:06:00 UTC) #5
jamesr
5 years, 2 months ago (2015-10-14 23:37:48 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
bdf32e44b287cb2ddb5509d37528296b5d08a1a6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698