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

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

Issue 1118653002: Componentization: add toV8(void*,...) to check function overload mismatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added comment 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 | « no previous file | Source/modules/background_sync/SyncError.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ToV8.h
diff --git a/Source/bindings/core/v8/ToV8.h b/Source/bindings/core/v8/ToV8.h
index c5f193f827d0dd85f43ebd069bba439c2f79c9e6..9a73daea48340d28a8da151a5368562549c78c9a 100644
--- a/Source/bindings/core/v8/ToV8.h
+++ b/Source/bindings/core/v8/ToV8.h
@@ -237,6 +237,16 @@ inline v8::Local<v8::Value> toV8(const Vector<std::pair<String, T>>& value, v8::
return object;
}
+// Only declare toV8(void*,...) for checking function overload mismatch.
+// This toV8(void*,...) should be never used. So we will find mismatch
+// because of "unresolved external symbol".
+// Without toV8(void*, ...), call to toV8 with T* will match with
+// toV8(bool, ...) if T is not a subclass of ScriptWrappable or if T is
+// declared but not defined (so it's not clear that T is a subclass of
+// ScriptWrappable).
+// This hack helps detect such unwanted implicit conversions from T* to bool.
+v8::Handle<v8::Value> toV8(void* value, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+
} // namespace blink
#endif // ToV8_h
« no previous file with comments | « no previous file | Source/modules/background_sync/SyncError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698