#include <resource_cache_limit_calculator.h>
◆ ResourceCacheLimitCalculator()
flutter::ResourceCacheLimitCalculator::ResourceCacheLimitCalculator |
( |
size_t |
max_bytes_threshold | ) |
|
|
inlineexplicit |
◆ ~ResourceCacheLimitCalculator()
flutter::ResourceCacheLimitCalculator::~ResourceCacheLimitCalculator |
( |
| ) |
|
|
default |
◆ AddResourceCacheLimitItem()
◆ GetResourceCacheMaxBytes()
size_t flutter::ResourceCacheLimitCalculator::GetResourceCacheMaxBytes |
( |
| ) |
|
Definition at line 9 of file resource_cache_limit_calculator.cc.
9 {
10 size_t max_bytes = 0;
11 size_t max_bytes_threshold = max_bytes_threshold_ > 0
12 ? max_bytes_threshold_
14 std::vector<fml::WeakPtr<ResourceCacheLimitItem>> live_items;
15 for (const auto& item : items_) {
16 if (item) {
17 live_items.push_back(item);
18 max_bytes += item->GetResourceCacheLimit();
19 }
20 }
21 items_ = std::move(live_items);
22 return std::min(max_bytes, max_bytes_threshold);
23}
static float max(float r, float g, float b)
static float min(float r, float g, float b)
The documentation for this class was generated from the following files: