diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-12 18:00:42 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-12 18:00:42 +0000 |
commit | 417567fa2a277c8af860d2ffb82f8f26d1226c00 (patch) | |
tree | cf2ba92677b29c72dc92d0aac3cfb1a525841502 /net/disk_cache/rankings.cc | |
parent | 74ce911d60a9d013cdbd93a244c7f7639956ab13 (diff) | |
download | chromium_src-417567fa2a277c8af860d2ffb82f8f26d1226c00.zip chromium_src-417567fa2a277c8af860d2ffb82f8f26d1226c00.tar.gz chromium_src-417567fa2a277c8af860d2ffb82f8f26d1226c00.tar.bz2 |
Disk Cache: Make sure that chaining an entry to the current head works
for read_only caches.
BUG=117598
TEST=net_unittests
Review URL: https://chromiumcodereview.appspot.com/9668027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/rankings.cc')
-rw-r--r-- | net/disk_cache/rankings.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc index 4d936f3..a5ef839 100644 --- a/net/disk_cache/rankings.cc +++ b/net/disk_cache/rankings.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -575,6 +575,12 @@ bool Rankings::GetRanking(CacheRankingsBlock* rankings) { backend_->OnEvent(Stats::OPEN_RANKINGS); + // Note that if the cache is in read_only mode, open entries are not marked + // as dirty, so we can have multiple in-memory obects for the same address. + // However, by definition entries should not be mutating the state so the + // data at this point should be as good as the one from an entry tracked by + // the backend, and that other entry won't overwrite anything done by this + // one because it should not have the dirty flag set. if (!rankings->Data()->dirty) return true; |