Skip to content

Commit

Permalink
Add v8 Function Converter ToV8 to gin
Browse files Browse the repository at this point in the history
This changes adds the ToV8 converter to gin for v8::Function
This is used by electron internally and could be helpful to other
embedders as well.

Change-Id: I19067d1f5cb119a58f1a8574dd9f232b72b328bf
Reviewed-on: https://chromium-review.googlesource.com/c/1461826
Auto-Submit: Nitish Sakhawalkar <nsakhawalkar@slack-corp.com>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630782}
  • Loading branch information
Nitish Sakhawalkar authored and Commit Bot committed Feb 11, 2019
1 parent e74b616 commit f7bbaa5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ Pengutronix e.K. <*@pengutronix.de>
Rakuten Kobo Inc. <*@kobo.com>
Rakuten Kobo Inc. <*@rakuten.com>
Seznam.cz, a.s. <*@firma.seznam.cz>
Slack Technologies Inc. <*@slack-corp.com>
Spotify AB <*@spotify.com>
Tableau Software <*@tableau.com>
TeamSpeak Systems GmbH <*@teamspeak.com>
Expand Down
5 changes: 5 additions & 0 deletions gin/converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ bool Converter<std::string>::FromV8(Isolate* isolate,
return true;
}

Local<Value> Converter<Local<Function>>::ToV8(Isolate* isolate,
Local<Function> val) {
return val.As<Value>();
}

bool Converter<Local<Function>>::FromV8(Isolate* isolate,
Local<Value> val,
Local<Function>* out) {
Expand Down
2 changes: 2 additions & 0 deletions gin/converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ struct GIN_EXPORT Converter<std::string> {

template<>
struct GIN_EXPORT Converter<v8::Local<v8::Function> > {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
v8::Local<v8::Function> val);
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
v8::Local<v8::Function>* out);
Expand Down

0 comments on commit f7bbaa5

Please sign in to comment.