OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // A helper method for coverting a MemoryCache::TypeStatistic to a | 37 // A helper method for coverting a MemoryCache::TypeStatistic to a |
38 // WebCache::ResourceTypeStat. | 38 // WebCache::ResourceTypeStat. |
39 static void ToResourceTypeStat(const MemoryCache::TypeStatistic& from, | 39 static void ToResourceTypeStat(const MemoryCache::TypeStatistic& from, |
40 WebCache::ResourceTypeStat& to) | 40 WebCache::ResourceTypeStat& to) |
41 { | 41 { |
42 to.count = from.count; | 42 to.count = from.count; |
43 to.size = from.size; | 43 to.size = from.size; |
44 to.liveSize = from.liveSize; | 44 to.liveSize = from.liveSize; |
45 to.decodedSize = from.decodedSize; | 45 to.decodedSize = from.decodedSize; |
46 to.purgeableSize = from.purgeableSize; | |
47 to.purgedSize = from.purgedSize; | |
48 } | 46 } |
49 | 47 |
50 void WebCache::setCapacities( | 48 void WebCache::setCapacities( |
51 size_t minDeadCapacity, size_t maxDeadCapacity, size_t capacity) | 49 size_t minDeadCapacity, size_t maxDeadCapacity, size_t capacity) |
52 { | 50 { |
53 MemoryCache* cache = memoryCache(); | 51 MemoryCache* cache = memoryCache(); |
54 if (cache) | 52 if (cache) |
55 cache->setCapacities(static_cast<unsigned>(minDeadCapacity), static_cast
<unsigned>(maxDeadCapacity), static_cast<unsigned>(capacity)); | 53 cache->setCapacities(static_cast<unsigned>(minDeadCapacity), static_cast
<unsigned>(maxDeadCapacity), static_cast<unsigned>(capacity)); |
56 } | 54 } |
57 | 55 |
(...skipping 28 matching lines...) Expand all Loading... |
86 ToResourceTypeStat(stats.cssStyleSheets, result->cssStyleSheets); | 84 ToResourceTypeStat(stats.cssStyleSheets, result->cssStyleSheets); |
87 ToResourceTypeStat(stats.scripts, result->scripts); | 85 ToResourceTypeStat(stats.scripts, result->scripts); |
88 ToResourceTypeStat(stats.xslStyleSheets, result->xslStyleSheets); | 86 ToResourceTypeStat(stats.xslStyleSheets, result->xslStyleSheets); |
89 ToResourceTypeStat(stats.fonts, result->fonts); | 87 ToResourceTypeStat(stats.fonts, result->fonts); |
90 ToResourceTypeStat(stats.other, result->other); | 88 ToResourceTypeStat(stats.other, result->other); |
91 } else | 89 } else |
92 memset(result, 0, sizeof(WebCache::ResourceTypeStats)); | 90 memset(result, 0, sizeof(WebCache::ResourceTypeStats)); |
93 } | 91 } |
94 | 92 |
95 } // namespace blink | 93 } // namespace blink |
OLD | NEW |