Discussion:
[chromium-discuss] Send Mojo message failed
Lee Star
2018-09-10 13:59:13 UTC
Permalink
1, I defined a mojom file (\src\content\common) : foo.mojom. It only has
one simple message: bar();

2, I defined mojo message impl files "foo_impl.cc/h" in renderer
(src\content\renderer\mojo\mojom).

3, I registered the impl file in
render_frame_impl.cc RenderThreadImpl::Init.
GetInterfaceRegistry()->AddInterface(base::Bind(&content::FooImpl::Create));

4, I defined the "FooPtr foo_;" (InterfacePtr) in Browser
(render_process_host_impl.cc), and connect it to remote Interfaces:
GetRemoteInterfaces()->GetInterface(mojo::MakeRequest(&foo_));

5, Then send the message:
foo_->bar();

6, However, the message haven't reached to foo_impl.cc, the impl function
wasn't triggered by the message.

7, And wrong messages popped out as below. What's going on here? I was
stuck to this problem for a long time. It drives me so mad. Please help me
!! So much thanks to you!

[0910/205355.869972:ERROR:interface_registry.cc(218)] InterfaceProviderSpec
"service_manager:connector" prevented service: content_browser from binding
interface: content::mojom::Foo exposed by: content_renderer
[0910/205355.870350:WARNING:interface_registry.cc(222)]

InterfaceRegistry(service_manager:connector):
Owned by:
***@3_1 run as: 6988aef1-adab-4160-978a-598a422c2a8a

Providing:
capability: browser containing interfaces:
IPC::mojom::ChannelBootstrap
content::mojom::EmbeddedWorkerInstanceClient
content::mojom::EmbeddedWorkerSetup
content::mojom::FrameFactory
content::mojom::RenderWidgetWindowTreeClientFactory
visitedlink::mojom::VisitedLinkNotificationSink
web_cache::mojom::WebCache
capability: service_manager:service_factory containing interfaces:
service_manager::mojom::ServiceFactory

Requiring:
From: content_browser:
renderer
From: device:
device:power_monitor
device:time_zone_monitor
From: ui:
discardable_memory
gpu_client

Bound to:
content_browser@ run as: 6988aef1-adab-4160-978a-598a422c2a8a

Providing:
capability: plugin containing interfaces:
discardable_memory::mojom::DiscardableSharedMemoryManager
ui::mojom::Gpu
capability: renderer containing interfaces:
blink::mojom::BackgroundSyncService
blink::mojom::BroadcastChannelProvider
blink::mojom::BudgetService
blink::mojom::Hyphenation
blink::mojom::MimeRegistry
blink::mojom::NotificationService
blink::mojom::OffscreenCanvasCompositorFrameSinkProvider
blink::mojom::OffscreenCanvasSurfaceFactory
blink::mojom::PermissionService
blink::mojom::WebSocket
content::mojom::MemoryCoordinatorHandle
content::mojom::ServiceWorkerDispatcherHost
content::mojom::StoragePartitionService
content::mojom::URLLoaderFactory
content::mojom::VideoCaptureHost
device::BatteryMonitor
device::mojom::GamepadMonitor
device::mojom::LightSensor
device::mojom::MotionSensor
device::mojom::OrientationAbsoluteSensor
device::mojom::OrientationSensor
discardable_memory::mojom::DiscardableSharedMemoryManager
media::mojom::ImageCapture
memory_coordinator::mojom::MemoryCoordinatorHandle
payments::mojom::PaymentAppManager
ui::mojom::Gpu
capability: service_manager:service_factory containing interfaces:
service_manager::mojom::ServiceFactory

Requiring:
From: *:
app
From: content_browser:
ash
From: content_gpu:
browser
From: content_plugin:
browser
From: content_renderer:
browser
From: content_utility:
browser
From: file:
file:filesystem
file:leveldb
From: media:
media:media
From: service_manager:
service_manager:client_process
service_manager:instance_name
service_manager:user_id

Binders registered for:
* IPC::mojom::ChannelBootstrap

* - denotes an interface exposed to remote per policy.
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...