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

Issue 2352853002: Disallow redundant Bind calls. (Closed)

Created:
4 years, 3 months ago by dcheng
Modified:
4 years, 3 months ago
Reviewers:
danakj, brettw, tzik
CC:
chromium-reviews, gab, proberge
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Disallow redundant Bind calls. Make it a compile-time error base::Bind a base::Callback as the functor object with no additional args: in that case, just use the original callback! BUG=none R=danakj@chromium.org,tzik@chromium.org TBR=brettw@chromium.org Committed: https://crrev.com/172b6ad8f0213ba74d9447dbd08e32e1c7ce655a Cr-Commit-Position: refs/heads/master@{#420826}

Patch Set 1 #

Patch Set 2 : Fix base_unittests #

Patch Set 3 : Make error friendlier #

Patch Set 4 : And a nocompile test #

Patch Set 5 : Fix a lot of stuff #

Patch Set 6 : Fix more things #

Patch Set 7 : Another BindToLoop #

Total comments: 3

Patch Set 8 : Update impl + nocompile for OnceCallback #

Total comments: 2

Patch Set 9 : use std::move #

Total comments: 2

Patch Set 10 : Just revert to simple change in //device #

Patch Set 11 : static_assert message tweak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -97 lines) Patch
M base/bind_internal.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +23 lines, -1 line 0 comments Download
M base/bind_unittest.cc View 1 4 chunks +9 lines, -5 lines 0 comments Download
M base/bind_unittest.nc View 1 2 3 4 5 6 7 8 9 10 2 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_service.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/file_system/file_system_api.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media_galleries/linux/mtp_device_task_helper.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync_file_system/drive_backend/callback_helper.h View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/sync_file_system/sync_file_system_service_unittest.cc View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc View 1 2 3 4 5 2 chunks +4 lines, -5 lines 0 comments Download
M chromecast/base/bind_to_task_runner.h View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M chromeos/attestation/attestation_flow.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chromeos/network/managed_network_configuration_handler_unittest.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M components/dom_distiller/webui/dom_distiller_handler.cc View 1 2 3 4 1 chunk +4 lines, -5 lines 0 comments Download
M components/drive/file_system/operation_test_base.cc View 1 2 3 4 5 3 chunks +6 lines, -9 lines 0 comments Download
M components/offline_pages/background/request_queue_store_sql.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M components/offline_pages/offline_page_metadata_store_sql.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M components/sync/base/bind_to_task_runner.h View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.cc View 1 2 3 4 18 chunks +26 lines, -43 lines 0 comments Download
M content/browser/cache_storage/cache_storage_manager.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/browser/tracing/background_tracing_manager_browsertest.cc View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M device/serial/data_sender.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M media/audio/android/audio_manager_android.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M media/base/bind_to_current_loop.h View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M remoting/host/host_change_notification_listener_unittest.cc View 1 2 3 4 5 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 43 (27 generated)
dcheng
Inspired by https://codereview.chromium.org/2299523003/. I'm not sure if our nocompile tests still work now that GYP ...
4 years, 3 months ago (2016-09-19 19:37:53 UTC) #5
danakj
LGTM
4 years, 3 months ago (2016-09-19 19:48:58 UTC) #8
tzik
lgtm
4 years, 3 months ago (2016-09-20 05:12:10 UTC) #21
tzik
https://codereview.chromium.org/2352853002/diff/120001/base/bind_internal.h File base/bind_internal.h (right): https://codereview.chromium.org/2352853002/diff/120001/base/bind_internal.h#newcode434 base/bind_internal.h:434: struct BindingCallbackWithNoArgs<Callback<Signature>, BoundArgs...> { Could you add a specialization ...
4 years, 3 months ago (2016-09-20 07:33:05 UTC) #22
dcheng
https://codereview.chromium.org/2352853002/diff/120001/base/bind_internal.h File base/bind_internal.h (right): https://codereview.chromium.org/2352853002/diff/120001/base/bind_internal.h#newcode434 base/bind_internal.h:434: struct BindingCallbackWithNoArgs<Callback<Signature>, BoundArgs...> { On 2016/09/20 07:33:04, tzik wrote: ...
4 years, 3 months ago (2016-09-20 08:22:39 UTC) #23
tzik
On 2016/09/20 08:22:39, dcheng wrote: > https://codereview.chromium.org/2352853002/diff/120001/base/bind_internal.h > File base/bind_internal.h (right): > > https://codereview.chromium.org/2352853002/diff/120001/base/bind_internal.h#newcode434 > ...
4 years, 3 months ago (2016-09-20 09:51:28 UTC) #24
dcheng
PTAL. A few rebases got dragged in, but the importants diffs between PS7 and PS8 ...
4 years, 3 months ago (2016-09-24 00:49:17 UTC) #25
dcheng
https://codereview.chromium.org/2352853002/diff/140001/base/bind_unittest.nc File base/bind_unittest.nc (right): https://codereview.chromium.org/2352853002/diff/140001/base/bind_unittest.nc#newcode215 base/bind_unittest.nc:215: internal::OnceClosure cb2 = internal::BindOnce(cb); On 2016/09/24 00:49:17, dcheng wrote: ...
4 years, 3 months ago (2016-09-24 00:52:56 UTC) #26
danakj
LGTM https://codereview.chromium.org/2352853002/diff/160001/device/serial/data_sender.cc File device/serial/data_sender.cc (left): https://codereview.chromium.org/2352853002/diff/160001/device/serial/data_sender.cc#oldcode127 device/serial/data_sender.cc:127: pending_cancel_.Reset(); can you still reset after in case ...
4 years, 3 months ago (2016-09-24 01:20:01 UTC) #27
dcheng
https://codereview.chromium.org/2352853002/diff/160001/device/serial/data_sender.cc File device/serial/data_sender.cc (left): https://codereview.chromium.org/2352853002/diff/160001/device/serial/data_sender.cc#oldcode127 device/serial/data_sender.cc:127: pending_cancel_.Reset(); On 2016/09/24 01:20:01, danakj wrote: > can you ...
4 years, 3 months ago (2016-09-24 01:29:57 UTC) #28
dcheng
TBRing brettw for global approval (danakj@ and tzik@ have already reviewed the entire CL. Outside ...
4 years, 3 months ago (2016-09-24 02:00:33 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2352853002/200001
4 years, 3 months ago (2016-09-24 02:01:05 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/285609)
4 years, 3 months ago (2016-09-24 04:05:13 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2352853002/200001
4 years, 3 months ago (2016-09-24 04:12:14 UTC) #39
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 3 months ago (2016-09-24 05:06:29 UTC) #41
commit-bot: I haz the power
4 years, 3 months ago (2016-09-24 05:08:21 UTC) #43
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/172b6ad8f0213ba74d9447dbd08e32e1c7ce655a
Cr-Commit-Position: refs/heads/master@{#420826}

Powered by Google App Engine
This is Rietveld 408576698