diff options
author | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 20:13:28 +0000 |
---|---|---|
committer | simonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 20:13:28 +0000 |
commit | 704359693f5c8507635155ae117c466a7149065a (patch) | |
tree | 55778bdae67f960440441085372fc98c1f974c80 /net/disk_cache/in_flight_backend_io.cc | |
parent | 89b2312b5aca51da726b93e966842ffd5f642402 (diff) | |
download | chromium_src-704359693f5c8507635155ae117c466a7149065a.zip chromium_src-704359693f5c8507635155ae117c466a7149065a.tar.gz chromium_src-704359693f5c8507635155ae117c466a7149065a.tar.bz2 |
Inform disk cache of WebKit memory cache hits.
BUG=37112
TEST=net_unittests
Review URL: http://codereview.chromium.org/7461106
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/in_flight_backend_io.cc')
-rw-r--r-- | net/disk_cache/in_flight_backend_io.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/disk_cache/in_flight_backend_io.cc b/net/disk_cache/in_flight_backend_io.cc index 5d4be18..259d888 100644 --- a/net/disk_cache/in_flight_backend_io.cc +++ b/net/disk_cache/in_flight_backend_io.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -105,6 +105,11 @@ void BackendIO::EndEnumeration(void* iterator) { iter_ = iterator; } +void BackendIO::OnExternalCacheHit(const std::string& key) { + operation_ = OP_ON_EXTERNAL_CACHE_HIT; + key_ = key; +} + void BackendIO::CloseEntryImpl(EntryImpl* entry) { operation_ = OP_CLOSE_ENTRY; entry_ = entry; @@ -218,6 +223,10 @@ void BackendIO::ExecuteBackendOperation() { backend_->SyncEndEnumeration(iter_); result_ = net::OK; break; + case OP_ON_EXTERNAL_CACHE_HIT: + backend_->SyncOnExternalCacheHit(key_); + result_ = net::OK; + break; case OP_CLOSE_ENTRY: entry_->Release(); result_ = net::OK; @@ -358,6 +367,12 @@ void InFlightBackendIO::EndEnumeration(void* iterator) { PostOperation(operation); } +void InFlightBackendIO::OnExternalCacheHit(const std::string& key) { + scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, NULL)); + operation->OnExternalCacheHit(key); + PostOperation(operation); +} + void InFlightBackendIO::CloseEntryImpl(EntryImpl* entry) { scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, NULL)); operation->CloseEntryImpl(entry); |