| Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| index 9594d8f3eee3dc97ba5ee87e59d27d826b3434df..4ab0e279224f8c19c092a17ce18d34d4f601b47d 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| @@ -827,15 +827,13 @@ void HTMLCanvasElement::updateExternallyAllocatedMemory() const
|
| bufferCount++;
|
|
|
| // Four bytes per pixel per buffer.
|
| - Checked<intptr_t, RecordOverflow> checkedExternallyAllocatedMemory = 4 * bufferCount;
|
| + WTF::CheckedNumeric<intptr_t> checkedExternallyAllocatedMemory = 4 * bufferCount;
|
| if (is3D())
|
| checkedExternallyAllocatedMemory += m_context->externallyAllocatedBytesPerPixel();
|
|
|
| checkedExternallyAllocatedMemory *= width();
|
| checkedExternallyAllocatedMemory *= height();
|
| - intptr_t externallyAllocatedMemory;
|
| - if (checkedExternallyAllocatedMemory.safeGet(externallyAllocatedMemory) == CheckedState::DidOverflow)
|
| - externallyAllocatedMemory = std::numeric_limits<intptr_t>::max();
|
| + intptr_t externallyAllocatedMemory = checkedExternallyAllocatedMemory.ValueOrDefault(std::numeric_limits<intptr_t>::max());
|
|
|
| // Subtracting two intptr_t that are known to be positive will never underflow.
|
| v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyAllocatedMemory - m_externallyAllocatedMemory);
|
|
|