Title: [175920] releases/WebKitGTK/webkit-2.6/Source/WebKit2
- Revision
- 175920
- Author
- [email protected]
- Date
- 2014-11-11 07:10:50 -0800 (Tue, 11 Nov 2014)
Log Message
Merge r175299 - Cast std::chrono::duration.count() to int64_t in ArgumentCoder
https://bugs.webkit.org/show_bug.cgi?id=136981
Patch by Ting-Wei Lan <[email protected]> on 2014-10-28
Reviewed by Alexey Proskuryakov.
Explicitly cast the return value of std::chrono::duration.count() to
a fixed-size interger type, which prevents compilation error when
the return value type matches neither int32_t nor int64_t.
* Platform/IPC/ArgumentCoders.h:
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog (175919 => 175920)
--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog 2014-11-11 15:06:55 UTC (rev 175919)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog 2014-11-11 15:10:50 UTC (rev 175920)
@@ -1,3 +1,16 @@
+2014-10-28 Ting-Wei Lan <[email protected]>
+
+ Cast std::chrono::duration.count() to int64_t in ArgumentCoder
+ https://bugs.webkit.org/show_bug.cgi?id=136981
+
+ Reviewed by Alexey Proskuryakov.
+
+ Explicitly cast the return value of std::chrono::duration.count() to
+ a fixed-size interger type, which prevents compilation error when
+ the return value type matches neither int32_t nor int64_t.
+
+ * Platform/IPC/ArgumentCoders.h:
+
2014-10-27 Chris Dumez <[email protected]>
Use separate HashMaps for common and uncommon headers in HTTPHeaderMap
Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/Platform/IPC/ArgumentCoders.h (175919 => 175920)
--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/Platform/IPC/ArgumentCoders.h 2014-11-11 15:06:55 UTC (rev 175919)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/Platform/IPC/ArgumentCoders.h 2014-11-11 15:10:50 UTC (rev 175920)
@@ -107,15 +107,16 @@
template<typename Rep, typename Period> struct ArgumentCoder<std::chrono::duration<Rep, Period>> {
static void encode(ArgumentEncoder& encoder, const std::chrono::duration<Rep, Period>& duration)
{
- encoder << duration.count();
+ 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.");
+ encoder << static_cast<int64_t>(duration.count());
}
static bool decode(ArgumentDecoder& decoder, std::chrono::duration<Rep, Period>& result)
{
- Rep count;
+ int64_t count;
if (!decoder.decode(count))
return false;
- result = std::chrono::duration<Rep, Period>(count);
+ result = std::chrono::duration<Rep, Period>(static_cast<Rep>(count));
return true;
}
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes