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
|
@ -33,19 +33,22 @@ class ProtocolRegistry {
|
|||
CreateNonNetworkNavigationURLLoaderFactory(const std::string& scheme);
|
||||
|
||||
const HandlersMap& intercept_handlers() const { return intercept_handlers_; }
|
||||
const HandlersMap& handlers() const { return handlers_; }
|
||||
|
||||
bool RegisterProtocol(ProtocolType type,
|
||||
const std::string& scheme,
|
||||
const ProtocolHandler& handler);
|
||||
bool UnregisterProtocol(const std::string& scheme);
|
||||
bool IsProtocolRegistered(const std::string& scheme);
|
||||
|
||||
[[nodiscard]] const HandlersMap::mapped_type* FindRegistered(
|
||||
const std::string& scheme) const;
|
||||
|
||||
bool InterceptProtocol(ProtocolType type,
|
||||
const std::string& scheme,
|
||||
const ProtocolHandler& handler);
|
||||
bool UninterceptProtocol(const std::string& scheme);
|
||||
bool IsProtocolIntercepted(const std::string& scheme);
|
||||
|
||||
[[nodiscard]] const HandlersMap::mapped_type* FindIntercepted(
|
||||
const std::string& scheme) const;
|
||||
|
||||
private:
|
||||
friend class ElectronBrowserContext;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue