On 2015/03/03 13:18:29, vogelheim wrote:
https://codereview.chromium.org/962963007/diff/1/src/api.cc
File src/api.cc (right):
https://codereview.chromium.org/962963007/diff/1/src/api.cc#newcode378
src/api.cc:378: result = CreateSnapshotWithinIsolate(isolate,
custom_source);
I'm confused by this. Admittedly I don't understand how the locker is
supposed
to work and I'm mostly pattern-matching the code review, so quite
possibly the
confusion is on my part...
I take it the Locker is meant to be used be the embedder. For all I can
see,
this is the only case in the API where the API instantiates a Locker
itself.
Also, I can't find the pattern of Locker-ing things if Locker::IsActive
elsewhere. Why is this the right thing to do here? Is is because we also
create
our own Isolate here?
Right. The Locker is meant to be used by the embedder. If a Locker is used
for
an isolate, it needs to be used for all Isolates. You don't find any example
elsewhere because CreateSnapshotDataBlob is the only place where we do the
whole
package of creating a new Isolate, enter it, and execute code on it. If the
embedder uses a Locker, we need to match it here as well. Conversely, if we
always use a Locker here, we would force the embedder to always use a
Locker as
well. So the best thing to do here is to use a Locker if necessary, and
don't if
not.
https://codereview.chromium.org/962963007/
--
--
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.