perf: avoid protocol registry redundant lookup (#41991)

* perf: avoid redundant map lookup in SimpleURLLoaderWrapper::GetURLLoaderFactoryForURL()

* perf: avoid redundant map lookup in InspectableWebContents::LoadNetworkResource()

* refactor: remove unused ProtocolRegistry::IsProtocolRegistered()

refactor: remove unused ProtocolRegistry::IsProtocolIntercepted()

* refactor: remove unused ProtocolRegistry::handlers()

* refactor: rename ProtocolRegistry::FindIntercepted()

refactor: rename ProtocolRegistry::FindRegistered()

similar semantics to base::Value::Find*()

* chore: follow Google C++ brace style

chore: use same variable names as in main
This commit is contained in:
Charles Kerr 2024-05-09 08:53:09 -05:00 committed by GitHub
parent 865b0499bb
commit e2acdffe58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 52 deletions

View file

@ -232,7 +232,7 @@ bool Protocol::UnregisterProtocol(const std::string& scheme,
}
bool Protocol::IsProtocolRegistered(const std::string& scheme) {
return protocol_registry_->IsProtocolRegistered(scheme);
return protocol_registry_->FindRegistered(scheme) != nullptr;
}
ProtocolError Protocol::InterceptProtocol(ProtocolType type,
@ -251,7 +251,7 @@ bool Protocol::UninterceptProtocol(const std::string& scheme,
}
bool Protocol::IsProtocolIntercepted(const std::string& scheme) {
return protocol_registry_->IsProtocolIntercepted(scheme);
return protocol_registry_->FindIntercepted(scheme) != nullptr;
}
v8::Local<v8::Promise> Protocol::IsProtocolHandled(const std::string& scheme,