Skip to content

Commit

Permalink
[Blobs] Don't store BlobStorageLimits as a reference in transport str…
Browse files Browse the repository at this point in the history
…ategy.

Rather than storing a const reference to something of unclear lifetime,
just make a copy. We could just copy the specific limits we need, but
there shouldn't be many TransportStrategy instances alive at the same
time anyway, so the cost of duplicating shouldn't be too high.

(cherry picked from commit 9a10c68)

(cherry picked from commit 7b51cb5)

Bug: 1180871
Change-Id: Ie1e31728b18f02c5d35df0ac0f285eb8f70cb268
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2713912
Reviewed-by: Olivier Yiptong <oyiptong@chromium.org>
Reviewed-by: Darwin Huang <huangdarwin@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Original-Original-Commit-Position: refs/heads/master@{#856503}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2713891
Reviewed-by: Krishna Govind <govind@chromium.org>
Reviewed-by: Srinivas Sista <srinivassista@chromium.org>
Cr-Original-Commit-Position: refs/branch-heads/4425@{#2}
Cr-Original-Branched-From: 4a7d24e-refs/heads/master@{#856252}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2714443
Cr-Commit-Position: refs/branch-heads/4426@{#3}
Cr-Branched-From: f849068-refs/heads/master@{#856488}
  • Loading branch information
mkruisselbrink authored and Krishna Govind committed Feb 23, 2021
1 parent b28ba29 commit 453850e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/browser/blob/blob_transport_strategy.cc
Expand Up @@ -239,7 +239,7 @@ class DataPipeTransportStrategy : public BlobTransportStrategy {
}
}

const BlobStorageLimits& limits_;
const BlobStorageLimits limits_;
base::circular_deque<base::OnceClosure> requests_;

mojo::ScopedDataPipeConsumerHandle consumer_handle_;
Expand Down Expand Up @@ -336,7 +336,7 @@ class FileTransportStrategy : public BlobTransportStrategy {
std::move(result_callback_).Run(BlobStatus::DONE);
}

const BlobStorageLimits& limits_;
const BlobStorageLimits limits_;

// State used to assign bytes elements to individual files.
// The index of the first file that still has available space.
Expand Down

0 comments on commit 453850e

Please sign in to comment.