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

Unified Diff: Source/core/dom/DOMDataView.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months 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
« no previous file with comments | « Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp ('k') | Source/core/dom/DOMTypedArray.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMDataView.cpp
diff --git a/Source/core/dom/DOMDataView.cpp b/Source/core/dom/DOMDataView.cpp
index 60d96f4cae5c5645d9190b36a6887aa03db9bd55..d19e2998157ca6db7811d6cf0db73e57618cd3a1 100644
--- a/Source/core/dom/DOMDataView.cpp
+++ b/Source/core/dom/DOMDataView.cpp
@@ -29,6 +29,8 @@ v8::Handle<v8::Object> DOMDataView::wrap(v8::Handle<v8::Object> creationContext,
const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo();
v8::Local<v8::Value> v8Buffer = toV8(buffer(), creationContext, isolate);
+ if (v8Buffer.IsEmpty())
+ return v8::Handle<v8::Object>();
yurys 2015/04/28 07:05:25 AFAIU this is where v8::MaybeLocal should be used
bashi 2015/04/28 07:09:45 We use MaybeLocal if we can guarantee that the fun
ASSERT(v8Buffer->IsArrayBuffer());
v8::Handle<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffer>(), byteOffset(), byteLength());
« no previous file with comments | « Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp ('k') | Source/core/dom/DOMTypedArray.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698