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

Issue 10829467: [Chromoting] Introducing refcount-based life time management of the message loops in the service (d… (Closed)

Created:
8 years, 4 months ago by alexeypa (please no reviews)
Modified:
8 years, 3 months ago
Reviewers:
Sergey Ulanov, Wez
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, simonmorris+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

[Chromoting] Introducing refcount-based life time management of the message loops in the service (daemon) and me2me host (network) processes. This CL introduces AutoMessageLoop wrapper that provides control over life time of a message loop via scoped_refptr references. This scheme is useful in the cases when shutdown code has to run on a particular thread or when the OS requires resources (such as windows) to be freed before exiting a message loop. The CL switches threads, owned by remoting::HostService, remoting::HostProcess and remoting::ChromotingHostContext, to refcount-based lifetime management. This change required updating tear-down sequences in remoting_me2me_host and the host plugin code. BUG=134694 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=154827

Patch Set 1 #

Patch Set 2 : - #

Patch Set 3 : Use AutoThread in ChromotingHostContext and the me2me host. #

Patch Set 4 : Destructors of ref-counted objects should not be public. #

Total comments: 12

Patch Set 5 : CR feedback #

Total comments: 30

Patch Set 6 : CR feedback. #

Patch Set 7 : Renamed AutoMessageLoop -> AutoTaskRunner #

Patch Set 8 : Bringing back the parent link. #

Total comments: 20

Patch Set 9 : CR feedback. #

Total comments: 22

Patch Set 10 : CR feedback and a unit test for AutoThreadTaskRunner. #

Total comments: 14

Patch Set 11 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+463 lines, -117 lines) Patch
A remoting/base/auto_thread_task_runner.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +87 lines, -0 lines 0 comments Download
A remoting/base/auto_thread_task_runner.cc View 1 2 3 4 5 6 7 8 9 1 chunk +68 lines, -0 lines 0 comments Download
A remoting/base/auto_thread_task_runner_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +72 lines, -0 lines 0 comments Download
M remoting/host/chromoting_host_context.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +37 lines, -31 lines 0 comments Download
M remoting/host/chromoting_host_context.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +51 lines, -17 lines 0 comments Download
M remoting/host/chromoting_host_context_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M remoting/host/chromoting_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -1 line 0 comments Download
M remoting/host/client_session_unittest.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M remoting/host/constants.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M remoting/host/host_mock_objects.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M remoting/host/plugin/host_script_object.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +20 lines, -7 lines 0 comments Download
M remoting/host/remoting_me2me_host.cc View 1 2 3 4 5 6 7 8 9 10 16 chunks +65 lines, -32 lines 0 comments Download
M remoting/host/simple_host_process.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M remoting/host/win/host_service.h View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -6 lines 0 comments Download
M remoting/host/win/host_service.cc View 1 2 3 4 5 6 7 8 9 9 chunks +40 lines, -20 lines 0 comments Download
M remoting/remoting.gyp View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
alexeypa (please no reviews)
PTAL.
8 years, 4 months ago (2012-08-21 20:25:28 UTC) #1
alexeypa (please no reviews)
On 2012/08/21 20:25:28, alexeypa wrote: > PTAL. Ping.
8 years, 4 months ago (2012-08-22 23:13:46 UTC) #2
Wez
On 2012/08/22 23:13:46, alexeypa wrote: > On 2012/08/21 20:25:28, alexeypa wrote: > > PTAL. > ...
8 years, 4 months ago (2012-08-24 20:16:29 UTC) #3
alexeypa (please no reviews)
On 2012/08/24 20:16:29, Wez wrote: > Please update the CL description to clarify exactly what ...
8 years, 4 months ago (2012-08-24 21:04:43 UTC) #4
Wez
http://codereview.chromium.org/10829467/diff/9002/remoting/base/auto_message_loop.cc File remoting/base/auto_message_loop.cc (right): http://codereview.chromium.org/10829467/diff/9002/remoting/base/auto_message_loop.cc#newcode36 remoting/base/auto_message_loop.cc:36: // Deletes |this| on the message loop and exists ...
8 years, 4 months ago (2012-08-24 21:30:49 UTC) #5
Wez
On 2012/08/24 21:04:43, alexeypa wrote: > On 2012/08/24 20:16:29, Wez wrote: > > Please update ...
8 years, 4 months ago (2012-08-24 21:31:19 UTC) #6
alexeypa (please no reviews)
On 2012/08/24 21:31:19, Wez wrote: > It just switches the IO thread to auto-managed lifetime, ...
8 years, 4 months ago (2012-08-24 21:46:29 UTC) #7
Wez
On 2012/08/24 21:46:29, alexeypa wrote: > On 2012/08/24 21:31:19, Wez wrote: > > It just ...
8 years, 4 months ago (2012-08-24 22:23:44 UTC) #8
alexeypa (please no reviews)
PTAL. https://chromiumcodereview.appspot.com/10829467/diff/9002/remoting/base/auto_message_loop.cc File remoting/base/auto_message_loop.cc (right): https://chromiumcodereview.appspot.com/10829467/diff/9002/remoting/base/auto_message_loop.cc#newcode36 remoting/base/auto_message_loop.cc:36: // Deletes |this| on the message loop and ...
8 years, 3 months ago (2012-08-27 21:19:40 UTC) #9
Wez
https://chromiumcodereview.appspot.com/10829467/diff/9002/remoting/host/remoting_me2me_host.cc File remoting/host/remoting_me2me_host.cc (right): https://chromiumcodereview.appspot.com/10829467/diff/9002/remoting/host/remoting_me2me_host.cc#newcode725 remoting/host/remoting_me2me_host.cc:725: return me2me_host.Run(&message_loop); On 2012/08/27 21:19:40, alexeypa wrote: > On ...
8 years, 3 months ago (2012-08-28 17:34:53 UTC) #10
alexeypa (please no reviews)
https://chromiumcodereview.appspot.com/10829467/diff/9002/remoting/host/remoting_me2me_host.cc File remoting/host/remoting_me2me_host.cc (right): https://chromiumcodereview.appspot.com/10829467/diff/9002/remoting/host/remoting_me2me_host.cc#newcode725 remoting/host/remoting_me2me_host.cc:725: return me2me_host.Run(&message_loop); On 2012/08/28 17:34:53, Wez wrote: > Right, ...
8 years, 3 months ago (2012-08-28 19:18:51 UTC) #11
alexeypa (please no reviews)
I renamed AutoMessageLoop to AutoThreadRunner and removed |parent_| link from it. I also tried to ...
8 years, 3 months ago (2012-08-29 14:54:32 UTC) #12
Wez
https://chromiumcodereview.appspot.com/10829467/diff/12003/remoting/host/chromoting_host_context.cc File remoting/host/chromoting_host_context.cc (right): https://chromiumcodereview.appspot.com/10829467/diff/12003/remoting/host/chromoting_host_context.cc#newcode42 remoting/host/chromoting_host_context.cc:42: base::Closure()); On 2012/08/28 19:18:51, alexeypa wrote: > On 2012/08/28 ...
8 years, 3 months ago (2012-08-30 18:20:12 UTC) #13
Wez
https://chromiumcodereview.appspot.com/10829467/diff/12003/remoting/host/plugin/host_script_object.cc File remoting/host/plugin/host_script_object.cc (right): https://chromiumcodereview.appspot.com/10829467/diff/12003/remoting/host/plugin/host_script_object.cc#newcode139 remoting/host/plugin/host_script_object.cc:139: disconnected_event_.Wait(); On 2012/08/30 18:20:12, Wez wrote: > On 2012/08/28 ...
8 years, 3 months ago (2012-08-30 18:25:40 UTC) #14
alexeypa (please no reviews)
https://chromiumcodereview.appspot.com/10829467/diff/12003/remoting/host/chromoting_host_context.cc File remoting/host/chromoting_host_context.cc (right): https://chromiumcodereview.appspot.com/10829467/diff/12003/remoting/host/chromoting_host_context.cc#newcode42 remoting/host/chromoting_host_context.cc:42: base::Closure()); On 2012/08/30 18:20:12, Wez wrote: > On 2012/08/28 ...
8 years, 3 months ago (2012-08-30 22:08:07 UTC) #15
Wez
Hopefully one last set of review comments, but otherwise looking good. https://chromiumcodereview.appspot.com/10829467/diff/28002/remoting/base/auto_thread_task_runner.h File remoting/base/auto_thread_task_runner.h (right): ...
8 years, 3 months ago (2012-08-30 23:56:43 UTC) #16
Sergey Ulanov
http://codereview.chromium.org/10829467/diff/43001/remoting/base/auto_thread_task_runner.h File remoting/base/auto_thread_task_runner.h (right): http://codereview.chromium.org/10829467/diff/43001/remoting/base/auto_thread_task_runner.h#newcode21 remoting/base/auto_thread_task_runner.h:21: class AutoThreadTaskRunner : public base::SingleThreadTaskRunner { can you please ...
8 years, 3 months ago (2012-08-31 01:25:18 UTC) #17
alexeypa (please no reviews)
PTAL. http://codereview.chromium.org/10829467/diff/28002/remoting/base/auto_thread_task_runner.h File remoting/base/auto_thread_task_runner.h (right): http://codereview.chromium.org/10829467/diff/28002/remoting/base/auto_thread_task_runner.h#newcode20 remoting/base/auto_thread_task_runner.h:20: // |AutoThreadTaskRunner| is dropped. On 2012/08/30 23:56:43, Wez ...
8 years, 3 months ago (2012-08-31 19:57:35 UTC) #18
Wez
LGTM w/ nits http://codereview.chromium.org/10829467/diff/41003/remoting/base/auto_thread_task_runner.h File remoting/base/auto_thread_task_runner.h (right): http://codereview.chromium.org/10829467/diff/41003/remoting/base/auto_thread_task_runner.h#newcode46 remoting/base/auto_thread_task_runner.h:46: // since Thread::Stop() cannot be called ...
8 years, 3 months ago (2012-09-04 18:09:38 UTC) #19
alexeypa (please no reviews)
FYI http://codereview.chromium.org/10829467/diff/41003/remoting/base/auto_thread_task_runner.h File remoting/base/auto_thread_task_runner.h (right): http://codereview.chromium.org/10829467/diff/41003/remoting/base/auto_thread_task_runner.h#newcode46 remoting/base/auto_thread_task_runner.h:46: // since Thread::Stop() cannot be called from an ...
8 years, 3 months ago (2012-09-04 18:42:52 UTC) #20
Wez
On 2012/09/04 18:42:52, alexeypa wrote: > FYI > > http://codereview.chromium.org/10829467/diff/41003/remoting/base/auto_thread_task_runner.h > File remoting/base/auto_thread_task_runner.h (right): > ...
8 years, 3 months ago (2012-09-04 18:46:54 UTC) #21
alexeypa (please no reviews)
On 2012/09/04 18:46:54, Wez wrote: > Doesn't look like the final patchset is uploaded? Still ...
8 years, 3 months ago (2012-09-04 18:49:18 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/alexeypa@chromium.org/10829467/47003
8 years, 3 months ago (2012-09-04 19:33:18 UTC) #23
commit-bot: I haz the power
8 years, 3 months ago (2012-09-04 22:27:45 UTC) #24
Change committed as 154827

Powered by Google App Engine
This is Rietveld 408576698