perf: prefer GURL string_view getters (#43471)

* chore: avoid double-call to url.scheme() in WebContentsZoomController::SetZoomMode()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use gurl.scheme_piece() in GetAppInfoHelperForProtocol()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use gurl.scheme_piece() in Browser::GetApplicationNameForProtocol()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: add std::less<> to HandlersMap

This lets us search it using string_view keys

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: ProtocolRegistry::FindRegistered() now takes a std::string_view

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use gurl.scheme_piece() in InspectableWebContents::LoadNetworkResource()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: ProtocolRegistry::FindIntercepted() now takes a std::string_view

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use gurl.scheme_piece() in SimpleURLLoaderWrapper::GetURLLoaderFactoryForURL()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use gurl.scheme_piece() in ProxyingURLLoaderFactory::CreateLoaderAndStart()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use gurl.host_piece() in ElectronWebUIControllerFactory::GetWebUIType()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use gurl.host_piece() in ElectronWebUIControllerFactory::CreateWebUIControllerForURL()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-08-23 20:58:59 -05:00 committed by GitHub
parent 824b1aeb71
commit f08c6f2e85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 26 additions and 19 deletions

View file

@ -684,7 +684,7 @@ void InspectableWebContents::LoadNetworkResource(DispatchCallback callback,
std::make_unique<network::WrapperPendingSharedURLLoaderFactory>(
std::move(pending_remote)));
} else if (const auto* const protocol_handler =
protocol_registry->FindRegistered(gurl.scheme())) {
protocol_registry->FindRegistered(gurl.scheme_piece())) {
url_loader_factory = network::SharedURLLoaderFactory::Create(
std::make_unique<network::WrapperPendingSharedURLLoaderFactory>(
ElectronURLLoaderFactory::Create(protocol_handler->first,