Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+more tweaks Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
index b76c2ebad454aa9c00856457170f0ae306f11360..4213b141ed7fe8b3e6211a0c02049bb3dd47851e 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.cpp
@@ -45,7 +45,10 @@ void BluetoothGATTCharacteristic::dispatchCharacteristicValueChanged(
{
static_assert(sizeof(*value.data()) == 1, "uint8_t should be a single byte");
- m_value = DOMArrayBuffer::create(value.data(), value.size());
+ // TODO(junov): crbug.com/536816
+ // Should use createOrNull. Requires figuring out a graceful way
+ // to handle allocation failures.
+ m_value = DOMArrayBuffer::deprecatedCreateOrCrash(value.data(), value.size());
dispatchEvent(Event::create(EventTypeNames::characteristicvaluechanged));
}

Powered by Google App Engine
This is Rietveld 408576698