Refactor ProtocolHandlerRegistry to allow batched protocol registration
Previously, ProtocolHandlerRegistry supported only single-protocol operations (e.g. add a handler to the registry and register with the OS in a single function). For the web app handler use case, repeatedly calling single-protocol functions for multiple app handlers is a problem because multiple OS registrations will result in multiple UACs being presented to the user. This CL lays the groundwork for upcoming changes to introduce batching to the ProtocolHandlerRegistry which allows for a single OS registration operation and single UAC. SetDefaults() is added to support registering multiple default web app handlers at a time. A single-protocol SetDefault() is also left in place for use in existing call sites. RemoveHandlers() is added to support removing multiple default web handlers and registering their replacement default handlers in batch operations. A single-protocol RemoveHandler() is left in place for use in existing call sites. Since this is just a refactor there should be no observable difference in behavior with this code. CL 2573383 will build on this code and add more test cases for the case of multiple registration. Bug: 1019239 Change-Id: I4488815d39fcce164a9c7054cbcc34d473d806ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2573319Reviewed-by:Dominick Ng <dominickn@chromium.org> Commit-Queue: Fabio Rocha <fabio.rocha@microsoft.com> Cr-Commit-Position: refs/heads/master@{#837641}
Showing
Please register or sign in to comment