Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: components/web_cache/browser/web_cache_manager.cc

Issue 1619363002: Add compile time checks against longs being used in IPC structs on 32 bit Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more per Dmitry Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/web_cache/browser/web_cache_manager.cc
diff --git a/components/web_cache/browser/web_cache_manager.cc b/components/web_cache/browser/web_cache_manager.cc
index 7d43b4595e786666ccbfc53ce254194666789ac1..daecfe50d4325863725e4ee690a186684ced7fe6 100644
--- a/components/web_cache/browser/web_cache_manager.cc
+++ b/components/web_cache/browser/web_cache_manager.cc
@@ -307,19 +307,18 @@ void WebCacheManager::EnactStrategy(const AllocationStrategy& strategy) {
content::RenderProcessHost::FromID(allocation->first);
if (host) {
// This is the capacity this renderer has been allocated.
- size_t capacity = allocation->second;
+ uint32_t capacity = allocation->second;
// We don't reserve any space for dead objects in the cache. Instead, we
// prefer to keep live objects around. There is probably some performance
// tuning to be done here.
- size_t min_dead_capacity = 0;
+ uint32_t min_dead_capacity = 0;
// We allow the dead objects to consume up to half of the cache capacity.
- size_t max_dead_capacity = capacity / 2;
- if (base::SysInfo::IsLowEndDevice()) {
- max_dead_capacity = std::min(static_cast<size_t>(512 * 1024),
- max_dead_capacity);
- }
+ uint32_t max_dead_capacity = capacity / 2;
+ if (base::SysInfo::IsLowEndDevice())
+ max_dead_capacity = std::min(512 * 1024u, max_dead_capacity);
+
host->Send(new WebCacheMsg_SetCacheCapacities(min_dead_capacity,
max_dead_capacity,
capacity));

Powered by Google App Engine
This is Rietveld 408576698