Connor Clark
unread,Jan 8, 2021, 6:43:52 PM1/8/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to devtools-dev, ca...@chromium.org, Simon Zünd, Connor Clark, devtools-dev, Yang Guo
> Instrument ChromeAutofillClient::PropagateAutofillPredictions to call into page_handler. You can check in content/browser/devtools/devtools_instrumentation.cc how to dispatch to the right handler from a single static method.
When I tried this, I ultimately got this error:
"""
ld.lld: error: undefined symbol: content::protocol::AutofillHandler::ForAgentHost(content::DevToolsAgentHostImpl*)
>>> referenced by chrome_autofill_client.cc
>>> ui/chrome_autofill_client.o:(autofill::ChromeAutofillClient::PropagateAutofillPredictions(content::RenderFrameHost*, std::__Cr::vector<autofill::FormStructure*, std::__Cr::allocator<autofill::FormStructure*> > const&)) in archive obj/chrome/browser/ui/libui.a
ld.lld: error: undefined symbol: content::protocol::AutofillHandler::OnAutofillPredictions()
>>> referenced by chrome_autofill_client.cc
>>> ui/chrome_autofill_client.o:(autofill::ChromeAutofillClient::PropagateAutofillPredictions(content::RenderFrameHost*, std::__Cr::vector<autofill::FormStructure*, std::__Cr::allocator<autofill::FormStructure*> > const&)) in archive obj/chrome/browser/ui/libui.a
"""
I assume it is because I included "content/browser" in "chrome/browser/ui/autofill/chrome_autofill_client.cc"... I noticed nothing in "chrome/browser/ui" includes "content/browser", so it seems wrong.
Perhaps I misunderstood your suggestion for how to dispatch to the correct handler?
> Alternatively to the step above: We probably need our own devtools_instrumentation.h in chrome/browser, or turn the one in content/ into a public API. We can discuss that in the Design Doc though.
Could it be that this is necessary for even a MVP?
> One other thing that may further complicate the implementation is that we don't have any instrumentation points in the content/renderer right now, but, fortunately, autofill has also an associated blink module that may be (ab)used to wire the instrumentation to DevTools.
I can't figure out how to abuse this :)
I tried making my own module "third_party/blink/renderer/modules/autofill" and attaching to the devtools session in "modules_initializer.cc", but I couldn't figure out how to call into it from "components/autofill". I guess the autofill predictions need to go through a public API?