Initial changes to allow use of CefLoadHandler in the render process (issue #1077).

- Move OnLoadingStateChange from CefDisplayHandler to CefLoadHandler.
- Move OnRenderProcessTerminated and OnPluginCrashed from CefLoadHandler to CefRequestHandler.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1441 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2013-09-12 20:34:18 +00:00
parent 4eafb2ea24
commit c577293d96
18 changed files with 286 additions and 308 deletions

View File

@ -17,27 +17,6 @@
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK display_handler_on_loading_state_change(
struct _cef_display_handler_t* self, cef_browser_t* browser, int isLoading,
int canGoBack, int canGoForward) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser)
return;
// Execute
CefDisplayHandlerCppToC::Get(self)->OnLoadingStateChange(
CefBrowserCToCpp::Wrap(browser),
isLoading?true:false,
canGoBack?true:false,
canGoForward?true:false);
}
void CEF_CALLBACK display_handler_on_address_change(
struct _cef_display_handler_t* self, cef_browser_t* browser,
struct _cef_frame_t* frame, const cef_string_t* url) {
@ -162,8 +141,6 @@ int CEF_CALLBACK display_handler_on_console_message(
CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls)
: CefCppToC<CefDisplayHandlerCppToC, CefDisplayHandler,
cef_display_handler_t>(cls) {
struct_.struct_.on_loading_state_change =
display_handler_on_loading_state_change;
struct_.struct_.on_address_change = display_handler_on_address_change;
struct_.struct_.on_title_change = display_handler_on_title_change;
struct_.struct_.on_tooltip = display_handler_on_tooltip;

View File

@ -17,6 +17,27 @@
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK load_handler_on_loading_state_change(
struct _cef_load_handler_t* self, cef_browser_t* browser, int isLoading,
int canGoBack, int canGoForward) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser)
return;
// Execute
CefLoadHandlerCppToC::Get(self)->OnLoadingStateChange(
CefBrowserCToCpp::Wrap(browser),
isLoading?true:false,
canGoBack?true:false,
canGoForward?true:false);
}
void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self,
cef_browser_t* browser, cef_frame_t* frame) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -93,59 +114,16 @@ void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self,
CefString(failedUrl));
}
void CEF_CALLBACK load_handler_on_render_process_terminated(
struct _cef_load_handler_t* self, cef_browser_t* browser,
enum cef_termination_status_t status) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser)
return;
// Execute
CefLoadHandlerCppToC::Get(self)->OnRenderProcessTerminated(
CefBrowserCToCpp::Wrap(browser),
status);
}
void CEF_CALLBACK load_handler_on_plugin_crashed(
struct _cef_load_handler_t* self, cef_browser_t* browser,
const cef_string_t* plugin_path) {
// 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: plugin_path; type: string_byref_const
DCHECK(plugin_path);
if (!plugin_path)
return;
// Execute
CefLoadHandlerCppToC::Get(self)->OnPluginCrashed(
CefBrowserCToCpp::Wrap(browser),
CefString(plugin_path));
}
// CONSTRUCTOR - Do not edit by hand.
CefLoadHandlerCppToC::CefLoadHandlerCppToC(CefLoadHandler* cls)
: CefCppToC<CefLoadHandlerCppToC, CefLoadHandler, cef_load_handler_t>(cls) {
struct_.struct_.on_loading_state_change =
load_handler_on_loading_state_change;
struct_.struct_.on_load_start = load_handler_on_load_start;
struct_.struct_.on_load_end = load_handler_on_load_end;
struct_.struct_.on_load_error = load_handler_on_load_error;
struct_.struct_.on_render_process_terminated =
load_handler_on_render_process_terminated;
struct_.struct_.on_plugin_crashed = load_handler_on_plugin_crashed;
}
#ifndef NDEBUG

View File

@ -270,6 +270,34 @@ void CEF_CALLBACK request_handler_on_protocol_execution(
*allow_os_execution = allow_os_executionBool?true:false;
}
int CEF_CALLBACK request_handler_on_certificate_error(
struct _cef_request_handler_t* self, enum cef_errorcode_t cert_error,
const cef_string_t* request_url,
cef_allow_certificate_error_callback_t* callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: request_url; type: string_byref_const
DCHECK(request_url);
if (!request_url)
return 0;
// Verify param: callback; type: refptr_diff
DCHECK(callback);
if (!callback)
return 0;
// Execute
bool _retval = CefRequestHandlerCppToC::Get(self)->OnCertificateError(
cert_error,
CefString(request_url),
CefAllowCertificateErrorCallbackCToCpp::Wrap(callback));
// Return type: bool
return _retval;
}
int CEF_CALLBACK request_handler_on_before_plugin_load(
struct _cef_request_handler_t* self, cef_browser_t* browser,
const cef_string_t* url, const cef_string_t* policy_url,
@ -300,32 +328,46 @@ int CEF_CALLBACK request_handler_on_before_plugin_load(
return _retval;
}
int CEF_CALLBACK request_handler_on_certificate_error(
struct _cef_request_handler_t* self, enum cef_errorcode_t cert_error,
const cef_string_t* request_url,
cef_allow_certificate_error_callback_t* callback) {
void CEF_CALLBACK request_handler_on_plugin_crashed(
struct _cef_request_handler_t* self, cef_browser_t* browser,
const cef_string_t* plugin_path) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: request_url; type: string_byref_const
DCHECK(request_url);
if (!request_url)
return 0;
// Verify param: callback; type: refptr_diff
DCHECK(callback);
if (!callback)
return 0;
return;
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser)
return;
// Verify param: plugin_path; type: string_byref_const
DCHECK(plugin_path);
if (!plugin_path)
return;
// Execute
bool _retval = CefRequestHandlerCppToC::Get(self)->OnCertificateError(
cert_error,
CefString(request_url),
CefAllowCertificateErrorCallbackCToCpp::Wrap(callback));
CefRequestHandlerCppToC::Get(self)->OnPluginCrashed(
CefBrowserCToCpp::Wrap(browser),
CefString(plugin_path));
}
// Return type: bool
return _retval;
void CEF_CALLBACK request_handler_on_render_process_terminated(
struct _cef_request_handler_t* self, cef_browser_t* browser,
enum cef_termination_status_t status) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser)
return;
// Execute
CefRequestHandlerCppToC::Get(self)->OnRenderProcessTerminated(
CefBrowserCToCpp::Wrap(browser),
status);
}
@ -342,8 +384,11 @@ CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls)
struct_.struct_.get_auth_credentials = request_handler_get_auth_credentials;
struct_.struct_.on_quota_request = request_handler_on_quota_request;
struct_.struct_.on_protocol_execution = request_handler_on_protocol_execution;
struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load;
struct_.struct_.on_certificate_error = request_handler_on_certificate_error;
struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load;
struct_.struct_.on_plugin_crashed = request_handler_on_plugin_crashed;
struct_.struct_.on_render_process_terminated =
request_handler_on_render_process_terminated;
}
#ifndef NDEBUG