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

Unified Diff: chrome/common/render_messages.cc

Issue 1687543003: Fix crash from r374241 when renderers are using more than 2GB of cache memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/render_messages.cc
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index efdfcc5602fab6c2ee3f68b1355c9399989d2f00..7e30f25c4bfa082b8a330c56a22429879d7c6b5f 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -30,31 +30,31 @@ void ParamTraits<ContentSettingsPattern>::Log(
void ParamTraits<blink::WebCache::UsageStats>::Write(
base::Pickle* m, const blink::WebCache::UsageStats& u) {
- m->WriteUInt32(base::checked_cast<int>(u.minDeadCapacity));
- m->WriteUInt32(base::checked_cast<int>(u.maxDeadCapacity));
- m->WriteUInt32(base::checked_cast<int>(u.capacity));
- m->WriteUInt32(base::checked_cast<int>(u.liveSize));
- m->WriteUInt32(base::checked_cast<int>(u.deadSize));
+ m->WriteUInt64(static_cast<uint64_t>(u.minDeadCapacity));
+ m->WriteUInt64(static_cast<uint64_t>(u.maxDeadCapacity));
+ m->WriteUInt64(static_cast<uint64_t>(u.capacity));
+ m->WriteUInt64(static_cast<uint64_t>(u.liveSize));
+ m->WriteUInt64(static_cast<uint64_t>(u.deadSize));
}
bool ParamTraits<blink::WebCache::UsageStats>::Read(
const base::Pickle* m,
base::PickleIterator* iter,
blink::WebCache::UsageStats* u) {
- uint32_t min_capacity, max_capacity, capacity, live_size, dead_size;
- if (!iter->ReadUInt32(&min_capacity) ||
- !iter->ReadUInt32(&max_capacity) ||
- !iter->ReadUInt32(&capacity) ||
- !iter->ReadUInt32(&live_size) ||
- !iter->ReadUInt32(&dead_size)) {
+ uint64_t min_capacity, max_capacity, capacity, live_size, dead_size;
Tom Sepez 2016/02/10 00:27:29 nit: one per line.
+ if (!iter->ReadUInt64(&min_capacity) ||
+ !iter->ReadUInt64(&max_capacity) ||
+ !iter->ReadUInt64(&capacity) ||
+ !iter->ReadUInt64(&live_size) ||
+ !iter->ReadUInt64(&dead_size)) {
return false;
}
- u->minDeadCapacity = min_capacity;
- u->maxDeadCapacity = max_capacity;
- u->capacity = capacity;
- u->liveSize = live_size;
- u->deadSize = dead_size;
+ u->minDeadCapacity = base::checked_cast<size_t>(min_capacity);
+ u->maxDeadCapacity = base::checked_cast<size_t>(max_capacity);
+ u->capacity = base::checked_cast<size_t>(capacity);
+ u->liveSize = base::checked_cast<size_t>(live_size);
+ u->deadSize = base::checked_cast<size_t>(dead_size);
jam 2016/02/09 23:00:17 this should be safe since right now don't have 32
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698