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

Issue 236813002: Move Mojo channel initialization closer to IPC::Channel setup (Closed)

Created:
6 years, 8 months ago by darin (slow to review)
Modified:
6 years, 8 months ago
CC:
chromium-reviews, creis+watch_chromium.org, viettrungluu+watch_chromium.org, nasko+codewatch_chromium.org, jam, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, ben+mojo_chromium.org
Visibility:
Public.

Description

Move Mojo channel initialization closer to IPC::Channel setup This CL introduces two new content classes: - MojoApplicationHost encapsulates what's needed to host a Mojo App using Chrome IPC to bootstrap. - MojoApplication represents what's needed to be a Mojo App using Chrome IPC to bootstrap. The RenderProcess and RenderProcessHost interfaces are replaced with WebUISetup and WebUISetupClient interfaces. This way the interface is more specific to the service of setting up WebUI. WebUISetupClient is empty and uninteresting. RenderProcessHostImpl no longer deals with WebUI setup. That is all done directly by RenderViewHostImpl by talking to the WebUISetup service. Service names get defined in content/common/mojo/mojo_service_names.{h,cc}. R=sky@chromium.org, tsepez@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=265693

Patch Set 1 #

Total comments: 1

Patch Set 2 : Now with MojoApplicationHost #

Patch Set 3 : Add MojoApplication #

Patch Set 4 : fix lint errors #

Patch Set 5 : fixup #

Total comments: 20

Patch Set 6 : updates #

Patch Set 7 : updates #

Patch Set 8 : simplify #

Patch Set 9 : move to content/child #

Patch Set 10 : Improve comments #

Patch Set 11 : include guards #

Total comments: 8

Patch Set 12 : address code review feedback from sky@ #

Patch Set 13 : add missing dependencies #

Patch Set 14 : Lazily construct MojoApplication #

Total comments: 5

Patch Set 15 : address review feedback; fix more dependencies #

Patch Set 16 : more missing deps #

Unified diffs Side-by-side diffs Delta from patch set Stats (+461 lines, -491 lines) Patch
A content/browser/mojo/mojo_application_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +51 lines, -0 lines 0 comments Download
A content/browser/mojo/mojo_application_host.cc View 1 2 3 4 5 6 7 8 9 1 chunk +65 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +10 lines, -5 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 chunks +25 lines, -10 lines 0 comments Download
D content/browser/renderer_host/render_process_host_mojo_impl.h View 1 2 3 4 5 1 chunk +0 lines, -58 lines 0 comments Download
D content/browser/renderer_host/render_process_host_mojo_impl.cc View 1 2 3 4 5 1 chunk +0 lines, -93 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 2 chunks +9 lines, -3 lines 0 comments Download
M content/child/child_thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +12 lines, -1 line 0 comments Download
M content/child/child_thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +13 lines, -0 lines 0 comments Download
A content/child/mojo/mojo_application.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +47 lines, -0 lines 0 comments Download
A content/child/mojo/mojo_application.cc View 1 2 3 4 5 6 7 8 1 chunk +45 lines, -0 lines 0 comments Download
M content/common/mojo/mojo_messages.h View 1 chunk +2 lines, -1 line 0 comments Download
A content/common/mojo/mojo_service_names.h View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download
A + content/common/mojo/mojo_service_names.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
D content/common/mojo/render_process.mojom View 1 chunk +0 lines, -17 lines 0 comments Download
A content/common/web_ui_setup.mojom View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
M content/content_app.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 3 chunks +3 lines, -2 lines 0 comments Download
M content/content_child.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_common_mojo_bindings.gypi View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M content/content_gpu.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/content_plugin.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M content/content_ppapi_plugin.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -2 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/content_utility.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M content/content_worker.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
D content/renderer/mojo/mojo_render_process_observer.h View 1 2 3 4 5 1 chunk +0 lines, -61 lines 0 comments Download
D content/renderer/mojo/mojo_render_process_observer.cc View 1 2 3 4 5 1 chunk +0 lines, -72 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +14 lines, -4 lines 0 comments Download
A content/renderer/web_ui_setup_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +39 lines, -0 lines 0 comments Download
A content/renderer/web_ui_setup_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +41 lines, -0 lines 0 comments Download
A + mojo/common/channel_init.h View 1 2 3 4 5 3 chunks +15 lines, -22 lines 0 comments Download
A + mojo/common/channel_init.cc View 1 2 3 4 5 3 chunks +9 lines, -9 lines 0 comments Download
D mojo/common/mojo_channel_init.h View 1 2 3 4 5 1 chunk +0 lines, -66 lines 0 comments Download
D mojo/common/mojo_channel_init.cc View 1 2 3 4 5 1 chunk +0 lines, -59 lines 0 comments Download
M mojo/mojo.gyp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
darin (slow to review)
This is a big change to the way we have had things setup in content/ ...
6 years, 8 months ago (2014-04-16 05:46:18 UTC) #1
sky
Generally I like it! https://codereview.chromium.org/236813002/diff/80001/content/browser/mojo/mojo_application_host.cc File content/browser/mojo/mojo_application_host.cc (right): https://codereview.chromium.org/236813002/diff/80001/content/browser/mojo/mojo_application_host.cc#newcode53 content/browser/mojo/mojo_application_host.cc:53: base::PlatformFile client_file = DCHECK(client_handle_.is_valid()) ? ...
6 years, 8 months ago (2014-04-16 17:18:10 UTC) #2
DaveMoore
https://codereview.chromium.org/236813002/diff/1/content/browser/renderer_host/render_process_host_impl.h File content/browser/renderer_host/render_process_host_impl.h (right): https://codereview.chromium.org/236813002/diff/1/content/browser/renderer_host/render_process_host_impl.h#newcode78 content/browser/renderer_host/render_process_host_impl.h:78: : public IRenderProcessHost, Using IRenderProcessHost makes this read really ...
6 years, 8 months ago (2014-04-16 23:08:36 UTC) #3
darin (slow to review)
Thanks for the feedback! https://codereview.chromium.org/236813002/diff/80001/content/browser/mojo/mojo_application_host.cc File content/browser/mojo/mojo_application_host.cc (right): https://codereview.chromium.org/236813002/diff/80001/content/browser/mojo/mojo_application_host.cc#newcode53 content/browser/mojo/mojo_application_host.cc:53: base::PlatformFile client_file = On 2014/04/16 ...
6 years, 8 months ago (2014-04-16 23:26:04 UTC) #4
DaveMoore
https://codereview.chromium.org/236813002/diff/80001/content/browser/renderer_host/render_process_host_impl.h File content/browser/renderer_host/render_process_host_impl.h (right): https://codereview.chromium.org/236813002/diff/80001/content/browser/renderer_host/render_process_host_impl.h#newcode78 content/browser/renderer_host/render_process_host_impl.h:78: class CONTENT_EXPORT RenderProcessHostImpl So what will determine what's in ...
6 years, 8 months ago (2014-04-17 17:56:09 UTC) #5
darin (slow to review)
OK, please take another look. This is a bit different now. The biggest change is ...
6 years, 8 months ago (2014-04-22 06:45:36 UTC) #6
koz (OOO until 15th September)
https://codereview.chromium.org/236813002/diff/80001/content/browser/renderer_host/render_process_host_impl.h File content/browser/renderer_host/render_process_host_impl.h (right): https://codereview.chromium.org/236813002/diff/80001/content/browser/renderer_host/render_process_host_impl.h#newcode78 content/browser/renderer_host/render_process_host_impl.h:78: class CONTENT_EXPORT RenderProcessHostImpl On 2014/04/17 17:56:09, DaveMoore wrote: > ...
6 years, 8 months ago (2014-04-22 07:09:58 UTC) #7
sky
https://codereview.chromium.org/236813002/diff/200001/content/browser/renderer_host/render_process_host_impl.h File content/browser/renderer_host/render_process_host_impl.h (right): https://codereview.chromium.org/236813002/diff/200001/content/browser/renderer_host/render_process_host_impl.h#newcode248 content/browser/renderer_host/render_process_host_impl.h:248: void ConnectTo(const char* service_name, Is service_name always going to ...
6 years, 8 months ago (2014-04-22 15:52:14 UTC) #8
darin (slow to review)
On 2014/04/22 15:52:14, sky wrote: > https://codereview.chromium.org/236813002/diff/200001/content/browser/renderer_host/render_process_host_impl.h > File content/browser/renderer_host/render_process_host_impl.h (right): > > https://codereview.chromium.org/236813002/diff/200001/content/browser/renderer_host/render_process_host_impl.h#newcode248 > ...
6 years, 8 months ago (2014-04-22 17:16:43 UTC) #9
darin (slow to review)
On 2014/04/22 15:52:14, sky wrote: > https://codereview.chromium.org/236813002/diff/200001/content/browser/renderer_host/render_process_host_impl.h > File content/browser/renderer_host/render_process_host_impl.h (right): > > https://codereview.chromium.org/236813002/diff/200001/content/browser/renderer_host/render_process_host_impl.h#newcode248 > ...
6 years, 8 months ago (2014-04-22 17:28:17 UTC) #10
darin (slow to review)
On 2014/04/22 07:09:58, koz wrote: > https://codereview.chromium.org/236813002/diff/80001/content/browser/renderer_host/render_process_host_impl.h > File content/browser/renderer_host/render_process_host_impl.h (right): > > https://codereview.chromium.org/236813002/diff/80001/content/browser/renderer_host/render_process_host_impl.h#newcode78 > ...
6 years, 8 months ago (2014-04-22 17:32:15 UTC) #11
sky
LGTM
6 years, 8 months ago (2014-04-22 18:15:03 UTC) #12
darin (slow to review)
Hi Tom, Could you please review this from a security point of view. The IPC ...
6 years, 8 months ago (2014-04-22 21:02:19 UTC) #13
Tom Sepez
I think this is OK in that the main risk is having an "inert" mojo::ShellClient ...
6 years, 8 months ago (2014-04-22 21:26:18 UTC) #14
Tom Sepez
This isn't yet pulling in any of the dynamic library loader stuff into the browser, ...
6 years, 8 months ago (2014-04-22 21:32:29 UTC) #15
darin (slow to review)
On 2014/04/22 21:32:29, Tom Sepez wrote: > This isn't yet pulling in any of the ...
6 years, 8 months ago (2014-04-22 22:50:22 UTC) #16
darin (slow to review)
On 2014/04/22 21:26:18, Tom Sepez wrote: > I think this is OK in that the ...
6 years, 8 months ago (2014-04-22 22:56:39 UTC) #17
Tom Sepez
On 2014/04/22 22:56:39, darin wrote: > On 2014/04/22 21:26:18, Tom Sepez wrote: > > I ...
6 years, 8 months ago (2014-04-23 01:30:06 UTC) #18
darin (slow to review)
Committed patchset #16 manually as r265693 (presubmit successful).
6 years, 8 months ago (2014-04-23 18:36:58 UTC) #19
brianderson
On 2014/04/23 18:36:58, darin wrote: > Committed patchset #16 manually as r265693 (presubmit successful). We ...
6 years, 8 months ago (2014-04-23 19:40:40 UTC) #20
Vadim Sh.
I think this CL also caused errors in interactive_ui_tests on Linux. See http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%282%29/builds/45553: AppListServiceInteractiveTest.ShowAndDismiss (run ...
6 years, 8 months ago (2014-04-23 20:58:25 UTC) #21
darin (slow to review)
6 years, 8 months ago (2014-04-23 21:37:29 UTC) #22
Message was sent while issue was closed.
On 2014/04/23 20:58:25, Vadim Sh. wrote:
> I think this CL also caused errors in interactive_ui_tests on Linux. See
>
http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29...:
> 
> AppListServiceInteractiveTest.ShowAndDismiss (run #1):
> [ RUN      ] AppListServiceInteractiveTest.ShowAndDismiss
> Xlib:  extension "RANDR" missing on display ":9".
> [9488:9488:0423/130618:INFO:audio_manager_pulse.cc(256)] Failed to connect to
> the context.  Error: Connection refused
> Xlib:  extension "RANDR" missing on display ":9".
> [9488:9488:0423/130618:WARNING:password_store_factory.cc(213)] Using basic
> (unencrypted) store for password storage. See
> http://code.google.com/p/chromium/wiki/LinuxPasswordStorage for more
information
> about password storage options.
> [9488:9515:0423/130620:ERROR:raw_channel_posix.cc(115)] read: Connection reset
> by peer
> [9488:9515:0423/130620:ERROR:channel.cc(289)] RawChannel fatal error (type 1)
> [9488:9515:0423/130620:FATAL:raw_channel_posix.cc(273)] Check failed:
> !read_watcher_.get() || pending_read_.
> #0 0x7f0589087dd9 base::debug::StackTrace::StackTrace()
> #1 0x7f05891016ad logging::LogMessage::~LogMessage()
> #2 0x7f05736621bf mojo::system::(anonymous
> namespace)::RawChannelPosix::OnFileCanReadWithoutBlocking()
> #3 0x7f0589050a2e
>
base::MessagePumpLibevent::FileDescriptorWatcher::OnFileCanReadWithoutBlocking()
> #4 0x7f05890521cf base::MessagePumpLibevent::OnLibeventNotification()
> #5 0x7f0589218a5c event_process_active
> #6 0x7f0589218d86 event_base_loop
> #7 0x7f0589051995 base::MessagePumpLibevent::Run()
> #8 0x7f0589121c33 base::MessageLoop::RunHandler()
> #9 0x7f058917ae34 base::RunLoop::Run()
> #10 0x7f05891213a2 base::MessageLoop::Run()
> #11 0x7f05891d5d82 base::Thread::Run()
> #12 0x7f057b9d81b9 content::BrowserThreadImpl::IOThreadRun()
> #13 0x7f057b9d836a content::BrowserThreadImpl::Run()
> #14 0x7f05891d5fd2 base::Thread::ThreadMain()
> #15 0x7f05891c3b21 base::(anonymous namespace)::ThreadFunc()
> #16 0x7f0578cf7e9a start_thread
> #17 0x7f05765e63fd clone
> 
> After the revert the bot cycled green.

We don't believe that failure is specific to this CL. For this
error, we should probably just disable the tests.

However, given the iOS issue, maybe revert is the best answer.
I don't understand the runhooks issue there.

Powered by Google App Engine
This is Rietveld 408576698