| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/appcache/appcache_storage.h" | 5 #include "webkit/appcache/appcache_storage.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
| 8 #include "webkit/appcache/appcache_response.h" | 8 #include "webkit/appcache/appcache_response.h" |
| 9 | 9 |
| 10 namespace appcache { | 10 namespace appcache { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return; | 65 return; |
| 66 } | 66 } |
| 67 ResponseInfoLoadTask* info_load = | 67 ResponseInfoLoadTask* info_load = |
| 68 GetOrCreateResponseInfoLoadTask(manifest_url, id); | 68 GetOrCreateResponseInfoLoadTask(manifest_url, id); |
| 69 DCHECK(manifest_url == info_load->manifest_url()); | 69 DCHECK(manifest_url == info_load->manifest_url()); |
| 70 DCHECK(id == info_load->response_id()); | 70 DCHECK(id == info_load->response_id()); |
| 71 info_load->AddDelegate(GetOrCreateDelegateReference(delegate)); | 71 info_load->AddDelegate(GetOrCreateDelegateReference(delegate)); |
| 72 info_load->StartIfNeeded(); | 72 info_load->StartIfNeeded(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void AppCacheStorage::SetOriginQuotaInMemory(const GURL& origin, int64 quota) { |
| 76 DCHECK(quota >= 0); |
| 77 DCHECK(origin == origin.GetOrigin()); |
| 78 in_memory_quotas_[origin] = quota; |
| 79 } |
| 80 |
| 81 void AppCacheStorage::ResetOriginQuotaInMemory(const GURL& origin) { |
| 82 DCHECK(origin == origin.GetOrigin()); |
| 83 in_memory_quotas_.erase(origin); |
| 84 } |
| 85 |
| 86 int64 AppCacheStorage::GetOriginQuotaInMemory(const GURL& origin) { |
| 87 DCHECK(origin == origin.GetOrigin()); |
| 88 QuotaMap::const_iterator found = in_memory_quotas_.find(origin); |
| 89 if (found == in_memory_quotas_.end()) |
| 90 return -1; |
| 91 return found->second; |
| 92 } |
| 93 |
| 75 } // namespace appcache | 94 } // namespace appcache |
| 76 | 95 |
| OLD | NEW |