diff options
| author | jam <jam@chromium.org> | 2016-02-10 15:45:40 -0800 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 23:47:16 +0000 |
| commit | ffaec53850a27fc0888998c98c7bb092ccbd8552 (patch) | |
| tree | 665d5d9564497e52b6343f33eb9e6ef2636203d0 /chrome/browser/task_manager | |
| parent | ac440714860679857517ac7dd4c6282acbfa4033 (diff) | |
| download | chromium_src-ffaec53850a27fc0888998c98c7bb092ccbd8552.zip chromium_src-ffaec53850a27fc0888998c98c7bb092ccbd8552.tar.gz chromium_src-ffaec53850a27fc0888998c98c7bb092ccbd8552.tar.bz2 | |
Add comments for struct members that were changed from size_t to uin32_t or uint64_t for IPC safety.
Also add a few checked_cast for places where we converted from size_t and we're sure that it's safe.
BUG=581409
Review URL: https://codereview.chromium.org/1684793003
Cr-Commit-Position: refs/heads/master@{#374788}
Diffstat (limited to 'chrome/browser/task_manager')
| -rw-r--r-- | chrome/browser/task_manager/task_manager.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index 0ae5fb3..7d87aa7 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; |
