Bug 1543298 part 3: For out-of-process iframes, send the embedded document accessible's COM proxy to the embedder. r=eeejay

This will be later exposed as a child of the embedder OuterDocAccessible.

Differential Revision: https://phabricator.services.mozilla.com/D32280

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Teh 2019-05-24 00:19:51 +00:00
Родитель 4e9fb4dabe
Коммит a23e2db32f
3 изменённых файлов: 30 добавлений и 0 удалений

Просмотреть файл

@ -536,6 +536,30 @@ ipc::IPCResult DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
ProxyCreated(aChildDoc, Interfaces::DOCUMENT | Interfaces::HYPERTEXT);
}
#if defined(XP_WIN)
auto embeddedBrowser = static_cast<dom::BrowserParent*>(aChildDoc->Manager());
dom::BrowserBridgeParent* bridge = embeddedBrowser->GetBrowserBridgeParent();
if (bridge) {
// aChildDoc is an embedded document in a different content process to
// this document.
// Send a COM proxy for the embedded document to the embedder process
// hosting the iframe. This will be returned as the child of the
// embedder OuterDocAccessible.
RefPtr<IDispatch> docAcc;
aChildDoc->GetCOMInterface((void**)getter_AddRefs(docAcc));
RefPtr<IDispatch> docWrapped(
mscom::PassthruProxy::Wrap<IDispatch>(WrapNotNull(docAcc)));
IDispatchHolder::COMPtrType docPtr(
mscom::ToProxyUniquePtr(std::move(docWrapped)));
IDispatchHolder docHolder(std::move(docPtr));
if (bridge->SendSetEmbeddedDocAccessibleCOMProxy(docHolder)) {
# if defined(MOZ_SANDBOX)
mDocProxyStream = docHolder.GetPreservedStream();
# endif // defined(MOZ_SANDBOX)
}
}
#endif // defined(XP_WIN)
return IPC_OK();
}

Просмотреть файл

@ -268,6 +268,7 @@ class DocAccessibleParent : public ProxyAccessible,
# if defined(MOZ_SANDBOX)
mscom::PreservedStreamPtr mParentProxyStream;
mscom::PreservedStreamPtr mDocProxyStream;
# endif // defined(MOZ_SANDBOX)
#endif // defined(XP_WIN)

Просмотреть файл

@ -1126,6 +1126,11 @@ mozilla::ipc::IPCResult BrowserParent::RecvPDocAccessibleConstructor(
// In this case, we don't get aParentDoc and aParentID.
MOZ_ASSERT(!aParentDoc && !aParentID);
MOZ_ASSERT(embedderID);
# ifdef XP_WIN
MOZ_ASSERT(!aDocCOMProxy.IsNull());
RefPtr<IAccessible> proxy(aDocCOMProxy.Get());
doc->SetCOMInterface(proxy);
# endif
mozilla::ipc::IPCResult added = embedderDoc->AddChildDoc(doc, embedderID);
if (!added) {
# ifdef DEBUG