New issue
Advanced search Search tips

Issue 676325 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Don't pass doomed cache around as unique_ptr in callbacks

Project Member Reported by jkarlin@chromium.org, Dec 21 2016

Issue description

Releasing of a doomed handle winds up passing
std::unique_ptr<CacheStorageCache> values around in callbacks. Rather than the
callback owning the cache, let's keep it in the CacheStorage's doomed_caches_
object so that ownership is always clear.
 
The most important aspect of this is that we want to maintain the invariant that a CacheStorage always outlives its Caches. Owning the cache in the callback broke the invariant.
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e8992984e25e4a4fcfb88d3164379754b6df2879

commit e8992984e25e4a4fcfb88d3164379754b6df2879
Author: jkarlin <jkarlin@chromium.org>
Date: Wed Dec 21 18:03:48 2016

[CacheStorage] Fix ownership of doomed cache as it's cleaned up

Releasing of a doomed handle winds up passing
std::unique_ptr<CacheStorageCache> values around in callbacks. Rather than the
callback owning the cache, let's keep it in the CacheStorage's doomed_caches_
object so that ownership is always clear and to maintain the invariant that Caches are destructed before their respective CacheStorage is.

BUG= 676325 

Review-Url: https://codereview.chromium.org/2598643002
Cr-Commit-Position: refs/heads/master@{#440149}

[modify] https://crrev.com/e8992984e25e4a4fcfb88d3164379754b6df2879/content/browser/cache_storage/cache_storage.cc
[modify] https://crrev.com/e8992984e25e4a4fcfb88d3164379754b6df2879/content/browser/cache_storage/cache_storage.h

Status: Fixed (was: Started)

Sign in to add a comment