Index: chrome/app/chrome_watcher_command_line_win.cc |
diff --git a/chrome/app/chrome_watcher_command_line_win.cc b/chrome/app/chrome_watcher_command_line_win.cc |
index 12b3e143629eb6beedcafb0913f5d818e67849dc..af7dc95fc8e98ba85a51f8ebf9725b3e82ea1eaa 100644 |
--- a/chrome/app/chrome_watcher_command_line_win.cc |
+++ b/chrome/app/chrome_watcher_command_line_win.cc |
@@ -23,8 +23,11 @@ const char kMainThreadIdSwitch[] = "main-thread-id"; |
void AppendHandleSwitch(const std::string& switch_name, |
HANDLE handle, |
base::CommandLine* command_line) { |
- command_line->AppendSwitchASCII( |
- switch_name, base::UintToString(reinterpret_cast<uint32_t>(handle))); |
+ // Cast through uintptr_t and then uint32_t to make the truncation |
+ // explicit. Handles are size-of-pointer but are always 32-bit values. |
+ command_line->AppendSwitchASCII(switch_name, |
+ base::UintToString(static_cast<uint32_t>( |
+ reinterpret_cast<uintptr_t>(handle)))); |
} |
uint32_t ReadUintSwitch(const base::CommandLine& command_line, |