V8's shell (http://code.google.com/p/v8/source/brow ... s/shell.cc) does this to the results of it's evaluation:
- Code: Select all
v8::String::Utf8Value str(result);
v8::String::Utf8Value str(result);
try
{
// <script> is the inlined contents of the CefFrame->ExecuteJavaScript's jsCode argument.
__native_result_function(<script>);
}
catch(e)
{
__native_error_function(e);
}
class CefV8AsyncResult
{
void Success(CefRefPtr<CefV8Value> result, void* user_data) =0;
void Error(CefRefPtr<CefV8Value> exception, void* user_data) =0;
}
void CefFrame::ExecuteJavaScript(CefString script, CefString scriptName, int lineOffset, CefRefPtr<CefV8AsyncResult> resultHandler, void* user_data);
I'm not familiar with the internals of Chromium, perhaps this isn't possible, what do you think?
In my opinion the callback should get run when the evaluation of the code provided to the method call finishes, if the code has set up timers then these should still run but aren't of concern to the callback.
class CefV8ExecutionStateListener : public CefBase
{
virtual void ExecuteSuccess(CefRefPtr<CefV8Value> result) =0;
virtual void ExecuteError(const CefString& message, const CefString& source, int line) =0;
};
void CefFrame::ExecuteJavaScript(const CefString& jsCode, const CefString& scriptUrl,
int startLine, CefRefPtr<CefV8ExecutionStateListener> stateListener);
Return to Feature Request Forum
Users browsing this forum: No registered users and 53 guests