[cleanup] update PrintBackend::EnumeratePrinters to use reference
The API for EnumeratePrinters() indicates that the provided list is to
be empty on entry. Some implementations (but not all) were explicitly
calling to force it empty. Replace those with a DCHECK on emptiness,
to match the API description.
Bug: 1206045
Change-Id: Ide27e4f519db9281a46a2ede392a5b7b951619d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3699085
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1014149}
diff --git a/chrome/services/printing/print_backend_service_impl.cc b/chrome/services/printing/print_backend_service_impl.cc
index 48c8592..596ff08 100644
--- a/chrome/services/printing/print_backend_service_impl.cc
+++ b/chrome/services/printing/print_backend_service_impl.cc
@@ -412,7 +412,7 @@
}
PrinterList printer_list;
- mojom::ResultCode result = print_backend_->EnumeratePrinters(&printer_list);
+ mojom::ResultCode result = print_backend_->EnumeratePrinters(printer_list);
if (result != mojom::ResultCode::kSuccess) {
std::move(callback).Run(mojom::PrinterListResult::NewResultCode(result));
return;