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

Unified Diff: Source/web/WebPluginContainerImpl.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/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 55e2802ecbbcb085f8b1adc129d7654ae5a40937..f310e0ec752bc4915331a0e3940a1cea5abd068d 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -463,7 +463,7 @@ v8::Local<v8::Object> WebPluginContainerImpl::v8ObjectForElement()
return v8::Local<v8::Object>();
v8::Handle<v8::Value> v8value = toV8(m_element.get(), scriptState->context()->Global(), scriptState->isolate());
- ASSERT(v8value->IsObject());
+ ASSERT(!v8value.IsEmpty() && v8value->IsObject());
haraken 2015/04/28 04:24:59 Who guarantees it is not empty? Also we can remov
bashi 2015/04/28 05:41:53 The existing ASSERT() implies this should not be e
haraken 2015/04/28 05:50:34 I think that is exactly what we're fixing with int
bashi 2015/04/28 06:41:14 Yeah, let's use !IsEmpty() assertion to see this a
Yuki 2015/04/28 06:43:46 The problem is, ASSERT will be noop in release bui
haraken 2015/04/28 06:46:08 If you argue that we can go with ASSERT here, that
bashi 2015/04/28 06:55:49 Ok, changed to return empty handle. That's said,
return v8::Handle<v8::Object>::Cast(v8value);
}
« Source/web/WebDevToolsFrontendImpl.cpp ('K') | « Source/web/WebDevToolsFrontendImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698