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

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
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>();
haraken 2015/04/28 04:24:59 Remove.
Yuki 2015/04/28 04:47:57 I think it's good to check that v8Buffer is not v8
ASSERT(v8Buffer->IsArrayBuffer());
v8::Handle<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffer>(), byteOffset(), byteLength());

Powered by Google App Engine
This is Rietveld 408576698