ServiceWorker: Simplify callback type of service_worker_client_utils::GetClients()
TL;DR: This CL makes service_worker_client_utils::GetClients() take blink::mojom::ServiceWorkerHost::GetClientsCallback as a callback instead of base::OnceCallback<void(std::unique_ptr<ServiceWorkerClientPtrs>)>. > Details - In the original code, GetClients() uses std::unique_ptr<ServiceWorkerClientPtrs> as a container to collect client information. ServiceWorkerClientsPtrs is an alias of std::vector<blink::mojom::ServiceWorkerClientInfoPtr>> so this is expanded to std::unique_ptr<std::vector<blink::mojom::ServiceWorkerClientInfoPtr>>> std::vector behaves like a smart pointer, so it's not necessary to wrap std::vector with std::unique_ptr, that is, GetClients() can directly uses std::vector<blink::mojom::ServiceWorkerClientInfoPtr>> as the container type. - In the original code, GetClients() takes base::OnceCallback<void(std::unique_ptr<ServiceWorkerClientPtrs>)> as a callback type. As mentioned above, this can be simplified to base::OnceCallback<void(std::vector<blink::mojom::ServiceWorkerClientInfoPtr>>)> This is equal to blink::mojom::ServiceWorkerHost::GetClientsCallback Change-Id: Ie50965a5d44919207d2829c1642449e300ecc9ea Bug: n/a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943717 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/master@{#720144}
Showing
Please register or sign in to comment