Chromium Code Reviews| Index: third_party/WebKit/Source/platform/LayoutUnit.h |
| diff --git a/third_party/WebKit/Source/platform/LayoutUnit.h b/third_party/WebKit/Source/platform/LayoutUnit.h |
| index 700aef96bd08df3423fe5895456321b7f03893b8..c61c1d297b64c6c29bb7c1477b504b9237d65737 100644 |
| --- a/third_party/WebKit/Source/platform/LayoutUnit.h |
| +++ b/third_party/WebKit/Source/platform/LayoutUnit.h |
| @@ -107,8 +107,10 @@ public: |
| } |
| unsigned toUnsigned() const { REPORT_OVERFLOW(m_value >= 0); return toInt(); } |
| - operator int() const { return toInt(); } |
| - operator unsigned() const { return toUnsigned(); } |
| + // Conversion to int or unsigned is lossy. Use toInt() and toUnsigned() instead. |
| + operator int() const = delete; |
| + operator unsigned() const = delete; |
|
Stephen Chennney
2016/08/22 17:46:10
Am I right that these need to be deleted because o
Xianzhu
2016/08/22 18:14:38
Even worse. To avoid implicit lossy conversion, we
|
| + |
| operator double() const { return toDouble(); } |
| operator float() const { return toFloat(); } |
| operator bool() const { return m_value; } |