Add a listener for ExecuteJavaScript success or error.

Issue #151 wontfix
Marshall Greenblatt created an issue

Original [issue 151](https://code.google.com/p/chromiumembedded/issues/detail?id=151) created by magreenblatt on 2010-12-07T14:24:01.000Z:

Add a listener argument to CefFrame::ExecuteJavaScript that will receive asynchronous notification of JS execution success or error. Also potentially allow cancellation of JS execution via the listener. See the below thread for more details.

http://magpcss.org/ceforum/viewtopic.php?f=7&t=180

Comments (23)

  1. Former user Account Deleted

    Comment [1.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c1) originally posted by tom.rathbone on 2010-12-22T15:03:08.000Z:

    This patch adds an interface CefV8Task which encapsulates a script to run, its name and line number along with success and failure handling methods. A method called ExecuteJavaScriptTask has been added to CefFrame.

    Unfortunately retrieving exceptions would require a change to WebCore so the error method takes no arguments however it is still useful for signalling errors.

  2. Marshall Greenblatt reporter

    Comment [2.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c2) originally posted by magreenblatt on 2010-12-22T15:30:07.000Z:

    Thank you for developing a patch for this functionality, overall it looks good.

    Can you comment on the advantages of returning script, name and start line via CefV8Task methods instead of passing those arguments separately to ExecuteJavaScriptTask?

    Also, what is the return value from WebFrame::executeScriptAndReturnValue if the JavaScript method returns no value? (ie, "function foo() { } foo();")

    A few style-related nits:

    1. Your comment for the HandleError() method in cef.h doesn't look correct. 2. There are unnecessary changes in CefBrowserImpl::GetURL. 3. The line wrapping is incorrect in CefBrowserImpl::UIT\_ExecuteJavaScriptTask.

  3. Former user Account Deleted

    Comment [3.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c3) originally posted by tom.rathbone on 2010-12-22T16:32:39.000Z:

    Combining script info into task..

    Advantages: Only one parameter to pass to execute method, information available to the handler methods, users had to create a task object already for the handler methods. Disadvantages: As a minimum must add 3 fields and 3 getters to user's task/handler object.

    I felt the advantages outweighed the disadvantages but I admit the case is very slight.

    You posed a good question regarding the return value for void methods. At present this returns an empty handle too. \*Sigh\*, I really should have tested that. Let me see if there's anything that can be done about that, if not then we might have to lose the error channel completely.

  4. Former user Account Deleted

    Comment [5.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c5) originally posted by tom.rathbone on 2010-12-23T11:36:22.000Z:

    Attached a second patch. Style points corrected and undefined return values returned correctly.

    This includes a small patch to Webkit. Whilst patching from CEF like this is undesirable this is a v minor one-liner so hopefully I can get it in the mainline in a reasonable timeframe.

    Thoughts?

  5. Former user Account Deleted

    Comment [16.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c16) originally posted by anthony.taranto on 2011-04-22T23:57:28.000Z:

    This patch doesn't apply cleanly anymore, I get the following errors and I'm not immediately sure how to fix it.

    3>------ Build started: Project: libcef\_static, Configuration: Debug Win32 ------ 3>Compiling... 3>web\_drop\_target\_win.cc 3>http\_header\_utils.cc 3>webview\_host\_win.cc 3>stream\_impl.cc 3>cef\_process\_ui\_thread\_win.cc 3>dom\_event\_impl.cc 3>browser\_webkit\_glue.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>browser\_webview\_delegate.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>browser\_impl\_win.cc 3>browser\_webview\_delegate\_win.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>browser\_webstoragearea\_impl.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>browser\_impl.cc 3>request\_impl.cc 3>dom\_node\_impl.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>.
    libcef
    browser\_impl.cc(603) : error C2259: 'CefFrameImpl' : cannot instantiate abstract class 3> due to following members: 3> 'void CefFrame::ExecuteJavaScriptTask(CefRefPtr<T>)' : is abstract 3> with 3> [ 3> T=CefV8Task 3> ] 3> c:
    src
    chromium
    src
    cef
    include/cef.h(699) : see declaration of 'CefFrame::ExecuteJavaScriptTask' 3>.
    libcef
    browser\_impl.cc(630) : error C2259: 'CefFrameImpl' : cannot instantiate abstract class 3> due to following members: 3> 'void CefFrame::ExecuteJavaScriptTask(CefRefPtr<T>)' : is abstract 3> with 3> [ 3> T=CefV8Task 3> ] 3> c:
    src
    chromium
    src
    cef
    include/cef.h(699) : see declaration of 'CefFrame::ExecuteJavaScriptTask' 3>browser\_resource\_loader\_bridge.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>xml\_reader\_impl.cc 3>dom\_storage\_context.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>cef\_context.cc 3>cef\_process\_io\_thread.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>scheme\_impl.cc 3>cef\_process\_ui\_thread.cc 3>browser\_webstoragenamespace\_impl.cc 3>dom\_document\_impl.cc 3>zip\_reader\_impl.cc 3>browser\_settings.cc 3>browser\_devtools\_client.cc 3>browser\_navigation\_controller.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>v8\_impl.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>browser\_drag\_delegate\_win.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>response\_impl.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>drag\_download\_file.cc 3>web\_urlrequest\_impl.cc 3>c:
    src
    chromium
    src
    cef
    libcef
    browser\_impl.h(413) : error C2664: 'CefBrowserImpl::ExecuteJavaScriptTask' : cannot convert parameter 2 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 3> with 3> [ 3> T=CefThreadSafeBase<CefFrame>::CefV8Task 3> ] 3> and 3> [ 3> T=CefThreadSafeBase<CefBrowser>::CefV8Task 3> ] 3> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 3>Build log was saved at "file:C:
    src
    chromium
    src
    cef
    Debug
    obj
    libcef\_static
    BuildLog.htm" 3>libcef\_static - 15 error(s), 0 warning(s) 4>------ Build started: Project: libcef, Configuration: Debug Win32 ------ 4>Compiling... 4>post\_data\_element\_cpptoc.cc 4>v8value\_cpptoc.cc 4>response\_cpptoc.cc 4>request\_cpptoc.cc 4>xml\_reader\_cpptoc.cc 4>stream\_writer\_cpptoc.cc 4>stream\_reader\_cpptoc.cc 4>zip\_reader\_cpptoc.cc 4>frame\_cpptoc.cc 4>web\_urlrequest\_cpptoc.cc 4>c:
    src
    chromium
    src
    cef
    include/cef.h(324) : error C2504: 'CefV8Task' : base class undefined 4> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(18) : see reference to class template instantiation 'CefThreadSafeBase<ClassName>' being compiled 4> with 4> [ 4> ClassName=CefV8Task 4> ] 4> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/v8task\_ctocpp.h(27) : see reference to class template instantiation 'CefCToCpp<ClassName,BaseName,StructName>' being compiled 4> with 4> [ 4> ClassName=CefV8TaskCToCpp, 4> BaseName=CefV8Task, 4> StructName=cef\_v8task\_t 4> ] 4>c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/v8task\_ctocpp.h(29) : error C2512: 'CefCToCpp<ClassName,BaseName,StructName>' : no appropriate default constructor available 4> with 4> [ 4> ClassName=CefV8TaskCToCpp, 4> BaseName=CefV8Task, 4> StructName=cef\_v8task\_t 4> ] 4>c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/v8task\_ctocpp.h(29) : error C2614: 'CefV8TaskCToCpp' : illegal member initialization: 'CefCToCpp<CefV8TaskCToCpp,CefThreadSafeBase<CefV8Task>::CefV8Task,\_cef\_v8task\_t>' is not a base or member 4>domevent\_cpptoc.cc 4>post\_data\_cpptoc.cc 4>browser\_cpptoc.cc 4>domnode\_cpptoc.cc 4>v8context\_cpptoc.cc 4>domdocument\_cpptoc.cc 4>v8handler\_ctocpp.cc 4>cookie\_visitor\_ctocpp.cc 4>write\_handler\_ctocpp.cc 4>scheme\_handler\_ctocpp.cc 4>domevent\_listener\_ctocpp.cc 4>scheme\_handler\_factory\_ctocpp.cc 4>domvisitor\_ctocpp.cc 4>handler\_ctocpp.cc 4>v8accessor\_ctocpp.cc 4>read\_handler\_ctocpp.cc 4>download\_handler\_ctocpp.cc 4>web\_urlrequest\_client\_ctocpp.cc 4>task\_ctocpp.cc 4>v8task\_ctocpp.cc 4>libcef\_dll.cc 4>c:
    src
    chromium
    src
    cef
    include/cef.h(324) : error C2504: 'CefV8Task' : base class undefined 4> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(18) : see reference to class template instantiation 'CefThreadSafeBase<ClassName>' being compiled 4> with 4> [ 4> ClassName=CefV8Task 4> ] 4> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/v8task\_ctocpp.h(27) : see reference to class template instantiation 'CefCToCpp<ClassName,BaseName,StructName>' being compiled 4> with 4> [ 4> ClassName=CefV8TaskCToCpp, 4> BaseName=CefV8Task, 4> StructName=cef\_v8task\_t 4> ] 4>c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/v8task\_ctocpp.h(29) : error C2512: 'CefCToCpp<ClassName,BaseName,StructName>' : no appropriate default constructor available 4> with 4> [ 4> ClassName=CefV8TaskCToCpp, 4> BaseName=CefV8Task, 4> StructName=cef\_v8task\_t 4> ] 4>c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/v8task\_ctocpp.h(29) : error C2614: 'CefV8TaskCToCpp' : illegal member initialization: 'CefCToCpp<CefV8TaskCToCpp,CefThreadSafeBase<CefV8Task>::CefV8Task,\_cef\_v8task\_t>' is not a base or member 4>Build log was saved at "file:
    C:
    src
    chromium
    src
    cef
    Debug
    obj
    libcef
    BuildLog.htm" 4>libcef - 6 error(s), 0 warning(s) 5>------ Build started: Project: libcef\_dll\_wrapper, Configuration: Debug Win32 ------ 5>Compiling... 5>v8handler\_cpptoc.cc 5>read\_handler\_cpptoc.cc 5>cookie\_visitor\_cpptoc.cc 5>handler\_cpptoc.cc 5>c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(25) : error C2259: 'CefFrameCToCpp' : cannot instantiate abstract class 5> due to following members: 5> 'void CefFrame::ExecuteJavaScriptTask(CefRefPtr<T>)' : is abstract 5> with 5> [ 5> T=CefV8Task 5> ] 5> c:
    src
    chromium
    src
    cef
    include/cef.h(699) : see declaration of 'CefFrame::ExecuteJavaScriptTask' 5> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(23) : while compiling class template member function 'CefRefPtr<T> CefCToCpp<ClassName,BaseName,StructName>::Wrap(StructName \*)' 5> with 5> [ 5> T=CefFrame, 5> ClassName=CefFrameCToCpp, 5> BaseName=CefFrame, 5> StructName=cef\_frame\_t 5> ] 5> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/frame\_ctocpp.h(27) : see reference to class template instantiation 'CefCToCpp<ClassName,BaseName,StructName>' being compiled 5> with 5> [ 5> ClassName=CefFrameCToCpp, 5> BaseName=CefFrame, 5> StructName=cef\_frame\_t 5> ] 5>web\_urlrequest\_client\_cpptoc.cc 5>task\_cpptoc.cc 5>domvisitor\_cpptoc.cc 5>domevent\_listener\_cpptoc.cc 5>download\_handler\_cpptoc.cc 5>v8task\_cpptoc.cc 5>scheme\_handler\_factory\_cpptoc.cc 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(25) : error C2027: use of undefined type 'CefV8Task' 5> c:
    src
    chromium
    src
    cef
    include/cef.h(69) : see declaration of 'CefV8Task' 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(25) : error C2039: 'GetScript' : is not a member of 'CefRefPtr<T>' 5> with 5> [ 5> T=CefV8Task 5> ] 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(36) : error C2027: use of undefined type 'CefV8Task' 5> c:
    src
    chromium
    src
    cef
    include/cef.h(69) : see declaration of 'CefV8Task' 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(36) : error C2039: 'GetScriptName' : is not a member of 'CefRefPtr<T>' 5> with 5> [ 5> T=CefV8Task 5> ] 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(46) : error C2027: use of undefined type 'CefV8Task' 5> c:
    src
    chromium
    src
    cef
    include/cef.h(69) : see declaration of 'CefV8Task' 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(46) : error C2039: 'GetStartLine' : is not a member of 'CefRefPtr<T>' 5> with 5> [ 5> T=CefV8Task 5> ] 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(56) : error C2027: use of undefined type 'CefV8Task' 5> c:
    src
    chromium
    src
    cef
    include/cef.h(69) : see declaration of 'CefV8Task' 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(56) : error C2039: 'HandleSuccess' : is not a member of 'CefRefPtr<T>' 5> with 5> [ 5> T=CefV8Task 5> ] 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(65) : error C2027: use of undefined type 'CefV8Task' 5> c:
    src
    chromium
    src
    cef
    include/cef.h(69) : see declaration of 'CefV8Task' 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(65) : error C2039: 'HandleError' : is not a member of 'CefRefPtr<T>' 5> with 5> [ 5> T=CefV8Task 5> ] 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(73) : error C2512: 'CefCppToC<ClassName,BaseName,StructName>' : no appropriate default constructor available 5> with 5> [ 5> ClassName=CefV8TaskCppToC, 5> BaseName=CefV8Task, 5> StructName=cef\_v8task\_t 5> ] 5>.
    libcef\_dll
    cpptoc
    v8task\_cpptoc.cc(73) : error C2614: 'CefV8TaskCppToC' : illegal member initialization: 'CefCppToC<CefV8TaskCppToC,CefThreadSafeBase<CefBase>::CefV8Task,\_cef\_v8task\_t>' is not a base or member 5>v8accessor\_cpptoc.cc 5>write\_handler\_cpptoc.cc 5>scheme\_handler\_cpptoc.cc 5>cef\_byte\_read\_handler.cc 5>cef\_zip\_archive.cc 5>cef\_xml\_object.cc 5>libcef\_dll\_wrapper.cc 5>post\_data\_element\_ctocpp.cc 5>xml\_reader\_ctocpp.cc 5>v8context\_ctocpp.cc 5>request\_ctocpp.cc 5>c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(25) : error C2259: 'CefFrameCToCpp' : cannot instantiate abstract class 5> due to following members: 5> 'void CefFrame::ExecuteJavaScriptTask(CefRefPtr<T>)' : is abstract 5> with 5> [ 5> T=CefV8Task 5> ] 5> c:
    src
    chromium
    src
    cef
    include/cef.h(699) : see declaration of 'CefFrame::ExecuteJavaScriptTask' 5> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(23) : while compiling class template member function 'CefRefPtr<T> CefCToCpp<ClassName,BaseName,StructName>::Wrap(StructName \*)' 5> with 5> [ 5> T=CefFrame, 5> ClassName=CefFrameCToCpp, 5> BaseName=CefFrame, 5> StructName=cef\_frame\_t 5> ] 5> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/frame\_ctocpp.h(27) : see reference to class template instantiation 'CefCToCpp<ClassName,BaseName,StructName>' being compiled 5> with 5> [ 5> ClassName=CefFrameCToCpp, 5> BaseName=CefFrame, 5> StructName=cef\_frame\_t 5> ] 5>domdocument\_ctocpp.cc 5>zip\_reader\_ctocpp.cc 5>frame\_ctocpp.cc 5>domnode\_ctocpp.cc 5>.
    libcef\_dll
    ctocpp
    frame\_ctocpp.cc(166) : error C2664: 'CefCppToC<ClassName,BaseName,StructName>::Wrap' : cannot convert parameter 1 from 'CefRefPtr<T>' to 'CefRefPtr<T>' 5> with 5> [ 5> ClassName=CefV8TaskCppToC, 5> BaseName=CefV8Task, 5> StructName=cef\_v8task\_t 5> ] 5> and 5> [ 5> T=CefThreadSafeBase<CefFrame>::CefV8Task 5> ] 5> and 5> [ 5> T=CefV8Task 5> ] 5> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 5>v8value\_ctocpp.cc 5>stream\_writer\_ctocpp.cc 5>browser\_ctocpp.cc 5>response\_ctocpp.cc 5>c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(25) : error C2259: 'CefFrameCToCpp' : cannot instantiate abstract class 5> due to following members: 5> 'void CefFrame::ExecuteJavaScriptTask(CefRefPtr<T>)' : is abstract 5> with 5> [ 5> T=CefV8Task 5> ] 5> c:
    src
    chromium
    src
    cef
    include/cef.h(699) : see declaration of 'CefFrame::ExecuteJavaScriptTask' 5> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/ctocpp.h(23) : while compiling class template member function 'CefRefPtr<T> CefCToCpp<ClassName,BaseName,StructName>::Wrap(StructName \*)' 5> with 5> [ 5> T=CefFrame, 5> ClassName=CefFrameCToCpp, 5> BaseName=CefFrame, 5> StructName=cef\_frame\_t 5> ] 5> c:
    src
    chromium
    src
    cef
    libcef\_dll/ctocpp/frame\_ctocpp.h(27) : see reference to class template instantiation 'CefCToCpp<ClassName,BaseName,StructName>' being compiled 5> with 5> [ 5> ClassName=CefFrameCToCpp, 5> BaseName=CefFrame, 5> StructName=cef\_frame\_t 5> ] 5>domevent\_ctocpp.cc 5>post\_data\_ctocpp.cc 5>stream\_reader\_ctocpp.cc 5>web\_urlrequest\_ctocpp.cc 5>Build log was saved at "file:C:
    src
    chromium
    src
    cef
    Debug
    obj
    libcef\_dll\_wrapper
    BuildLog.htm" 5>libcef\_dll\_wrapper - 16 error(s), 0 warning(s)

  6. Former user Account Deleted

    Comment [17.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c17) originally posted by anthony.taranto on 2011-04-23T00:57:01.000Z:

    looks like the line numbers drifted far enough to put methods in the wrong classes, i recreated the patch by hand. The patcher project fails so i just modified ScriptController.cpp by hand for now, not sure why. Here's the failure output:

    1>Reading patch file c:/src/chromium/src/cef/patch/patches/151\_jstask\_fix.patch 1>WARNING:root:source/target file does not exist 1>--- WebKit/WebCore/bindings/v8/ScriptController.cpp (revision 74182) 1>+++ WebKit/WebCore/bindings/v8/ScriptController.cpp (working copy)

  7. Marshall Greenblatt reporter

    Comment [18.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c18) originally posted by magreenblatt on 2011-05-11T19:21:40.000Z:

    @ commentcomment 17\.: The change to patch/patch\_source.cfg should no longer be necessary since the fix has been committed upstream in WebKit revision 79981. CEF is currently using WebKit revision 82827.

    We will also need test cases for the new functionality added to v8\_unittest.cc.

  8. Former user Account Deleted

    Comment [19.](https://code.google.com/p/chromiumembedded/issues/detail?id=151#c19) originally posted by anthony.taranto on 2011-05-12T06:40:23.000Z:

    Your links don't appear to work for me.

    Interesting, the patch applied after my modifications so I'm not sure if it applied only partially. I didn't look closely enough. It's working on CefSharp.

    I will try to write some unit tests when I have a moment, thanks for the heads up.

  9. René Lindorfer

    Comment [22.] Is it currently possible to cancel the execution of the ExecuteJavaScript method?

  10. Log in to comment