ba...@chromium.org
unread,Mar 31, 2015, 1:46:08 AM3/31/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to joc...@chromium.org, aan...@chromium.org, dca...@chromium.org, har...@chromium.org, yukis...@chromium.org, yu...@chromium.org, aandre...@chromium.org, apavlo...@chromium.org, arv+...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, caseq...@chromium.org, devtools...@chromium.org, eustas...@chromium.org, kozyatins...@chromium.org, loislo...@chromium.org, lushnik...@chromium.org, malch...@chromium.org, pfeldma...@chromium.org, sergey...@chromium.org, vive...@samsung.com, viv...@chromium.org, yurys...@chromium.org
Updated. PTAL?
In summary,
- I want to make V8ScriptRunner::callInternalFunction() return MaybeLocal
because we use V8ScriptRunner in workers.
- Minimized changes in inspector code given that we are still discussing
how we
should use v8 APIs in inspector.
https://codereview.chromium.org/1036803002/diff/1/Source/core/inspector/JavaScriptCallFrame.cpp
File Source/core/inspector/JavaScriptCallFrame.cpp (right):
https://codereview.chromium.org/1036803002/diff/1/Source/core/inspector/JavaScriptCallFrame.cpp#newcode84
Source/core/inspector/JavaScriptCallFrame.cpp:84: v8::Local<v8::Value>
result = V8ScriptRunner::callInternalFunction(func, callFrame, 0, 0,
m_isolate).ToLocalChecked();
On 2015/03/27 12:07:24, yurys wrote:
> On 2015/03/27 00:39:50, bashi1 wrote:
> > On 2015/03/25 12:05:22, haraken wrote:
> > >
> > > Ditto. I guess this callInternalFunction can return an empty
handle.
> >
> > Yes. If we have better option than crash (e.g. return an empty
string), it
> would
> > be great. yurys@, WDYT?
> @aanrey would know better if his place is allowed to throw when called
e.g. from
> JavaScriptCallFrame::stepInPositions
Changed to return String() since this function seems to have the same
semantics of callV8FunctionReturnInt, which returns 0 on failure.
https://codereview.chromium.org/1036803002/diff/1/Source/core/inspector/JavaScriptCallFrame.cpp#newcode209
Source/core/inspector/JavaScriptCallFrame.cpp:209: return
ScriptValue(scriptState,
V8ScriptRunner::callInternalFunction(setVariableValueFunction,
callFrame, WTF_ARRAY_LENGTH(argv), argv, m_isolate).ToLocalChecked());
On 2015/03/27 12:07:24, yurys wrote:
> In this case we may well fail to change local variable and the
exception should
> be propagated to the calling code (see
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/inspector/InjectedScriptSource.js&q=%5C.setVariableValue%5C(%20f:webkit&sq=package:chromium&type=cs&l=1008).
> So empty handle is valid here.
> FYI: Using ScriptValue in this class (as well as in many other places
in
> inspector code) just hampers reading this code. When it was introduced
we had to
> work both with V8 and JSC and it made perfect sense then. In Blink we
use single
> VM and there are no plans for adding another so using Handles directly
would be
> preferable. I'll try to update this code as it will be necessary for
extracting
> it anyways.
Thanks. Replaced with ToLocal(). In blink, we decided to propagate
MaybeLocal when a method returns a result of v8 Maybe API directly (so
V8ScriptRunner::callInternalFunction returns Maybe). It would make sense
to have this method return MaybeLocal as well, but I didn't do that as
inspector code would have a different policy.
https://codereview.chromium.org/1036803002/