
On Windows, the set of Print Spooler API calls used to get the list of installed printers can require opening a connection to each printer. This might potentially block waiting on network connections to remote printers. Such delays can result in the EnumeratePrinters() call taking a long time, making the Print Preview UI unresponsive. There is a slightly different way to use the Print Spooler API that does not block on network connections. However, it does not return all of the information of interest for Print Preview. In particular, it is missing the location metadata. The location metadata can be found in the Windows registry for a printer driver. Since reading from the Windows registry also does not block on network connections, using a combination of the two provides a way to more quickly return all the same information as the prior Print Spooler-only method. Since the location metadata is relatively minor (only shows up in the dialog to select a destination), using the registry in this way is a relatively low-risk way to speed up the enumeration, since all the other information is still acquired using the Print Spooler API. Introduce the ability to use a mixed method of using the registry to supplement the faster Printer Spooler API method. Make this approach the default, but guard it behind a feature flag so that it can be disabled with an emergency kill switch if necessary. Given that this is a change to the low-level interaction with the operating system, introduce a manual unit test to validate the new method. Also update the printing_features files to concatenate the nested namespaces. Bug: 374128404 Change-Id: Icc48e928dd484b916b2d5a130c39f5dc313ee35a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6220277 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Alan Screen <awscreen@chromium.org> Cr-Commit-Position: refs/heads/main@{#1427285}
Chromium
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead,
follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.