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

Unified Diff: chrome/browser/task_manager/task_manager.cc

Issue 1684793003: Add comments for struct members that were changed from size_t to uin32_t or uint64_t for IPC safety. (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 | « chrome/browser/task_management/sampling/task_group.cc ('k') | chrome/common/spellcheck_marker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager/task_manager.cc
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index 0ae5fb3e1b5563872489ef4b4adfb742fcccd60f..7d87aa71270fac6c7590c5d727dff01ddbcbabcf 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -8,6 +8,7 @@
#include "base/i18n/number_formatting.h"
#include "base/i18n/rtl.h"
#include "base/location.h"
+#include "base/numerics/safe_conversions.h"
#include "base/process/process_metrics.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
@@ -666,7 +667,9 @@ bool TaskManagerModel::GetVideoMemory(int index,
if (i == video_memory_usage_stats_.process_map.end())
return false;
values.is_video_memory_valid = true;
- values.video_memory = i->second.video_memory;
+ // If this checked_cast asserts, then need to change this code to use
+ // uint64_t instead of size_t.
+ values.video_memory = base::checked_cast<size_t>(i->second.video_memory);
values.video_memory_has_duplicates = i->second.has_duplicates;
}
*video_memory = values.video_memory;
« no previous file with comments | « chrome/browser/task_management/sampling/task_group.cc ('k') | chrome/common/spellcheck_marker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698