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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ToV8.h

Issue 2267423003: Add DCHECKs to check that toV8 never returns an empty handle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ToV8.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.h b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
index d00421e6c939f4f18852ede307d925d313e7e423..0b35902f74b0966d9beceadbb7b9854ed413f81d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
@@ -37,7 +37,9 @@ inline v8::Local<v8::Value> toV8(ScriptWrappable* impl, v8::Local<v8::Object> cr
if (!wrapper.IsEmpty())
return wrapper;
- return impl->wrap(isolate, creationContext);
+ wrapper = impl->wrap(isolate, creationContext);
+ DCHECK(!wrapper.IsEmpty());
+ return wrapper;
}
inline v8::Local<v8::Value> toV8(Node* impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
@@ -48,7 +50,9 @@ inline v8::Local<v8::Value> toV8(Node* impl, v8::Local<v8::Object> creationConte
if (!wrapper.IsEmpty())
return wrapper;
- return ScriptWrappable::fromNode(impl)->wrap(isolate, creationContext);
+ wrapper = ScriptWrappable::fromNode(impl)->wrap(isolate, creationContext);
+ DCHECK(!wrapper.IsEmpty());
+ return wrapper;
}
// Special versions for DOMWindow, WorkerOrWorkletGlobalScope and EventTarget
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698