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

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)

Created:
3 years, 8 months ago by gab
Modified:
3 years, 7 months ago
CC:
chromium-reviews, sadrul, asvitkine+watch_chromium.org, vmpstr+watch_chromium.org, yzshen+watch_chromium.org, scheib+watch_chromium.org, ortuno+watch_chromium.org, kinuko+watch, qsr+mojo_chromium.org, jdonnelly+watch_chromium.org, tzik, jam, abarth-chromium, darin-cc_chromium.org, blink-reviews, kalyank, extensions-reviews_chromium.org, viettrungluu+watch_chromium.org, nhiroki, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, danakj+watch_chromium.org, sync-reviews_chromium.org, rjkroege, hashimoto+watch_chromium.org, tfarina, Aaron Boodman, darin (slow to review), scheduler-bugs_chromium.org, kinuko+fileapi
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make nesting/running states a RunLoop rather than a MessageLoop concept. First CL of a series to split inter-dependency between RunLoop and MessageLoop. Also modernized bluetooth_socket_bluez_unittest.cc away from using deprecated MessageLoop Quit methods on its fixture's MessageLoop member to ease transition. Lastly, tried to add thread safety checks for documentation purposes but turns out there are already improper usage of the API... those will have to be addressed first through issue 715235. https://codereview.chromium.org/2828913003 follows to s/nested message loop/nested run loop/ in comments. BUG=703346, 715235 Review-Url: https://codereview.chromium.org/2818533003 Cr-Commit-Position: refs/heads/master@{#469636} Committed: https://chromium.googlesource.com/chromium/src/+/7af9dc076d2349ade19a95e24f6ee6811e939765

Patch Set 1 #

Patch Set 2 : fix compile and add RunLoopTests #

Total comments: 1

Patch Set 3 : rebase on r465647 and nits #

Patch Set 4 : fix compile #

Total comments: 18

Patch Set 5 : OnBeginRunLoop() and compile nits #

Patch Set 6 : Bind->BindOnce bluez_unittest #

Patch Set 7 : review:danakj #

Patch Set 8 : fix bluez compile? #

Patch Set 9 : comment out checks? #

Patch Set 10 : disable more checks... #

Patch Set 11 : disable more checks #

Total comments: 2

Patch Set 12 : rebase on r466322 #

Patch Set 13 : fix tests add bug# for TODOs #

Patch Set 14 : ResetTLSState() for now to keep clean slate between tests #

Patch Set 15 : Fix nesting observer issues with LazySchedulerMessageLoopDelegateForTests #

Total comments: 1

Patch Set 16 : also rename MessageLoopNestingObserver #

Patch Set 17 : need to RunUntilIdle for ConnectProfile with DoNothing callbacks -- how did this possibly not hang … #

Total comments: 2

Patch Set 18 : fix compile #

Patch Set 19 : rebase on r469572 #

Patch Set 20 : ah ah, need to link ConnectProfile call and their matching Accept calls in same RunLoop! #

Patch Set 21 : can't run same RunLoop twice... #

Patch Set 22 : still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+736 lines, -504 lines) Patch
M base/message_loop/message_loop.h View 1 2 7 chunks +2 lines, -32 lines 0 comments Download
M base/message_loop/message_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 9 chunks +8 lines, -32 lines 0 comments Download
M base/message_loop/message_loop_test.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M base/message_loop/message_loop_test.cc View 1 2 1 chunk +0 lines, -61 lines 0 comments Download
M base/run_loop.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +44 lines, -11 lines 0 comments Download
M base/run_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +142 lines, -14 lines 0 comments Download
M base/run_loop_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +103 lines, -11 lines 0 comments Download
M chrome/browser/app_controller_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/metrics/chromeos_metrics_provider_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/simple_message_box_views.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chromeos/dbus/services/service_provider_test_helper.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/omnibox/browser/autocomplete_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M components/sync/engine_impl/sync_scheduler_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/browser_main_runner.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/browser_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc View 1 chunk +1 line, -3 lines 0 comments Download
M device/bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc View 1 chunk +1 line, -3 lines 0 comments Download
M device/bluetooth/bluez/bluetooth_bluez_unittest.cc View 2 chunks +2 lines, -6 lines 0 comments Download
M device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc View 2 chunks +2 lines, -5 lines 0 comments Download
M device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 23 chunks +272 lines, -204 lines 0 comments Download
M device/bluetooth/test/test_bluetooth_adapter_observer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M extensions/browser/api/alarms/alarms_api_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M mash/quick_launch/quick_launch.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -1 line 0 comments Download
M mojo/public/cpp/bindings/connector.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +4 lines, -4 lines 0 comments Download
M mojo/public/cpp/bindings/lib/connector.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 6 chunks +20 lines, -19 lines 0 comments Download
M services/service_manager/tests/lifecycle/package.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +3 lines, -1 line 0 comments Download
M services/ui/service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -3 lines 0 comments Download
M storage/browser/fileapi/file_system_operation_impl_write_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/PerformanceMonitor.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.h View 2 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +8 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_time_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/test_task_time_observer.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.h View 1 chunk +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.cc View 2 chunks +8 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/child/worker_scheduler_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/child/worker_scheduler_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +32 lines, -6 lines 0 comments Download
M ui/aura/mus/mus_mouse_location_updater.h View 1 2 3 4 3 chunks +4 lines, -4 lines 0 comments Download
M ui/aura/mus/mus_mouse_location_updater.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M ui/aura/mus/window_tree_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +7 lines, -5 lines 0 comments Download
M ui/aura/window_event_dispatcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 129 (90 generated)
gab
Dana PTaL at overall change in //base @other owners for side-effects in: - sky@ : ...
3 years, 8 months ago (2017-04-19 19:21:47 UTC) #23
gab
On 2017/04/19 19:21:47, gab wrote: > Dana PTaL at overall change in //base > > ...
3 years, 8 months ago (2017-04-19 19:29:52 UTC) #24
gab
And one last time with everyone actually on reviewer list... sigh.. why can't I automate ...
3 years, 8 months ago (2017-04-19 19:32:00 UTC) #26
sky
LGTM
3 years, 8 months ago (2017-04-19 20:10:04 UTC) #29
pavely
components\sync\* lgtm
3 years, 8 months ago (2017-04-19 20:12:39 UTC) #30
stevenjb
chromeos/ lgtm
3 years, 8 months ago (2017-04-19 20:51:31 UTC) #31
tzik
lgtm
3 years, 8 months ago (2017-04-20 06:14:57 UTC) #32
Sami
lgtm https://codereview.chromium.org/2818533003/diff/80001/base/run_loop.h File base/run_loop.h (right): https://codereview.chromium.org/2818533003/diff/80001/base/run_loop.h#newcode90 base/run_loop.h:90: virtual void OnBeginNestedMessageLoop() = 0; nit: TODO to ...
3 years, 8 months ago (2017-04-20 10:13:23 UTC) #33
gab
Thanks, @skyostil: done. Remaining owners: > - danakj@: core changes in //base > - nick@: ...
3 years, 8 months ago (2017-04-20 14:21:18 UTC) #37
danakj
LGTM w/ a few comments https://codereview.chromium.org/2818533003/diff/80001/base/message_loop/message_loop_test.cc File base/message_loop/message_loop_test.cc (right): https://codereview.chromium.org/2818533003/diff/80001/base/message_loop/message_loop_test.cc#newcode375 base/message_loop/message_loop_test.cc:375: EXPECT_EQ(depth, 0); Is there ...
3 years, 8 months ago (2017-04-20 14:57:32 UTC) #40
gab
Thanks Dana, done. Remaining owners: > - nick@: content\* > - scheib@: device\bluetooth\* > - ...
3 years, 8 months ago (2017-04-20 16:22:02 UTC) #44
scheib
device/bluetooth LGTM, with an optional naming note: https://codereview.chromium.org/2818533003/diff/220001/device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc File device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc (right): https://codereview.chromium.org/2818533003/diff/220001/device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc#newcode108 device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc:108: void AdapterCallback(base::OnceClosure ...
3 years, 8 months ago (2017-04-21 06:17:10 UTC) #59
Marijn Kruisselbrink
On 2017/04/20 at 14:21:18, gab wrote: > Remaining owners: > > - mek@: extensions\* extensions/ ...
3 years, 8 months ago (2017-04-21 18:48:56 UTC) #64
gab
On 2017/04/21 18:48:56, Marijn Kruisselbrink wrote: > On 2017/04/20 at 14:21:18, gab wrote: > > ...
3 years, 8 months ago (2017-04-21 19:52:14 UTC) #66
Devlin
extensions/browser/api/alarms/alarms_api_unittest.cc lgtm
3 years, 8 months ago (2017-04-21 20:58:54 UTC) #67
Mark P
components/omnibox/browser/autocomplete_provider_unittest.cc lgtm --mark
3 years, 8 months ago (2017-04-21 22:02:58 UTC) #68
ncarter (slow)
lgtm
3 years, 8 months ago (2017-04-21 22:04:32 UTC) #69
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/2818533003/260001
3 years, 8 months ago (2017-04-25 20:16:06 UTC) #79
gab
@scheib: no objection, done, thanks! https://codereview.chromium.org/2818533003/diff/220001/device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc File device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc (right): https://codereview.chromium.org/2818533003/diff/220001/device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc#newcode108 device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc:108: void AdapterCallback(base::OnceClosure on_callback, On ...
3 years, 8 months ago (2017-04-25 20:16:36 UTC) #80
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/354654)
3 years, 8 months ago (2017-04-25 21:28:12 UTC) #82
gab
@skyostil PTanL (PS 15): had to change approach for lazy_scheduler_message_loop_delegate_for_tests.cc because of mass test failures, ...
3 years, 7 months ago (2017-05-01 21:01:42 UTC) #89
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/2818533003/300001
3 years, 7 months ago (2017-05-01 21:08:27 UTC) #93
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_tsan_rel_ng/builds/64722)
3 years, 7 months ago (2017-05-01 23:48:01 UTC) #95
Sami
Thanks, still lgtm. I thought about making DoWork support nesting that happens outside of it, ...
3 years, 7 months ago (2017-05-04 15:15:25 UTC) #96
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/2818533003/340001
3 years, 7 months ago (2017-05-04 22:06:00 UTC) #99
gab
@scheib: FYI, had to make a tweak to the reviewed device\bluetooth test code https://codereview.chromium.org/2818533003/diff/340001/device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc File ...
3 years, 7 months ago (2017-05-04 22:12:12 UTC) #100
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/2818533003/360001
3 years, 7 months ago (2017-05-04 22:17:57 UTC) #103
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/445736)
3 years, 7 months ago (2017-05-04 23:34:59 UTC) #105
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/2818533003/380001
3 years, 7 months ago (2017-05-05 02:18:58 UTC) #108
gab
https://codereview.chromium.org/2818533003/diff/340001/device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc File device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc (left): https://codereview.chromium.org/2818533003/diff/340001/device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc#oldcode388 device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc:388: base::RunLoop().Run(); On 2017/05/04 22:12:12, gab wrote: > @scheib: I ...
3 years, 7 months ago (2017-05-05 02:21:54 UTC) #109
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/2818533003/420001
3 years, 7 months ago (2017-05-05 02:24:00 UTC) #113
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/419155)
3 years, 7 months ago (2017-05-05 03:31:32 UTC) #115
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/2818533003/440001
3 years, 7 months ago (2017-05-05 03:50:26 UTC) #118
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/445978)
3 years, 7 months ago (2017-05-05 06:22:29 UTC) #120
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/2818533003/460001
3 years, 7 months ago (2017-05-05 11:50:09 UTC) #123
commit-bot: I haz the power
Committed patchset #22 (id:460001) as https://chromium.googlesource.com/chromium/src/+/7af9dc076d2349ade19a95e24f6ee6811e939765
3 years, 7 months ago (2017-05-05 13:39:15 UTC) #126
Will Harris
this appears to have caused a regression on official builder win base_unittests https://uberchromegw.corp.google.com/i/official.desktop.continuous/builders/win%20trunk/builds/62876 RunLoopTest.DisallowWaitingDeathTest
3 years, 7 months ago (2017-05-05 18:39:26 UTC) #127
mfomitchev
A revert of this CL (patchset #22 id:460001) has been created in https://codereview.chromium.org/2867533002/ by mfomitchev@chromium.org. ...
3 years, 7 months ago (2017-05-05 18:41:42 UTC) #128
gab
3 years, 7 months ago (2017-05-05 19:18:18 UTC) #129
Message was sent while issue was closed.
On 2017/05/05 18:41:42, mfomitchev wrote:
> A revert of this CL (patchset #22 id:460001) has been created in
> https://codereview.chromium.org/2867533002/ by
https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=mfomitchev@chromium.org.
> 
> The reason for reverting is: Broke RunLoopTest.DisallowWaitingDeathTest on
> Windows. Link to first failure:
>
https://uberchromegw.corp.google.com/i/official.desktop.continuous/builders/w....

Revert won't apply, fix incoming @ https://codereview.chromium.org/2857393006/

Powered by Google App Engine
This is Rietveld 408576698