On 2014/06/02 16:41:49, adamk wrote:
https://codereview.chromium.org/306053003/diff/1/src/api.cc
File src/api.cc (right):

https://codereview.chromium.org/306053003/diff/1/src/api.cc#newcode6670
src/api.cc:6670: i::Handle<i::CallHandlerInfo> callback_info =
On 2014/06/02 07:22:10, dcarney wrote:
> if you're going to reuse the CallHandlerInfo struct, the second field must
be
a
> Handle<Value>.
> the embedder can use External::New if needed.  this requires no context

I'm guessing this might be the source of my try job failure...but could you
explain what's enforcing this requirement?

I looked at this harder and I don't see any place that this requirement is
codified. The verifier for CallHandlerInfo doesn't assume anything about the
type of |data|, it simply calls VerifyPointer() on it. Sure, the other places that use CallHandlerInfo assume it's OK to pass |data| back out to the embedder,
in which case it would of course need to be something representable as a
v8::Value, but given that I handle the unwrapping in isolate.cc I don't see
what's wrong with this approach.

Unless you're just arguing that I shouldn't be reusing CallHandlerInfo unless I
use it in exactly the same way as the other uses. As I said in my previous
message, I think I'd rather create a new struct and allow the API to remain
V8-type-free than force the embedder to wrap and unwrap the void* on the
outside.

Also, it seems a bit weird to me to make an External part of this API, given that otherwise it's C++-type-based, not V8-type-based. Would you be OK with
the
External::New call happening internally?

As for re-using CallHandlerInfo: I at first started to write a new Struct for this, but CallHandlerInfo seemed so close to what I needed that it seemed like
a
lot of useless code. If you think it's weird to re-use it here, I can easily
add
a new struct for this case.



https://codereview.chromium.org/306053003/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to