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

Issue 394903005: mojo: terminate apps if the shell goes away (Closed)

Created:
6 years, 5 months ago by tim (not reviewing)
Modified:
6 years, 4 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, ben+mojo_chromium.org
Project:
chromium
Visibility:
Public.

Description

mojo: terminate apps if the shell goes away Each application <> shell connection is represented by a ShellImpl instance on the shell side. This CL makes the Application watch its ShellPtr for pipe errors so it can Quit() itself if the shell goes away (shell loop destroyed). mojo_shell_tests starts using a new method to terminate all shell connections in this CL, and waits afterward until KeepAlive quits the loop signifying that all apps are gone. This is done prior to destroying the shell MessageLoop so that the test ensures apps have all died before the next test. In the future it would be a test failure if this wasn't a no-op, but we have things in the shell that don't quit themselves right now. The shell itself won't wait around for apps to die (as of this CL), but ~MessageLoop will still send the message to Application sides that will quit. ** NOTE ** This does not require an app build target to explicitly add magic *.cc files to their sources. It requires selecting an appropriate mojo_application_{chromium, standalone} library akin to mojo_environment_*. We can possibly combine these two in the future. BUG=394477 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287680 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287894

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : rebase #

Patch Set 4 : rebase again! #

Total comments: 1

Patch Set 5 : new and improved #

Patch Set 6 : rebase #

Total comments: 2

Patch Set 7 : back to ShellPtrWatcher #

Patch Set 8 : rebase BackgroundShellServiceLoader #

Patch Set 9 : rebase #

Patch Set 10 : rebase #

Patch Set 11 : gn #

Patch Set 12 : gn2 #

Patch Set 13 : post-revert :( #

Patch Set 14 : disable tests that touch nss for now #

Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -125 lines) Patch
M mojo/mojo.gyp View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -3 lines 0 comments Download
M mojo/mojo_base.gyp View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M mojo/mojo_examples.gypi View 1 2 3 4 5 6 7 22 chunks +22 lines, -22 lines 0 comments Download
M mojo/mojo_public.gypi View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -1 line 0 comments Download
M mojo/mojo_public_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M mojo/mojo_services.gypi View 1 2 3 4 5 6 7 8 9 12 chunks +12 lines, -12 lines 0 comments Download
M mojo/public/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/cpp/application/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +19 lines, -3 lines 0 comments Download
M mojo/public/cpp/application/DEPS View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -2 lines 0 comments Download
M mojo/public/cpp/application/application_impl.h View 1 2 3 4 5 6 7 8 9 3 chunks +17 lines, -1 line 0 comments Download
M mojo/public/cpp/application/lib/application_impl.cc View 1 2 5 6 2 chunks +20 lines, -4 lines 0 comments Download
A mojo/public/cpp/application/lib/application_impl_chromium.cc View 1 2 3 4 5 6 1 chunk +15 lines, -0 lines 0 comments Download
A + mojo/public/cpp/application/lib/application_impl_standalone.cc View 1 5 6 1 chunk +4 lines, -8 lines 0 comments Download
M mojo/service_manager/background_shell_service_loader.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -6 lines 0 comments Download
M mojo/service_manager/background_shell_service_loader.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -6 lines 0 comments Download
M mojo/service_manager/background_shell_service_loader_unittest.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -15 lines 0 comments Download
M mojo/service_manager/service_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -8 lines 0 comments Download
M mojo/services/native_viewport/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/network/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/public/cpp/view_manager/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M mojo/services/view_manager/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M mojo/shell/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M mojo/shell/context.h View 1 2 3 4 7 1 chunk +0 lines, -3 lines 0 comments Download
M mojo/shell/context.cc View 1 2 3 4 5 6 7 2 chunks +0 lines, -18 lines 0 comments Download
M mojo/shell/shell_test_base_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +14 lines, -6 lines 0 comments Download

Messages

Total messages: 35 (0 generated)
tim (not reviewing)
From a few looks over the ServiceFactory CL, I don't think much of this conflicts, ...
6 years, 5 months ago (2014-07-20 22:12:37 UTC) #1
darin (slow to review)
A few comments: 1- I think it would be nice if we could encapsulate the ...
6 years, 5 months ago (2014-07-22 03:58:55 UTC) #2
darin (slow to review)
On 2014/07/22 03:58:55, darin wrote: > A few comments: > > 1- I think it ...
6 years, 5 months ago (2014-07-22 04:00:08 UTC) #3
tim (not reviewing)
Thanks for the review. In general I agree with much of this; This patch is ...
6 years, 5 months ago (2014-07-22 17:47:07 UTC) #4
darin (slow to review)
LGTM
6 years, 5 months ago (2014-07-24 17:55:40 UTC) #5
tim (not reviewing)
The CQ bit was checked by tim@chromium.org
6 years, 5 months ago (2014-07-24 17:57:51 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/394903005/20001
6 years, 5 months ago (2014-07-24 17:59:36 UTC) #7
tim (not reviewing)
The CQ bit was checked by tim@chromium.org
6 years, 5 months ago (2014-07-24 19:01:25 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/394903005/40001
6 years, 5 months ago (2014-07-24 19:04:02 UTC) #9
tim (not reviewing)
The CQ bit was checked by tim@chromium.org
6 years, 5 months ago (2014-07-24 19:47:36 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/394903005/60001
6 years, 5 months ago (2014-07-24 19:48:37 UTC) #11
jamesr
https://codereview.chromium.org/394903005/diff/60001/mojo/public/cpp/application/lib/application_impl_chromium.cc File mojo/public/cpp/application/lib/application_impl_chromium.cc (right): https://codereview.chromium.org/394903005/diff/60001/mojo/public/cpp/application/lib/application_impl_chromium.cc#newcode11 mojo/public/cpp/application/lib/application_impl_chromium.cc:11: base::MessageLoop::current()->Quit(); hmm, in core_window_manager_unittests this blows up with the ...
6 years, 5 months ago (2014-07-24 19:52:44 UTC) #12
tim (not reviewing)
The CQ bit was unchecked by tim@chromium.org
6 years, 5 months ago (2014-07-24 20:31:25 UTC) #13
tim (not reviewing)
Please take another look, this is now based on https://codereview.chromium.org/420143003/. https://docs.google.com/a/chromium.org/document/d/1tKZw3cnnGEuoOD1gYLmPQtqYHNR0swLQLLhm7fV7jXw/edit has some context.
6 years, 4 months ago (2014-07-28 16:43:31 UTC) #14
darin (slow to review)
https://codereview.chromium.org/394903005/diff/120001/mojo/public/interfaces/service_provider/service_provider.mojom File mojo/public/interfaces/service_provider/service_provider.mojom (right): https://codereview.chromium.org/394903005/diff/120001/mojo/public/interfaces/service_provider/service_provider.mojom#newcode30 mojo/public/interfaces/service_provider/service_provider.mojom:30: Terminate(); I'm not sure this is the API we ...
6 years, 4 months ago (2014-07-28 16:49:59 UTC) #15
tim (not reviewing)
https://codereview.chromium.org/394903005/diff/120001/mojo/public/interfaces/service_provider/service_provider.mojom File mojo/public/interfaces/service_provider/service_provider.mojom (right): https://codereview.chromium.org/394903005/diff/120001/mojo/public/interfaces/service_provider/service_provider.mojom#newcode30 mojo/public/interfaces/service_provider/service_provider.mojom:30: Terminate(); On 2014/07/28 16:49:58, darin wrote: > I'm not ...
6 years, 4 months ago (2014-07-28 16:55:17 UTC) #16
tim (not reviewing)
On 2014/07/28 16:55:17, timsteele wrote: > https://codereview.chromium.org/394903005/diff/120001/mojo/public/interfaces/service_provider/service_provider.mojom > File mojo/public/interfaces/service_provider/service_provider.mojom (right): > > https://codereview.chromium.org/394903005/diff/120001/mojo/public/interfaces/service_provider/service_provider.mojom#newcode30 > ...
6 years, 4 months ago (2014-07-28 17:18:16 UTC) #17
tim (not reviewing)
OK, I feel this is ready for another look. It is based on https://codereview.chromium.org/437493002/, where ...
6 years, 4 months ago (2014-07-31 18:08:12 UTC) #18
tim (not reviewing)
On 2014/07/31 18:08:12, timsteele wrote: > OK, I feel this is ready for another look. ...
6 years, 4 months ago (2014-08-05 15:44:32 UTC) #19
Aaron Boodman
I'll take a look in an hour if somebody hasn't beaten me to it.
6 years, 4 months ago (2014-08-05 16:59:05 UTC) #20
Aaron Boodman
Sorry, actually -- after lunch. On Tue, Aug 5, 2014 at 9:59 AM, <aa@chromium.org> wrote: ...
6 years, 4 months ago (2014-08-05 18:30:09 UTC) #21
Aaron Boodman
LGTM, I figure if the other guys still want you to change something you can ...
6 years, 4 months ago (2014-08-05 20:00:21 UTC) #22
tim (not reviewing)
On 2014/08/05 20:00:21, Aaron Boodman wrote: > LGTM, I figure if the other guys still ...
6 years, 4 months ago (2014-08-05 20:13:35 UTC) #23
tim (not reviewing)
The CQ bit was checked by tim@chromium.org
6 years, 4 months ago (2014-08-05 20:30:20 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/394903005/220001
6 years, 4 months ago (2014-08-05 20:32:28 UTC) #25
tim (not reviewing)
The CQ bit was checked by tim@chromium.org
6 years, 4 months ago (2014-08-05 23:53:24 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/394903005/260001
6 years, 4 months ago (2014-08-05 23:56:32 UTC) #27
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_x64_rel on tryserver.chromium.win ...
6 years, 4 months ago (2014-08-06 03:50:12 UTC) #28
commit-bot: I haz the power
Change committed as 287680
6 years, 4 months ago (2014-08-06 05:35:26 UTC) #29
tim (not reviewing)
The CQ bit was checked by tim@chromium.org
6 years, 4 months ago (2014-08-06 19:10:54 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/394903005/300001
6 years, 4 months ago (2014-08-06 19:12:45 UTC) #31
tim (not reviewing)
The CQ bit was unchecked by tim@chromium.org
6 years, 4 months ago (2014-08-06 19:16:51 UTC) #32
tim (not reviewing)
The CQ bit was checked by tim@chromium.org
6 years, 4 months ago (2014-08-06 19:17:54 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/394903005/300001
6 years, 4 months ago (2014-08-06 19:19:56 UTC) #34
commit-bot: I haz the power
6 years, 4 months ago (2014-08-06 23:31:09 UTC) #35
Message was sent while issue was closed.
Change committed as 287894

Powered by Google App Engine
This is Rietveld 408576698