Enable new ScopedReservation to inherit another.
Bug: b:233089187
Bug: b:237811834
Make it possible to create a new scoped reservation for the same
resource interface as another one - useful when the latter is not
available directly (this eliminates the need to propagate the interface
to where it is needed).
Also some clean-ups in the code/declarations.
Change-Id: I0e7f9f4bdbef593eab7c52fbec018715e629839b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3754714
Reviewed-by: Hong Xu <[email protected]>
Commit-Queue: Hong Xu <[email protected]>
Auto-Submit: Leonid Baraz <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1023479}
diff --git a/components/reporting/resources/resource_interface.h b/components/reporting/resources/resource_interface.h
index a3fb0fb..8f29c72 100644
--- a/components/reporting/resources/resource_interface.h
+++ b/components/reporting/resources/resource_interface.h
@@ -76,6 +76,10 @@
ScopedReservation(
uint64_t size,
scoped_refptr<ResourceInterface> resource_interface) noexcept;
+ // New reservation on the same resource interface as |other_reservation|.
+ ScopedReservation(uint64_t size,
+ const ScopedReservation& other_reservation) noexcept;
+ // Move constructor.
ScopedReservation(ScopedReservation&& other) noexcept;
ScopedReservation(const ScopedReservation& other) = delete;
ScopedReservation& operator=(ScopedReservation&& other) = delete;