| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "webkit/appcache/appcache_storage.h" |
| 6 |
| 7 #include "base/stl_util-inl.h" |
| 8 |
| 9 namespace appcache { |
| 10 |
| 11 AppCacheStorage::AppCacheStorage(AppCacheService* service) |
| 12 : last_cache_id_(kUnitializedId), last_group_id_(kUnitializedId), |
| 13 last_entry_id_(kUnitializedId), last_response_id_(kUnitializedId), |
| 14 service_(service) { |
| 15 } |
| 16 |
| 17 AppCacheStorage::~AppCacheStorage() { |
| 18 STLDeleteValues(&pending_info_loads_); |
| 19 DCHECK(delegate_references_.empty()); |
| 20 } |
| 21 |
| 22 void AppCacheStorage::LoadResponseInfo( |
| 23 const GURL& manifest_url, int64 id, Delegate* delegate) { |
| 24 AppCacheResponseInfo* info = working_set_.GetResponseInfo(id); |
| 25 if (info) { |
| 26 delegate->OnResponseInfoLoaded(info, id); |
| 27 return; |
| 28 } |
| 29 ResponseInfoLoadTask* info_load = |
| 30 GetOrCreateResponseInfoLoadTask(manifest_url, id); |
| 31 DCHECK(manifest_url == info_load->manifest_url()); |
| 32 DCHECK(id == info_load->response_id()); |
| 33 info_load->AddDelegate(GetOrCreateDelegateReference(delegate)); |
| 34 info_load->StartIfNeeded(); |
| 35 } |
| 36 |
| 37 } // namespace appcache |
| 38 |
| OLD | NEW |