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

Unified Diff: third_party/WebKit/Source/modules/push_messaging/PushSubscription.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/push_messaging/PushSubscription.cpp
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp b/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp
index a114ff4862fc9f61b9b89f69a592fa6e2c26a797..03d55dab499160e4453cb97be64855b2c2ecff29 100644
--- a/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp
+++ b/third_party/WebKit/Source/modules/push_messaging/PushSubscription.cpp
@@ -21,6 +21,7 @@ PushSubscription* PushSubscription::take(ScriptPromiseResolver*, PassOwnPtr<WebP
{
if (!pushSubscription)
return nullptr;
+
return new PushSubscription(*pushSubscription, serviceWorkerRegistration);
}
@@ -32,7 +33,7 @@ void PushSubscription::dispose(WebPushSubscription* pushSubscription)
PushSubscription::PushSubscription(const WebPushSubscription& subscription, ServiceWorkerRegistration* serviceWorkerRegistration)
: m_endpoint(subscription.endpoint)
- , m_p256dh(DOMArrayBuffer::create(subscription.p256dh.data(), subscription.p256dh.size()))
+ , m_p256dh(DOMArrayBuffer::deprecatedCreateOrCrash(subscription.p256dh.data(), subscription.p256dh.size()))
, m_serviceWorkerRegistration(serviceWorkerRegistration)
{
}

Powered by Google App Engine
This is Rietveld 408576698