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:
parent
865b0499bb
commit
e2acdffe58
5 changed files with 54 additions and 52 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue