mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefV8ContextHandler::OnUncaughtException callback (issue #736).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@890 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/process_message_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8context_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8exception_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
@@ -134,6 +136,46 @@ void CEF_CALLBACK render_process_handler_on_context_released(
|
||||
CefV8ContextCToCpp::Wrap(context));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK render_process_handler_on_uncaught_exception(
|
||||
struct _cef_render_process_handler_t* self, cef_browser_t* browser,
|
||||
cef_frame_t* frame, struct _cef_v8context_t* context,
|
||||
struct _cef_v8exception_t* exception,
|
||||
struct _cef_v8stack_trace_t* stackTrace) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return;
|
||||
// Verify param: context; type: refptr_diff
|
||||
DCHECK(context);
|
||||
if (!context)
|
||||
return;
|
||||
// Verify param: exception; type: refptr_diff
|
||||
DCHECK(exception);
|
||||
if (!exception)
|
||||
return;
|
||||
// Verify param: stackTrace; type: refptr_diff
|
||||
DCHECK(stackTrace);
|
||||
if (!stackTrace)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefRenderProcessHandlerCppToC::Get(self)->OnUncaughtException(
|
||||
CefBrowserCToCpp::Wrap(browser),
|
||||
CefFrameCToCpp::Wrap(frame),
|
||||
CefV8ContextCToCpp::Wrap(context),
|
||||
CefV8ExceptionCToCpp::Wrap(exception),
|
||||
CefV8StackTraceCToCpp::Wrap(stackTrace));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK render_process_handler_on_focused_node_changed(
|
||||
struct _cef_render_process_handler_t* self, cef_browser_t* browser,
|
||||
cef_frame_t* frame, cef_domnode_t* node) {
|
||||
@@ -202,6 +244,8 @@ CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC(
|
||||
render_process_handler_on_context_created;
|
||||
struct_.struct_.on_context_released =
|
||||
render_process_handler_on_context_released;
|
||||
struct_.struct_.on_uncaught_exception =
|
||||
render_process_handler_on_uncaught_exception;
|
||||
struct_.struct_.on_focused_node_changed =
|
||||
render_process_handler_on_focused_node_changed;
|
||||
struct_.struct_.on_process_message_received =
|
||||
|
@@ -15,6 +15,8 @@
|
||||
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/process_message_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8context_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8exception_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/render_process_handler_ctocpp.h"
|
||||
|
||||
|
||||
@@ -130,6 +132,45 @@ void CefRenderProcessHandlerCToCpp::OnContextReleased(
|
||||
CefV8ContextCppToC::Wrap(context));
|
||||
}
|
||||
|
||||
void CefRenderProcessHandlerCToCpp::OnUncaughtException(
|
||||
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefV8Context> context, CefRefPtr<CefV8Exception> exception,
|
||||
CefRefPtr<CefV8StackTrace> stackTrace) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_uncaught_exception))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get())
|
||||
return;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame.get());
|
||||
if (!frame.get())
|
||||
return;
|
||||
// Verify param: context; type: refptr_diff
|
||||
DCHECK(context.get());
|
||||
if (!context.get())
|
||||
return;
|
||||
// Verify param: exception; type: refptr_diff
|
||||
DCHECK(exception.get());
|
||||
if (!exception.get())
|
||||
return;
|
||||
// Verify param: stackTrace; type: refptr_diff
|
||||
DCHECK(stackTrace.get());
|
||||
if (!stackTrace.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_uncaught_exception(struct_,
|
||||
CefBrowserCppToC::Wrap(browser),
|
||||
CefFrameCppToC::Wrap(frame),
|
||||
CefV8ContextCppToC::Wrap(context),
|
||||
CefV8ExceptionCppToC::Wrap(exception),
|
||||
CefV8StackTraceCppToC::Wrap(stackTrace));
|
||||
}
|
||||
|
||||
void CefRenderProcessHandlerCToCpp::OnFocusedNodeChanged(
|
||||
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefDOMNode> node) {
|
||||
|
@@ -42,6 +42,10 @@ class CefRenderProcessHandlerCToCpp
|
||||
CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) OVERRIDE;
|
||||
virtual void OnContextReleased(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) OVERRIDE;
|
||||
virtual void OnUncaughtException(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context,
|
||||
CefRefPtr<CefV8Exception> exception,
|
||||
CefRefPtr<CefV8StackTrace> stackTrace) OVERRIDE;
|
||||
virtual void OnFocusedNodeChanged(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame, CefRefPtr<CefDOMNode> node) OVERRIDE;
|
||||
virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
|
||||
|
Reference in New Issue
Block a user