Changeset 175299 in webkit
- Timestamp:
- Oct 28, 2014, 9:04:19 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Platform/IPC/ArgumentCoders.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r175288 r175299 1 2014-10-28 Ting-Wei Lan <lantw44@gmail.com> 2 3 Cast std::chrono::duration.count() to int64_t in ArgumentCoder 4 https://bugs.webkit.org/show_bug.cgi?id=136981 5 6 Reviewed by Alexey Proskuryakov. 7 8 Explicitly cast the return value of std::chrono::duration.count() to 9 a fixed-size interger type, which prevents compilation error when 10 the return value type matches neither int32_t nor int64_t. 11 12 * Platform/IPC/ArgumentCoders.h: 13 1 14 2014-10-28 Jer Noble <jer.noble@apple.com> 2 15 -
trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h
r173394 r175299 108 108 static void encode(ArgumentEncoder& encoder, const std::chrono::duration<Rep, Period>& duration) 109 109 { 110 encoder << duration.count(); 110 static_assert(std::is_integral<Rep>::value && std::is_signed<Rep>::value && sizeof(Rep) <= sizeof(int64_t), "Serialization of this Rep type is not supported yet. Only signed integer type which can be fit in an int64_t is currently supported."); 111 encoder << static_cast<int64_t>(duration.count()); 111 112 } 112 113 113 114 static bool decode(ArgumentDecoder& decoder, std::chrono::duration<Rep, Period>& result) 114 115 { 115 Repcount;116 int64_t count; 116 117 if (!decoder.decode(count)) 117 118 return false; 118 result = std::chrono::duration<Rep, Period>( count);119 result = std::chrono::duration<Rep, Period>(static_cast<Rep>(count)); 119 120 return true; 120 121 }
Note:
See TracChangeset
for help on using the changeset viewer.