Index: content/common/pepper_file_util.cc |
diff --git a/content/common/pepper_file_util.cc b/content/common/pepper_file_util.cc |
index 6264faa5374422e65609de14913359318e0b66fa..e9e806d48da00e3e2266b954efbc435789301368 100644 |
--- a/content/common/pepper_file_util.cc |
+++ b/content/common/pepper_file_util.cc |
@@ -23,7 +23,9 @@ storage::FileSystemType PepperFileSystemTypeToFileSystemType( |
int IntegerFromSyncSocketHandle( |
const base::SyncSocket::Handle& socket_handle) { |
#if defined(OS_WIN) |
- return reinterpret_cast<int>(socket_handle); |
+ // Cast through intptr_t and then int to make the truncation explicit. |
+ // Handles are size-of-pointer but are always 32-bit values. |
+ return static_cast<int>(reinterpret_cast<intptr_t>(socket_handle)); |
Will Harris
2015/11/10 18:05:14
Can HANDLE values go above INT_MAX (signed int vs
brucedawson
2015/11/10 18:43:26
INVALID_HANDLE_VALUE (0xFFFFFFFF) is probably the
Will Harris
2015/11/10 19:45:45
seems it's hard to change pepper api to have this
brucedawson
2015/11/10 19:54:33
Good find. I'll use this in this context, and my o
|
#elif defined(OS_POSIX) |
return socket_handle; |
#else |