| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 | 6 |
| 7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
| 8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
| 9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
| 10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 for (Resource* resource : resources) | 284 for (Resource* resource : resources) |
| 285 Remove(resource); | 285 Remove(resource); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void MemoryCache::TypeStatistic::AddResource(Resource* o) { | 288 void MemoryCache::TypeStatistic::AddResource(Resource* o) { |
| 289 count++; | 289 count++; |
| 290 size += o->size(); | 290 size += o->size(); |
| 291 decoded_size += o->DecodedSize(); | 291 decoded_size += o->DecodedSize(); |
| 292 encoded_size += o->EncodedSize(); | 292 encoded_size += o->EncodedSize(); |
| 293 overhead_size += o->OverheadSize(); | 293 overhead_size += o->OverheadSize(); |
| 294 encoded_size_duplicated_in_data_ur_ls += | 294 encoded_size_duplicated_in_data_urls += |
| 295 o->Url().ProtocolIsData() ? o->EncodedSize() : 0; | 295 o->Url().ProtocolIsData() ? o->EncodedSize() : 0; |
| 296 } | 296 } |
| 297 | 297 |
| 298 MemoryCache::Statistics MemoryCache::GetStatistics() const { | 298 MemoryCache::Statistics MemoryCache::GetStatistics() const { |
| 299 Statistics stats; | 299 Statistics stats; |
| 300 for (const auto& resource_map_iter : resource_maps_) { | 300 for (const auto& resource_map_iter : resource_maps_) { |
| 301 for (const auto& resource_iter : *resource_map_iter.value) { | 301 for (const auto& resource_iter : *resource_map_iter.value) { |
| 302 Resource* resource = resource_iter.value->GetResource(); | 302 Resource* resource = resource_iter.value->GetResource(); |
| 303 DCHECK(resource); | 303 DCHECK(resource); |
| 304 switch (resource->GetType()) { | 304 switch (resource->GetType()) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 return true; | 463 return true; |
| 464 } | 464 } |
| 465 | 465 |
| 466 void MemoryCache::OnMemoryPressure(WebMemoryPressureLevel level) { | 466 void MemoryCache::OnMemoryPressure(WebMemoryPressureLevel level) { |
| 467 PruneAll(); | 467 PruneAll(); |
| 468 } | 468 } |
| 469 | 469 |
| 470 } // namespace blink | 470 } // namespace blink |
| OLD | NEW |