ExtensionURLLoaderFactory::CreateLoaderAndStart currently makes an unnecessary jump to the IO thread to run GetExtensionInfo. This is done because the tests (ExtensionProtocolsTest) uses extensions::InfoMap which should only be referenced in the IO thread. In production ChromeContentBrowserClient uses the ExtensionRegistry which can be accessed on the UI thread. It should be possible to refactor the tests to not require this thread hop.
This is best done after the switch to the network service is complete. At this time the ExtensionProtocolHandler will be deleted and the RequestHandlerType::kURLRequest tests can be deleted from extension_protocols_unittest.cc. Afterwards the tests can be refactored to not use an InfoMap, and then CreateLoaderAndStart can start using the ExtensionRegistry class (and other items) directly. If this turns out to be unfeasable then consider using the URLLoaderFactoryHelper implementation from http://crrev.com/c/834749/15.
Comment 1 by dxie@chromium.org
, May 17 2018