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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 to.size = static_cast<size_t>(from.size); | 46 to.size = static_cast<size_t>(from.size); |
47 to.liveSize = static_cast<size_t>(from.liveSize); | 47 to.liveSize = static_cast<size_t>(from.liveSize); |
48 to.decodedSize = static_cast<size_t>(from.decodedSize); | 48 to.decodedSize = static_cast<size_t>(from.decodedSize); |
49 } | 49 } |
50 | 50 |
51 void WebCache::setCapacities( | 51 void WebCache::setCapacities( |
52 size_t minDeadCapacity, size_t maxDeadCapacity, size_t capacity) | 52 size_t minDeadCapacity, size_t maxDeadCapacity, size_t capacity) |
53 { | 53 { |
54 MemoryCache* cache = WebCore::memoryCache(); | 54 MemoryCache* cache = WebCore::memoryCache(); |
55 if (cache) | 55 if (cache) |
56 cache->setCapacities(static_cast<unsigned int>(minDeadCapacity), | 56 cache->setCapacities(static_cast<unsigned>(minDeadCapacity), static_cast
<unsigned>(maxDeadCapacity), static_cast<unsigned>(capacity)); |
57 static_cast<unsigned int>(maxDeadCapacity), | |
58 static_cast<unsigned int>(capacity)); | |
59 } | 57 } |
60 | 58 |
61 void WebCache::clear() | 59 void WebCache::clear() |
62 { | 60 { |
63 MemoryCache* cache = WebCore::memoryCache(); | 61 MemoryCache* cache = WebCore::memoryCache(); |
64 if (cache) | 62 if (cache) |
65 cache->evictResources(); | 63 cache->evictResources(); |
66 } | 64 } |
67 | 65 |
68 void WebCache::getUsageStats(UsageStats* result) | 66 void WebCache::getUsageStats(UsageStats* result) |
(...skipping 19 matching lines...) Expand all Loading... |
88 ToResourceTypeStat(stats.images, result->images); | 86 ToResourceTypeStat(stats.images, result->images); |
89 ToResourceTypeStat(stats.cssStyleSheets, result->cssStyleSheets); | 87 ToResourceTypeStat(stats.cssStyleSheets, result->cssStyleSheets); |
90 ToResourceTypeStat(stats.scripts, result->scripts); | 88 ToResourceTypeStat(stats.scripts, result->scripts); |
91 ToResourceTypeStat(stats.xslStyleSheets, result->xslStyleSheets); | 89 ToResourceTypeStat(stats.xslStyleSheets, result->xslStyleSheets); |
92 ToResourceTypeStat(stats.fonts, result->fonts); | 90 ToResourceTypeStat(stats.fonts, result->fonts); |
93 } else | 91 } else |
94 memset(result, 0, sizeof(WebCache::ResourceTypeStats)); | 92 memset(result, 0, sizeof(WebCache::ResourceTypeStats)); |
95 } | 93 } |
96 | 94 |
97 } // namespace blink | 95 } // namespace blink |
OLD | NEW |