perf: prefer GURL string_view getters (#43443)
* chore: avoid double-call to url.scheme() in WebContentsZoomController::SetZoomMode() * perf: use gurl.scheme_piece() in GetAppInfoHelperForProtocol() * perf: use gurl.scheme_piece() in Browser::GetApplicationNameForProtocol() * refactor: add std::less<> to HandlersMap This lets us search it using string_view keys * refactor: ProtocolRegistry::FindRegistered() now takes a std::string_view * perf: use gurl.scheme_piece() in InspectableWebContents::LoadNetworkResource() * refactor: ProtocolRegistry::FindIntercepted() now takes a std::string_view * perf: use gurl.scheme_piece() in SimpleURLLoaderWrapper::GetURLLoaderFactoryForURL() * perf: use gurl.scheme_piece() in ProxyingURLLoaderFactory::CreateLoaderAndStart() * perf: use gurl.host_piece() in ElectronWebUIControllerFactory::GetWebUIType() * perf: use gurl.host_piece() in ElectronWebUIControllerFactory::CreateWebUIControllerForURL()
This commit is contained in:
parent
7f34b0e6f5
commit
5a1eeea102
10 changed files with 26 additions and 19 deletions
|
@ -95,7 +95,7 @@ bool IsValidCustomProtocol(const std::wstring& scheme) {
|
|||
// (https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/ne-shlwapi-assocstr)
|
||||
// and returns the application name, icon and path that handles the protocol.
|
||||
std::wstring GetAppInfoHelperForProtocol(ASSOCSTR assoc_str, const GURL& url) {
|
||||
const std::wstring url_scheme = base::ASCIIToWide(url.scheme());
|
||||
const std::wstring url_scheme = base::ASCIIToWide(url.scheme_piece());
|
||||
if (!IsValidCustomProtocol(url_scheme))
|
||||
return std::wstring();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue