diff --git a/cef_paths2.gypi b/cef_paths2.gypi index 432d882c3..23b910591 100644 --- a/cef_paths2.gypi +++ b/cef_paths2.gypi @@ -88,13 +88,13 @@ 'include/internal/cef_types_linux.h', ], 'libcef_sources_common': [ - 'libcef_dll/cpptoc/cpptoc.h', + 'libcef_dll/cpptoc/cpptoc_ref_counted.h', 'libcef_dll/cpptoc/cpptoc_scoped.h', - 'libcef_dll/ctocpp/base_ctocpp.cc', - 'libcef_dll/ctocpp/base_ctocpp.h', + 'libcef_dll/ctocpp/base_ref_counted_ctocpp.cc', + 'libcef_dll/ctocpp/base_ref_counted_ctocpp.h', 'libcef_dll/ctocpp/base_scoped_ctocpp.cc', 'libcef_dll/ctocpp/base_scoped_ctocpp.h', - 'libcef_dll/ctocpp/ctocpp.h', + 'libcef_dll/ctocpp/ctocpp_ref_counted.h', 'libcef_dll/ctocpp/ctocpp_scoped.h', 'libcef_dll/libcef_dll.cc', 'libcef_dll/libcef_dll2.cc', @@ -119,13 +119,13 @@ 'libcef_dll/base/cef_weak_ptr.cc', ], 'libcef_dll_wrapper_sources_common': [ - 'libcef_dll/cpptoc/base_cpptoc.cc', - 'libcef_dll/cpptoc/base_cpptoc.h', + 'libcef_dll/cpptoc/base_ref_counted_cpptoc.cc', + 'libcef_dll/cpptoc/base_ref_counted_cpptoc.h', 'libcef_dll/cpptoc/base_scoped_cpptoc.cc', 'libcef_dll/cpptoc/base_scoped_cpptoc.h', - 'libcef_dll/cpptoc/cpptoc.h', + 'libcef_dll/cpptoc/cpptoc_ref_counted.h', 'libcef_dll/cpptoc/cpptoc_scoped.h', - 'libcef_dll/ctocpp/ctocpp.h', + 'libcef_dll/ctocpp/ctocpp_ref_counted.h', 'libcef_dll/ctocpp/ctocpp_scoped.h', 'libcef_dll/ptr_util.h', 'libcef_dll/transfer_util.cc', diff --git a/include/capi/cef_app_capi.h b/include/capi/cef_app_capi.h index bdb8a6266..01aeec164 100644 --- a/include/capi/cef_app_capi.h +++ b/include/capi/cef_app_capi.h @@ -59,7 +59,7 @@ typedef struct _cef_app_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Provides an opportunity to view and/or modify command-line arguments before diff --git a/include/capi/cef_auth_callback_capi.h b/include/capi/cef_auth_callback_capi.h index 14aec6723..32e30eaa1 100644 --- a/include/capi/cef_auth_callback_capi.h +++ b/include/capi/cef_auth_callback_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_auth_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Continue the authentication request. diff --git a/include/capi/cef_base_capi.h b/include/capi/cef_base_capi.h index b12ff364e..681ef4daa 100644 --- a/include/capi/cef_base_capi.h +++ b/include/capi/cef_base_capi.h @@ -47,7 +47,7 @@ extern "C" { /// // All ref-counted framework structures must include this structure first. /// -typedef struct _cef_base_t { +typedef struct _cef_base_ref_counted_t { /// // Size of the data structure. /// @@ -57,20 +57,20 @@ typedef struct _cef_base_t { // Called to increment the reference count for the object. Should be called // for every new copy of a pointer to a given object. /// - void (CEF_CALLBACK *add_ref)(struct _cef_base_t* self); + void (CEF_CALLBACK *add_ref)(struct _cef_base_ref_counted_t* self); /// // Called to decrement the reference count for the object. If the reference // count falls to 0 the object should self-delete. Returns true (1) if the // resulting reference count is 0. /// - int (CEF_CALLBACK *release)(struct _cef_base_t* self); + int (CEF_CALLBACK *release)(struct _cef_base_ref_counted_t* self); /// // Returns true (1) if the current reference count is 1. /// - int (CEF_CALLBACK *has_one_ref)(struct _cef_base_t* self); -} cef_base_t; + int (CEF_CALLBACK *has_one_ref)(struct _cef_base_ref_counted_t* self); +} cef_base_ref_counted_t; /// @@ -90,11 +90,11 @@ typedef struct _cef_base_scoped_t { } cef_base_scoped_t; -// Check that the structure |s|, which is defined with a cef_base_t member named -// |base|, is large enough to contain the specified member |f|. +// Check that the structure |s|, which is defined with a size_t member at the +// top, is large enough to contain the specified member |f|. #define CEF_MEMBER_EXISTS(s, f) \ ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \ - reinterpret_cast(s)->size) + *reinterpret_cast(s)) #define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f)) diff --git a/include/capi/cef_browser_capi.h b/include/capi/cef_browser_capi.h index 5cb198c87..9e1362f6c 100644 --- a/include/capi/cef_browser_capi.h +++ b/include/capi/cef_browser_capi.h @@ -63,7 +63,7 @@ typedef struct _cef_browser_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the browser host object. This function can only be called in the @@ -193,7 +193,7 @@ typedef struct _cef_run_file_dialog_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called asynchronously after the file dialog is dismissed. @@ -216,7 +216,7 @@ typedef struct _cef_navigation_entry_visitor_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be executed. Do not keep a reference to |entry| outside of @@ -239,7 +239,7 @@ typedef struct _cef_pdf_print_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be executed when the PDF printing has completed. |path| is @@ -260,7 +260,7 @@ typedef struct _cef_download_image_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be executed when the image download has completed. @@ -285,7 +285,7 @@ typedef struct _cef_browser_host_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the hosted browser object. diff --git a/include/capi/cef_browser_process_handler_capi.h b/include/capi/cef_browser_process_handler_capi.h index 5bda19ed5..ddb3a35b9 100644 --- a/include/capi/cef_browser_process_handler_capi.h +++ b/include/capi/cef_browser_process_handler_capi.h @@ -57,7 +57,7 @@ typedef struct _cef_browser_process_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called on the browser process UI thread immediately after the CEF context diff --git a/include/capi/cef_callback_capi.h b/include/capi/cef_callback_capi.h index 10c290d1e..8f6e28d3b 100644 --- a/include/capi/cef_callback_capi.h +++ b/include/capi/cef_callback_capi.h @@ -52,7 +52,7 @@ typedef struct _cef_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Continue processing. @@ -73,7 +73,7 @@ typedef struct _cef_completion_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be called once the task is complete. diff --git a/include/capi/cef_client_capi.h b/include/capi/cef_client_capi.h index 1680da286..9feddf59b 100644 --- a/include/capi/cef_client_capi.h +++ b/include/capi/cef_client_capi.h @@ -67,7 +67,7 @@ typedef struct _cef_client_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Return the handler for context menus. If no handler is provided the default diff --git a/include/capi/cef_command_line_capi.h b/include/capi/cef_command_line_capi.h index a5d78a886..f3dc1794d 100644 --- a/include/capi/cef_command_line_capi.h +++ b/include/capi/cef_command_line_capi.h @@ -59,7 +59,7 @@ typedef struct _cef_command_line_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. Do not call any other functions diff --git a/include/capi/cef_context_menu_handler_capi.h b/include/capi/cef_context_menu_handler_capi.h index 7670d80d0..b063548ed 100644 --- a/include/capi/cef_context_menu_handler_capi.h +++ b/include/capi/cef_context_menu_handler_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_run_context_menu_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Complete context menu display by selecting the specified |command_id| and @@ -80,7 +80,7 @@ typedef struct _cef_context_menu_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called before a context menu is displayed. |params| provides information @@ -140,7 +140,7 @@ typedef struct _cef_context_menu_params_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the X coordinate of the mouse where the context menu was invoked. diff --git a/include/capi/cef_cookie_capi.h b/include/capi/cef_cookie_capi.h index b9126d7ed..6ba8dca57 100644 --- a/include/capi/cef_cookie_capi.h +++ b/include/capi/cef_cookie_capi.h @@ -57,7 +57,7 @@ typedef struct _cef_cookie_manager_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Set the schemes supported by this manager. The default schemes ("http", @@ -172,7 +172,7 @@ typedef struct _cef_cookie_visitor_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be called once for each cookie. |count| is the 0-based @@ -195,7 +195,7 @@ typedef struct _cef_set_cookie_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be called upon completion. |success| will be true (1) if @@ -214,7 +214,7 @@ typedef struct _cef_delete_cookies_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be called upon completion. |num_deleted| will be the diff --git a/include/capi/cef_dialog_handler_capi.h b/include/capi/cef_dialog_handler_capi.h index 65ca6371f..76818d3da 100644 --- a/include/capi/cef_dialog_handler_capi.h +++ b/include/capi/cef_dialog_handler_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_file_dialog_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Continue the file selection. |selected_accept_filter| should be the 0-based @@ -80,7 +80,7 @@ typedef struct _cef_dialog_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called to run a file chooser dialog. |mode| represents the type of dialog diff --git a/include/capi/cef_display_handler_capi.h b/include/capi/cef_display_handler_capi.h index 6697a230b..6dc3fd0fd 100644 --- a/include/capi/cef_display_handler_capi.h +++ b/include/capi/cef_display_handler_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_display_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called when a frame's address has changed. diff --git a/include/capi/cef_dom_capi.h b/include/capi/cef_dom_capi.h index 9370b99db..b3857a806 100644 --- a/include/capi/cef_dom_capi.h +++ b/include/capi/cef_dom_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_domvisitor_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method executed for visiting the DOM. The document object passed to this @@ -77,7 +77,7 @@ typedef struct _cef_domdocument_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the document type. @@ -177,7 +177,7 @@ typedef struct _cef_domnode_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the type for this node. diff --git a/include/capi/cef_download_handler_capi.h b/include/capi/cef_download_handler_capi.h index 38bc4d929..12ff657bf 100644 --- a/include/capi/cef_download_handler_capi.h +++ b/include/capi/cef_download_handler_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_before_download_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Call to continue the download. Set |download_path| to the full file path @@ -74,7 +74,7 @@ typedef struct _cef_download_item_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Call to cancel the download. @@ -101,7 +101,7 @@ typedef struct _cef_download_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called before a download begins. |suggested_name| is the suggested name for diff --git a/include/capi/cef_download_item_capi.h b/include/capi/cef_download_item_capi.h index acefa01fe..9ed53f6ae 100644 --- a/include/capi/cef_download_item_capi.h +++ b/include/capi/cef_download_item_capi.h @@ -52,7 +52,7 @@ typedef struct _cef_download_item_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. Do not call any other functions diff --git a/include/capi/cef_drag_data_capi.h b/include/capi/cef_drag_data_capi.h index 2e84df8f0..e1fcfd8cf 100644 --- a/include/capi/cef_drag_data_capi.h +++ b/include/capi/cef_drag_data_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_drag_data_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns a copy of the current object. diff --git a/include/capi/cef_drag_handler_capi.h b/include/capi/cef_drag_handler_capi.h index 1a5f199b3..35fbb31a5 100644 --- a/include/capi/cef_drag_handler_capi.h +++ b/include/capi/cef_drag_handler_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_drag_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called when an external drag event enters the browser window. |dragData| diff --git a/include/capi/cef_find_handler_capi.h b/include/capi/cef_find_handler_capi.h index a20ec701b..d489353f6 100644 --- a/include/capi/cef_find_handler_capi.h +++ b/include/capi/cef_find_handler_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_find_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called to report find results returned by cef_browser_host_t::find(). diff --git a/include/capi/cef_focus_handler_capi.h b/include/capi/cef_focus_handler_capi.h index c0e723937..c559acda8 100644 --- a/include/capi/cef_focus_handler_capi.h +++ b/include/capi/cef_focus_handler_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_focus_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called when the browser component is about to loose focus. For instance, if diff --git a/include/capi/cef_frame_capi.h b/include/capi/cef_frame_capi.h index 65b6d1de6..ead9ab8ed 100644 --- a/include/capi/cef_frame_capi.h +++ b/include/capi/cef_frame_capi.h @@ -61,7 +61,7 @@ typedef struct _cef_frame_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // True if this object is currently attached to a valid frame. diff --git a/include/capi/cef_geolocation_capi.h b/include/capi/cef_geolocation_capi.h index 15df9427e..3325d10cc 100644 --- a/include/capi/cef_geolocation_capi.h +++ b/include/capi/cef_geolocation_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_get_geolocation_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called with the 'best available' location information or, if the location diff --git a/include/capi/cef_geolocation_handler_capi.h b/include/capi/cef_geolocation_handler_capi.h index 65a3d1d99..ee2651c21 100644 --- a/include/capi/cef_geolocation_handler_capi.h +++ b/include/capi/cef_geolocation_handler_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_geolocation_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Call to allow or deny geolocation access. @@ -73,7 +73,7 @@ typedef struct _cef_geolocation_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called when a page requests permission to access geolocation information. diff --git a/include/capi/cef_image_capi.h b/include/capi/cef_image_capi.h index ecafe7717..5eec9f42c 100644 --- a/include/capi/cef_image_capi.h +++ b/include/capi/cef_image_capi.h @@ -58,7 +58,7 @@ typedef struct _cef_image_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this Image is NULL. diff --git a/include/capi/cef_jsdialog_handler_capi.h b/include/capi/cef_jsdialog_handler_capi.h index ee974ad6a..24acb0c9e 100644 --- a/include/capi/cef_jsdialog_handler_capi.h +++ b/include/capi/cef_jsdialog_handler_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_jsdialog_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Continue the JS dialog request. Set |success| to true (1) if the OK button @@ -73,7 +73,7 @@ typedef struct _cef_jsdialog_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be diff --git a/include/capi/cef_keyboard_handler_capi.h b/include/capi/cef_keyboard_handler_capi.h index e2901f8e6..1e1ee7088 100644 --- a/include/capi/cef_keyboard_handler_capi.h +++ b/include/capi/cef_keyboard_handler_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_keyboard_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called before a keyboard event is sent to the renderer. |event| contains diff --git a/include/capi/cef_life_span_handler_capi.h b/include/capi/cef_life_span_handler_capi.h index 811c03fbb..77885da09 100644 --- a/include/capi/cef_life_span_handler_capi.h +++ b/include/capi/cef_life_span_handler_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_life_span_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called on the IO thread before a new popup browser is created. The diff --git a/include/capi/cef_load_handler_capi.h b/include/capi/cef_load_handler_capi.h index c2d34ba42..5c79aaa84 100644 --- a/include/capi/cef_load_handler_capi.h +++ b/include/capi/cef_load_handler_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_load_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called when the loading state has changed. This callback will be executed diff --git a/include/capi/cef_menu_model_capi.h b/include/capi/cef_menu_model_capi.h index 16fdf2430..d7035b089 100644 --- a/include/capi/cef_menu_model_capi.h +++ b/include/capi/cef_menu_model_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_menu_model_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Clears the menu. Returns true (1) on success. diff --git a/include/capi/cef_menu_model_delegate_capi.h b/include/capi/cef_menu_model_delegate_capi.h index 6e208b83e..549ce6d3a 100644 --- a/include/capi/cef_menu_model_delegate_capi.h +++ b/include/capi/cef_menu_model_delegate_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_menu_model_delegate_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Perform the action associated with the specified |command_id| and optional diff --git a/include/capi/cef_navigation_entry_capi.h b/include/capi/cef_navigation_entry_capi.h index 7b44d0e2c..75f064f40 100644 --- a/include/capi/cef_navigation_entry_capi.h +++ b/include/capi/cef_navigation_entry_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_navigation_entry_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. Do not call any other functions diff --git a/include/capi/cef_print_handler_capi.h b/include/capi/cef_print_handler_capi.h index 2df904afe..428d76a92 100644 --- a/include/capi/cef_print_handler_capi.h +++ b/include/capi/cef_print_handler_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_print_dialog_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Continue printing with the specified |settings|. @@ -76,7 +76,7 @@ typedef struct _cef_print_job_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Indicate completion of the print job. @@ -93,7 +93,7 @@ typedef struct _cef_print_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called when printing has started for the specified |browser|. This function diff --git a/include/capi/cef_print_settings_capi.h b/include/capi/cef_print_settings_capi.h index 5f698f0c5..0a010be10 100644 --- a/include/capi/cef_print_settings_capi.h +++ b/include/capi/cef_print_settings_capi.h @@ -52,7 +52,7 @@ typedef struct _cef_print_settings_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. Do not call any other functions diff --git a/include/capi/cef_process_message_capi.h b/include/capi/cef_process_message_capi.h index 8b575f4e5..fab85b5e8 100644 --- a/include/capi/cef_process_message_capi.h +++ b/include/capi/cef_process_message_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_process_message_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. Do not call any other functions diff --git a/include/capi/cef_render_handler_capi.h b/include/capi/cef_render_handler_capi.h index 48c0cdbcd..7912ff186 100644 --- a/include/capi/cef_render_handler_capi.h +++ b/include/capi/cef_render_handler_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_render_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called to retrieve the root window rectangle in screen coordinates. Return diff --git a/include/capi/cef_render_process_handler_capi.h b/include/capi/cef_render_process_handler_capi.h index 30a15a2c0..c235957eb 100644 --- a/include/capi/cef_render_process_handler_capi.h +++ b/include/capi/cef_render_process_handler_capi.h @@ -61,7 +61,7 @@ typedef struct _cef_render_process_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called after the render process main thread has been created. |extra_info| diff --git a/include/capi/cef_request_capi.h b/include/capi/cef_request_capi.h index 3383939d6..9732431fe 100644 --- a/include/capi/cef_request_capi.h +++ b/include/capi/cef_request_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_request_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is read-only. @@ -205,7 +205,7 @@ typedef struct _cef_post_data_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is read-only. @@ -265,7 +265,7 @@ typedef struct _cef_post_data_element_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is read-only. diff --git a/include/capi/cef_request_context_capi.h b/include/capi/cef_request_context_capi.h index 5c940eb93..97e292fc9 100644 --- a/include/capi/cef_request_context_capi.h +++ b/include/capi/cef_request_context_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_resolve_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called after the ResolveHost request has completed. |result| will be the @@ -89,7 +89,7 @@ typedef struct _cef_request_context_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is pointing to the same context as |that| diff --git a/include/capi/cef_request_context_handler_capi.h b/include/capi/cef_request_context_handler_capi.h index ddd4358ee..32b9c0052 100644 --- a/include/capi/cef_request_context_handler_capi.h +++ b/include/capi/cef_request_context_handler_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_request_context_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called on the browser process IO thread to retrieve the cookie manager. If diff --git a/include/capi/cef_request_handler_capi.h b/include/capi/cef_request_handler_capi.h index c7e7cf975..7cc6e9823 100644 --- a/include/capi/cef_request_handler_capi.h +++ b/include/capi/cef_request_handler_capi.h @@ -61,7 +61,7 @@ typedef struct _cef_request_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Continue the url request. If |allow| is true (1) the request will be @@ -83,7 +83,7 @@ typedef struct _cef_select_client_certificate_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Chooses the specified certificate for client certificate authentication. @@ -103,7 +103,7 @@ typedef struct _cef_request_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called on the UI thread before browser navigation. Return true (1) to diff --git a/include/capi/cef_resource_bundle_capi.h b/include/capi/cef_resource_bundle_capi.h index 199b300be..87b01f04b 100644 --- a/include/capi/cef_resource_bundle_capi.h +++ b/include/capi/cef_resource_bundle_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_resource_bundle_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the localized string for the specified |string_id| or an NULL diff --git a/include/capi/cef_resource_bundle_handler_capi.h b/include/capi/cef_resource_bundle_handler_capi.h index d8219c368..62d0c4499 100644 --- a/include/capi/cef_resource_bundle_handler_capi.h +++ b/include/capi/cef_resource_bundle_handler_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_resource_bundle_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called to retrieve a localized translation for the specified |string_id|. diff --git a/include/capi/cef_resource_handler_capi.h b/include/capi/cef_resource_handler_capi.h index a294c0709..3722fb1a6 100644 --- a/include/capi/cef_resource_handler_capi.h +++ b/include/capi/cef_resource_handler_capi.h @@ -58,7 +58,7 @@ typedef struct _cef_resource_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Begin processing the request. To handle the request return true (1) and diff --git a/include/capi/cef_response_capi.h b/include/capi/cef_response_capi.h index 43a69a6ad..59395566d 100644 --- a/include/capi/cef_response_capi.h +++ b/include/capi/cef_response_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_response_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is read-only. diff --git a/include/capi/cef_response_filter_capi.h b/include/capi/cef_response_filter_capi.h index a42151095..698598d58 100644 --- a/include/capi/cef_response_filter_capi.h +++ b/include/capi/cef_response_filter_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_response_filter_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Initialize the response filter. Will only be called a single time. The diff --git a/include/capi/cef_scheme_capi.h b/include/capi/cef_scheme_capi.h index 3c68e23b5..8bfb50d85 100644 --- a/include/capi/cef_scheme_capi.h +++ b/include/capi/cef_scheme_capi.h @@ -131,7 +131,7 @@ typedef struct _cef_scheme_handler_factory_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Return a new resource handler instance to handle the request or an NULL diff --git a/include/capi/cef_ssl_info_capi.h b/include/capi/cef_ssl_info_capi.h index 509ee6943..899219311 100644 --- a/include/capi/cef_ssl_info_capi.h +++ b/include/capi/cef_ssl_info_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_sslinfo_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns a bitmask containing any and all problems verifying the server diff --git a/include/capi/cef_ssl_status_capi.h b/include/capi/cef_ssl_status_capi.h index 094a6d532..04d867143 100644 --- a/include/capi/cef_ssl_status_capi.h +++ b/include/capi/cef_ssl_status_capi.h @@ -54,7 +54,7 @@ typedef struct _cef_sslstatus_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if the status is related to a secure SSL/TLS connection. diff --git a/include/capi/cef_stream_capi.h b/include/capi/cef_stream_capi.h index 36a6c519d..54feece20 100644 --- a/include/capi/cef_stream_capi.h +++ b/include/capi/cef_stream_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_read_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Read raw binary data. @@ -95,7 +95,7 @@ typedef struct _cef_stream_reader_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Read raw binary data. @@ -156,7 +156,7 @@ typedef struct _cef_write_handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Write raw binary data. @@ -198,7 +198,7 @@ typedef struct _cef_stream_writer_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Write raw binary data. diff --git a/include/capi/cef_string_visitor_capi.h b/include/capi/cef_string_visitor_capi.h index e75ab9872..5d19875d7 100644 --- a/include/capi/cef_string_visitor_capi.h +++ b/include/capi/cef_string_visitor_capi.h @@ -52,7 +52,7 @@ typedef struct _cef_string_visitor_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be executed. diff --git a/include/capi/cef_task_capi.h b/include/capi/cef_task_capi.h index b2328c51a..98656de9e 100644 --- a/include/capi/cef_task_capi.h +++ b/include/capi/cef_task_capi.h @@ -57,7 +57,7 @@ typedef struct _cef_task_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be executed on the target thread. @@ -79,7 +79,7 @@ typedef struct _cef_task_runner_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is pointing to the same task runner as diff --git a/include/capi/cef_thread_capi.h b/include/capi/cef_thread_capi.h index 1215cddd3..6a7662688 100644 --- a/include/capi/cef_thread_capi.h +++ b/include/capi/cef_thread_capi.h @@ -61,7 +61,7 @@ typedef struct _cef_thread_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the cef_task_tRunner that will execute code on this thread's diff --git a/include/capi/cef_trace_capi.h b/include/capi/cef_trace_capi.h index c5a13b0d4..c753eb40d 100644 --- a/include/capi/cef_trace_capi.h +++ b/include/capi/cef_trace_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_end_tracing_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Called after all processes have sent their trace data. |tracing_file| is diff --git a/include/capi/cef_urlrequest_capi.h b/include/capi/cef_urlrequest_capi.h index 5b79e83db..02a5063d0 100644 --- a/include/capi/cef_urlrequest_capi.h +++ b/include/capi/cef_urlrequest_capi.h @@ -61,7 +61,7 @@ typedef struct _cef_urlrequest_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the request object used to create this URL request. The returned @@ -133,7 +133,7 @@ typedef struct _cef_urlrequest_client_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Notifies the client that the request has completed. Use the diff --git a/include/capi/cef_v8_capi.h b/include/capi/cef_v8_capi.h index c4dc0a738..a659b8da0 100644 --- a/include/capi/cef_v8_capi.h +++ b/include/capi/cef_v8_capi.h @@ -63,7 +63,7 @@ typedef struct _cef_v8context_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the task runner associated with this context. V8 handles can only @@ -161,7 +161,7 @@ typedef struct _cef_v8handler_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Handle execution of the function identified by |name|. |object| is the @@ -187,7 +187,7 @@ typedef struct _cef_v8accessor_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Handle retrieval the accessor value identified by |name|. |object| is the @@ -225,7 +225,7 @@ typedef struct _cef_v8interceptor_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Handle retrieval of the interceptor value identified by |name|. |object| is @@ -285,7 +285,7 @@ typedef struct _cef_v8exception_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the exception message. @@ -352,7 +352,7 @@ typedef struct _cef_v8value_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if the underlying handle is valid and it can be accessed @@ -585,12 +585,12 @@ typedef struct _cef_v8value_t { // called on user created objects. /// int (CEF_CALLBACK *set_user_data)(struct _cef_v8value_t* self, - struct _cef_base_t* user_data); + struct _cef_base_ref_counted_t* user_data); /// // Returns the user data, if any, assigned to this object. /// - struct _cef_base_t* (CEF_CALLBACK *get_user_data)( + struct _cef_base_ref_counted_t* (CEF_CALLBACK *get_user_data)( struct _cef_v8value_t* self); /// @@ -752,7 +752,7 @@ typedef struct _cef_v8stack_trace_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if the underlying handle is valid and it can be accessed @@ -792,7 +792,7 @@ typedef struct _cef_v8stack_frame_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if the underlying handle is valid and it can be accessed diff --git a/include/capi/cef_values_capi.h b/include/capi/cef_values_capi.h index 8772b69fb..cd3c7b44b 100644 --- a/include/capi/cef_values_capi.h +++ b/include/capi/cef_values_capi.h @@ -57,7 +57,7 @@ typedef struct _cef_value_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if the underlying data is valid. This will always be true @@ -228,7 +228,7 @@ typedef struct _cef_binary_value_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. This object may become invalid if @@ -293,7 +293,7 @@ typedef struct _cef_dictionary_value_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. This object may become invalid if @@ -520,7 +520,7 @@ typedef struct _cef_list_value_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns true (1) if this object is valid. This object may become invalid if diff --git a/include/capi/cef_waitable_event_capi.h b/include/capi/cef_waitable_event_capi.h index a7d427256..077a43235 100644 --- a/include/capi/cef_waitable_event_capi.h +++ b/include/capi/cef_waitable_event_capi.h @@ -60,7 +60,7 @@ typedef struct _cef_waitable_event_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Put the event in the un-signaled state. diff --git a/include/capi/cef_web_plugin_capi.h b/include/capi/cef_web_plugin_capi.h index fedce2940..c3dc6d999 100644 --- a/include/capi/cef_web_plugin_capi.h +++ b/include/capi/cef_web_plugin_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_web_plugin_info_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the plugin name (i.e. Flash). @@ -93,7 +93,7 @@ typedef struct _cef_web_plugin_info_visitor_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be called once for each plugin. |count| is the 0-based @@ -114,7 +114,7 @@ typedef struct _cef_web_plugin_unstable_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be called for the requested plugin. |unstable| will be @@ -136,7 +136,7 @@ typedef struct _cef_register_cdm_callback_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Method that will be called when CDM registration is complete. |result| will diff --git a/include/capi/cef_x509_certificate_capi.h b/include/capi/cef_x509_certificate_capi.h index 1333fb2c6..f0afb3fa2 100644 --- a/include/capi/cef_x509_certificate_capi.h +++ b/include/capi/cef_x509_certificate_capi.h @@ -53,7 +53,7 @@ typedef struct _cef_x509cert_principal_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns a name that can be used to represent the issuer. It tries in this @@ -125,7 +125,7 @@ typedef struct _cef_x509certificate_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the subject of the X.509 certificate. For HTTPS server certificates diff --git a/include/capi/cef_xml_reader_capi.h b/include/capi/cef_xml_reader_capi.h index 73e488836..981895073 100644 --- a/include/capi/cef_xml_reader_capi.h +++ b/include/capi/cef_xml_reader_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_xml_reader_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Moves the cursor to the next node in the document. This function must be diff --git a/include/capi/cef_zip_reader_capi.h b/include/capi/cef_zip_reader_capi.h index a71c61550..bb398e898 100644 --- a/include/capi/cef_zip_reader_capi.h +++ b/include/capi/cef_zip_reader_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_zip_reader_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Moves the cursor to the first file in the archive. Returns true (1) if the diff --git a/include/capi/test/cef_translator_test_capi.h b/include/capi/test/cef_translator_test_capi.h index 1716fb390..14d3fd51e 100644 --- a/include/capi/test/cef_translator_test_capi.h +++ b/include/capi/test/cef_translator_test_capi.h @@ -65,7 +65,7 @@ typedef struct _cef_translator_test_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; // PRIMITIVE VALUES @@ -527,7 +527,7 @@ typedef struct _cef_translator_test_ref_ptr_library_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Return a value. @@ -618,7 +618,7 @@ typedef struct _cef_translator_test_ref_ptr_client_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Return a value. diff --git a/include/capi/views/cef_display_capi.h b/include/capi/views/cef_display_capi.h index 6853cd9c6..44c4b47bb 100644 --- a/include/capi/views/cef_display_capi.h +++ b/include/capi/views/cef_display_capi.h @@ -57,7 +57,7 @@ typedef struct _cef_display_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns the unique identifier for this Display. diff --git a/include/capi/views/cef_layout_capi.h b/include/capi/views/cef_layout_capi.h index 43e239fa2..1c6b0585e 100644 --- a/include/capi/views/cef_layout_capi.h +++ b/include/capi/views/cef_layout_capi.h @@ -56,7 +56,7 @@ typedef struct _cef_layout_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns this Layout as a BoxLayout or NULL if this is not a BoxLayout. diff --git a/include/capi/views/cef_view_capi.h b/include/capi/views/cef_view_capi.h index 77b59bace..eeeb642b7 100644 --- a/include/capi/views/cef_view_capi.h +++ b/include/capi/views/cef_view_capi.h @@ -61,7 +61,7 @@ typedef struct _cef_view_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Returns this View as a BrowserView or NULL if this is not a BrowserView. diff --git a/include/capi/views/cef_view_delegate_capi.h b/include/capi/views/cef_view_delegate_capi.h index 4bce72ff2..07ea4c547 100644 --- a/include/capi/views/cef_view_delegate_capi.h +++ b/include/capi/views/cef_view_delegate_capi.h @@ -55,7 +55,7 @@ typedef struct _cef_view_delegate_t { /// // Base structure. /// - cef_base_t base; + cef_base_ref_counted_t base; /// // Return the preferred size for |view|. The Layout will use this information diff --git a/include/cef_app.h b/include/cef_app.h index cc5cb91cc..5aca29b30 100644 --- a/include/cef_app.h +++ b/include/cef_app.h @@ -143,7 +143,7 @@ void CefEnableHighDPISupport(); // called by the process and/or thread indicated. /// /*--cef(source=client,no_debugct_check)--*/ -class CefApp : public virtual CefBase { +class CefApp : public virtual CefBaseRefCounted { public: /// // Provides an opportunity to view and/or modify command-line arguments before diff --git a/include/cef_auth_callback.h b/include/cef_auth_callback.h index 86d249ad3..ca511fdc4 100644 --- a/include/cef_auth_callback.h +++ b/include/cef_auth_callback.h @@ -45,7 +45,7 @@ // requests. /// /*--cef(source=library)--*/ -class CefAuthCallback : public virtual CefBase { +class CefAuthCallback : public virtual CefBaseRefCounted { public: /// // Continue the authentication request. diff --git a/include/cef_base.h b/include/cef_base.h index 8a7b5b752..c152cf06d 100644 --- a/include/cef_base.h +++ b/include/cef_base.h @@ -50,7 +50,7 @@ /// // All ref-counted framework classes must extend this class. /// -class CefBase { +class CefBaseRefCounted { public: /// // Called to increment the reference count for the object. Should be called @@ -70,7 +70,7 @@ class CefBase { virtual bool HasOneRef() const =0; protected: - virtual ~CefBase() {} + virtual ~CefBaseRefCounted() {} }; /// @@ -148,7 +148,7 @@ class CefRefCount { // #include "include/base/cef_lock.h" // // // Class declaration. -// class MyClass : public CefBase { +// class MyClass : public CefBaseRefCounted { // public: // MyClass() : value_(0) {} // // Method that may be called on multiple threads. diff --git a/include/cef_browser.h b/include/cef_browser.h index 2d4d8abb7..3b4ed1617 100644 --- a/include/cef_browser.h +++ b/include/cef_browser.h @@ -58,7 +58,7 @@ class CefClient; // this class may only be called on the main thread. /// /*--cef(source=library)--*/ -class CefBrowser : public virtual CefBase { +class CefBrowser : public virtual CefBaseRefCounted { public: /// // Returns the browser host object. This method can only be called in the @@ -197,7 +197,7 @@ class CefBrowser : public virtual CefBase { // class will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefRunFileDialogCallback : public virtual CefBase { +class CefRunFileDialogCallback : public virtual CefBaseRefCounted { public: /// // Called asynchronously after the file dialog is dismissed. @@ -218,7 +218,7 @@ class CefRunFileDialogCallback : public virtual CefBase { // this class will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefNavigationEntryVisitor : public virtual CefBase { +class CefNavigationEntryVisitor : public virtual CefBaseRefCounted { public: /// // Method that will be executed. Do not keep a reference to |entry| outside of @@ -240,7 +240,7 @@ class CefNavigationEntryVisitor : public virtual CefBase { // will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefPdfPrintCallback : public virtual CefBase { +class CefPdfPrintCallback : public virtual CefBaseRefCounted { public: /// // Method that will be executed when the PDF printing has completed. |path| @@ -257,7 +257,7 @@ class CefPdfPrintCallback : public virtual CefBase { // class will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefDownloadImageCallback : public virtual CefBase { +class CefDownloadImageCallback : public virtual CefBaseRefCounted { public: /// // Method that will be executed when the image download has completed. @@ -280,7 +280,7 @@ class CefDownloadImageCallback : public virtual CefBase { // comments. /// /*--cef(source=library)--*/ -class CefBrowserHost : public virtual CefBase { +class CefBrowserHost : public virtual CefBaseRefCounted { public: typedef cef_drag_operations_mask_t DragOperationsMask; typedef cef_file_dialog_mode_t FileDialogMode; diff --git a/include/cef_browser_process_handler.h b/include/cef_browser_process_handler.h index 9045d09a9..e65503fbd 100644 --- a/include/cef_browser_process_handler.h +++ b/include/cef_browser_process_handler.h @@ -48,7 +48,7 @@ // will be called on the browser process main thread unless otherwise indicated. /// /*--cef(source=client)--*/ -class CefBrowserProcessHandler : public virtual CefBase { +class CefBrowserProcessHandler : public virtual CefBaseRefCounted { public: /// // Called on the browser process UI thread immediately after the CEF context diff --git a/include/cef_callback.h b/include/cef_callback.h index e5efebd2d..5be51e941 100644 --- a/include/cef_callback.h +++ b/include/cef_callback.h @@ -44,7 +44,7 @@ // Generic callback interface used for asynchronous continuation. /// /*--cef(source=library)--*/ -class CefCallback : public virtual CefBase { +class CefCallback : public virtual CefBaseRefCounted { public: /// // Continue processing. @@ -63,7 +63,7 @@ class CefCallback : public virtual CefBase { // Generic callback interface used for asynchronous completion. /// /*--cef(source=client)--*/ -class CefCompletionCallback : public virtual CefBase { +class CefCompletionCallback : public virtual CefBaseRefCounted { public: /// // Method that will be called once the task is complete. diff --git a/include/cef_client.h b/include/cef_client.h index 81a67ebae..9421c7c08 100644 --- a/include/cef_client.h +++ b/include/cef_client.h @@ -59,7 +59,7 @@ // Implement this interface to provide handler implementations. /// /*--cef(source=client,no_debugct_check)--*/ -class CefClient : public virtual CefBase { +class CefClient : public virtual CefBaseRefCounted { public: /// // Return the handler for context menus. If no handler is provided the default diff --git a/include/cef_command_line.h b/include/cef_command_line.h index 96241cf43..5e581b6e0 100644 --- a/include/cef_command_line.h +++ b/include/cef_command_line.h @@ -53,7 +53,7 @@ // used before CefInitialize() is called. /// /*--cef(source=library,no_debugct_check)--*/ -class CefCommandLine : public virtual CefBase { +class CefCommandLine : public virtual CefBaseRefCounted { public: typedef std::vector ArgumentList; typedef std::map SwitchMap; diff --git a/include/cef_context_menu_handler.h b/include/cef_context_menu_handler.h index 2bad463b1..7619b8ed0 100644 --- a/include/cef_context_menu_handler.h +++ b/include/cef_context_menu_handler.h @@ -50,7 +50,7 @@ class CefContextMenuParams; // Callback interface used for continuation of custom context menu display. /// /*--cef(source=library)--*/ -class CefRunContextMenuCallback : public virtual CefBase { +class CefRunContextMenuCallback : public virtual CefBaseRefCounted { public: typedef cef_event_flags_t EventFlags; @@ -74,7 +74,7 @@ class CefRunContextMenuCallback : public virtual CefBase { // class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefContextMenuHandler : public virtual CefBase { +class CefContextMenuHandler : public virtual CefBaseRefCounted { public: typedef cef_event_flags_t EventFlags; @@ -139,7 +139,7 @@ class CefContextMenuHandler : public virtual CefBase { // can only be accessed on browser process the UI thread. /// /*--cef(source=library)--*/ -class CefContextMenuParams : public virtual CefBase { +class CefContextMenuParams : public virtual CefBaseRefCounted { public: typedef cef_context_menu_type_flags_t TypeFlags; typedef cef_context_menu_media_type_t MediaType; diff --git a/include/cef_cookie.h b/include/cef_cookie.h index b4cb33cb5..28f056d8a 100644 --- a/include/cef_cookie.h +++ b/include/cef_cookie.h @@ -51,7 +51,7 @@ class CefDeleteCookiesCallback; // any thread unless otherwise indicated. /// /*--cef(source=library,no_debugct_check)--*/ -class CefCookieManager : public virtual CefBase { +class CefCookieManager : public virtual CefBaseRefCounted { public: /// // Returns the global cookie manager. By default data will be stored at @@ -171,7 +171,7 @@ class CefCookieManager : public virtual CefBase { // will always be called on the IO thread. /// /*--cef(source=client)--*/ -class CefCookieVisitor : public virtual CefBase { +class CefCookieVisitor : public virtual CefBaseRefCounted { public: /// // Method that will be called once for each cookie. |count| is the 0-based @@ -191,7 +191,7 @@ class CefCookieVisitor : public virtual CefBase { // CefCookieManager::SetCookie(). /// /*--cef(source=client)--*/ -class CefSetCookieCallback : public virtual CefBase { +class CefSetCookieCallback : public virtual CefBaseRefCounted { public: /// // Method that will be called upon completion. |success| will be true if the @@ -207,7 +207,7 @@ class CefSetCookieCallback : public virtual CefBase { // CefCookieManager::DeleteCookies(). /// /*--cef(source=client)--*/ -class CefDeleteCookiesCallback : public virtual CefBase { +class CefDeleteCookiesCallback : public virtual CefBaseRefCounted { public: /// // Method that will be called upon completion. |num_deleted| will be the diff --git a/include/cef_dialog_handler.h b/include/cef_dialog_handler.h index 93cd5de7c..3ca98fb51 100644 --- a/include/cef_dialog_handler.h +++ b/include/cef_dialog_handler.h @@ -45,7 +45,7 @@ // Callback interface for asynchronous continuation of file dialog requests. /// /*--cef(source=library)--*/ -class CefFileDialogCallback : public virtual CefBase { +class CefFileDialogCallback : public virtual CefBaseRefCounted { public: /// // Continue the file selection. |selected_accept_filter| should be the 0-based @@ -72,7 +72,7 @@ class CefFileDialogCallback : public virtual CefBase { // will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefDialogHandler : public virtual CefBase { +class CefDialogHandler : public virtual CefBaseRefCounted { public: typedef cef_file_dialog_mode_t FileDialogMode; diff --git a/include/cef_display_handler.h b/include/cef_display_handler.h index 3f0646102..6147cc799 100644 --- a/include/cef_display_handler.h +++ b/include/cef_display_handler.h @@ -47,7 +47,7 @@ // The methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefDisplayHandler : public virtual CefBase { +class CefDisplayHandler : public virtual CefBaseRefCounted { public: /// // Called when a frame's address has changed. diff --git a/include/cef_dom.h b/include/cef_dom.h index 65933b758..f653a074f 100644 --- a/include/cef_dom.h +++ b/include/cef_dom.h @@ -49,7 +49,7 @@ class CefDOMNode; // be called on the render process main thread. /// /*--cef(source=client)--*/ -class CefDOMVisitor : public virtual CefBase { +class CefDOMVisitor : public virtual CefBaseRefCounted { public: /// // Method executed for visiting the DOM. The document object passed to this @@ -68,7 +68,7 @@ class CefDOMVisitor : public virtual CefBase { // be called on the render process main thread thread. /// /*--cef(source=library)--*/ -class CefDOMDocument : public virtual CefBase { +class CefDOMDocument : public virtual CefBaseRefCounted { public: typedef cef_dom_document_type_t Type; @@ -164,7 +164,7 @@ class CefDOMDocument : public virtual CefBase { // called on the render process main thread. /// /*--cef(source=library)--*/ -class CefDOMNode : public virtual CefBase { +class CefDOMNode : public virtual CefBaseRefCounted { public: typedef std::map AttributeMap; typedef cef_dom_node_type_t Type; diff --git a/include/cef_download_handler.h b/include/cef_download_handler.h index 4f58af485..b32c248e5 100644 --- a/include/cef_download_handler.h +++ b/include/cef_download_handler.h @@ -47,7 +47,7 @@ // Callback interface used to asynchronously continue a download. /// /*--cef(source=library)--*/ -class CefBeforeDownloadCallback : public virtual CefBase { +class CefBeforeDownloadCallback : public virtual CefBaseRefCounted { public: /// // Call to continue the download. Set |download_path| to the full file path @@ -64,7 +64,7 @@ class CefBeforeDownloadCallback : public virtual CefBase { // Callback interface used to asynchronously cancel a download. /// /*--cef(source=library)--*/ -class CefDownloadItemCallback : public virtual CefBase { +class CefDownloadItemCallback : public virtual CefBaseRefCounted { public: /// // Call to cancel the download. @@ -91,7 +91,7 @@ class CefDownloadItemCallback : public virtual CefBase { // on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefDownloadHandler : public virtual CefBase { +class CefDownloadHandler : public virtual CefBaseRefCounted { public: /// // Called before a download begins. |suggested_name| is the suggested name for diff --git a/include/cef_download_item.h b/include/cef_download_item.h index 988ef6bde..b0ea797ff 100644 --- a/include/cef_download_item.h +++ b/include/cef_download_item.h @@ -44,7 +44,7 @@ // Class used to represent a download item. /// /*--cef(source=library)--*/ -class CefDownloadItem : public virtual CefBase { +class CefDownloadItem : public virtual CefBaseRefCounted { public: /// // Returns true if this object is valid. Do not call any other methods if this diff --git a/include/cef_drag_data.h b/include/cef_drag_data.h index 8f8094b44..29b85e844 100644 --- a/include/cef_drag_data.h +++ b/include/cef_drag_data.h @@ -47,7 +47,7 @@ // on any thread. /// /*--cef(source=library)--*/ -class CefDragData : public virtual CefBase { +class CefDragData : public virtual CefBaseRefCounted { public: /// // Create a new CefDragData object. diff --git a/include/cef_drag_handler.h b/include/cef_drag_handler.h index 3e26f9755..aee013668 100644 --- a/include/cef_drag_handler.h +++ b/include/cef_drag_handler.h @@ -47,7 +47,7 @@ // this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefDragHandler : public virtual CefBase { +class CefDragHandler : public virtual CefBaseRefCounted { public: typedef cef_drag_operations_mask_t DragOperationsMask; diff --git a/include/cef_find_handler.h b/include/cef_find_handler.h index 410cf5fec..a9cac0a1e 100644 --- a/include/cef_find_handler.h +++ b/include/cef_find_handler.h @@ -46,7 +46,7 @@ // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefFindHandler : public virtual CefBase { +class CefFindHandler : public virtual CefBaseRefCounted { public: /// // Called to report find results returned by CefBrowserHost::Find(). diff --git a/include/cef_focus_handler.h b/include/cef_focus_handler.h index 1d91c42ab..27352fa2b 100644 --- a/include/cef_focus_handler.h +++ b/include/cef_focus_handler.h @@ -48,7 +48,7 @@ // this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefFocusHandler : public virtual CefBase { +class CefFocusHandler : public virtual CefBaseRefCounted { public: typedef cef_focus_source_t FocusSource; diff --git a/include/cef_frame.h b/include/cef_frame.h index 1ea172f1b..bcf680d63 100644 --- a/include/cef_frame.h +++ b/include/cef_frame.h @@ -54,7 +54,7 @@ class CefV8Context; // methods of this class may only be called on the main thread. /// /*--cef(source=library)--*/ -class CefFrame : public virtual CefBase { +class CefFrame : public virtual CefBaseRefCounted { public: /// // True if this object is currently attached to a valid frame. diff --git a/include/cef_geolocation.h b/include/cef_geolocation.h index 69c08779c..32005a430 100644 --- a/include/cef_geolocation.h +++ b/include/cef_geolocation.h @@ -45,7 +45,7 @@ // class will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefGetGeolocationCallback : public virtual CefBase { +class CefGetGeolocationCallback : public virtual CefBaseRefCounted { public: /// // Called with the 'best available' location information or, if the location diff --git a/include/cef_geolocation_handler.h b/include/cef_geolocation_handler.h index dda52834a..b2a722cea 100644 --- a/include/cef_geolocation_handler.h +++ b/include/cef_geolocation_handler.h @@ -46,7 +46,7 @@ // permission requests. /// /*--cef(source=library)--*/ -class CefGeolocationCallback : public virtual CefBase { +class CefGeolocationCallback : public virtual CefBaseRefCounted { public: /// // Call to allow or deny geolocation access. @@ -62,7 +62,7 @@ class CefGeolocationCallback : public virtual CefBase { // thread. /// /*--cef(source=client)--*/ -class CefGeolocationHandler : public virtual CefBase { +class CefGeolocationHandler : public virtual CefBaseRefCounted { public: /// // Called when a page requests permission to access geolocation information. diff --git a/include/cef_image.h b/include/cef_image.h index 170a23758..71f69ab61 100644 --- a/include/cef_image.h +++ b/include/cef_image.h @@ -50,7 +50,7 @@ // be called on the browser process UI thread. /// /*--cef(source=library)--*/ -class CefImage : public virtual CefBase { +class CefImage : public virtual CefBaseRefCounted { public: /// // Create a new CefImage. It will initially be empty. Use the Add*() methods diff --git a/include/cef_jsdialog_handler.h b/include/cef_jsdialog_handler.h index fecaa7f78..4596430cc 100644 --- a/include/cef_jsdialog_handler.h +++ b/include/cef_jsdialog_handler.h @@ -46,7 +46,7 @@ // requests. /// /*--cef(source=library)--*/ -class CefJSDialogCallback : public virtual CefBase { +class CefJSDialogCallback : public virtual CefBaseRefCounted { public: /// // Continue the JS dialog request. Set |success| to true if the OK button was @@ -63,7 +63,7 @@ class CefJSDialogCallback : public virtual CefBase { // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefJSDialogHandler : public virtual CefBase { +class CefJSDialogHandler : public virtual CefBaseRefCounted { public: typedef cef_jsdialog_type_t JSDialogType; diff --git a/include/cef_keyboard_handler.h b/include/cef_keyboard_handler.h index 0346aa4ac..cd4c4d0ef 100644 --- a/include/cef_keyboard_handler.h +++ b/include/cef_keyboard_handler.h @@ -46,7 +46,7 @@ // methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefKeyboardHandler : public virtual CefBase { +class CefKeyboardHandler : public virtual CefBaseRefCounted { public: /// // Called before a keyboard event is sent to the renderer. |event| contains diff --git a/include/cef_life_span_handler.h b/include/cef_life_span_handler.h index 6967e3e8e..b1acc4d7c 100644 --- a/include/cef_life_span_handler.h +++ b/include/cef_life_span_handler.h @@ -49,7 +49,7 @@ class CefClient; // indicated. /// /*--cef(source=client)--*/ -class CefLifeSpanHandler : public virtual CefBase { +class CefLifeSpanHandler : public virtual CefBaseRefCounted { public: typedef cef_window_open_disposition_t WindowOpenDisposition; diff --git a/include/cef_load_handler.h b/include/cef_load_handler.h index 1494a844b..99696ed89 100644 --- a/include/cef_load_handler.h +++ b/include/cef_load_handler.h @@ -48,7 +48,7 @@ // render process main thread (TID_RENDERER). /// /*--cef(source=client)--*/ -class CefLoadHandler : public virtual CefBase { +class CefLoadHandler : public virtual CefBaseRefCounted { public: typedef cef_errorcode_t ErrorCode; typedef cef_transition_type_t TransitionType; diff --git a/include/cef_menu_model.h b/include/cef_menu_model.h index beb95fb75..b2606a8da 100644 --- a/include/cef_menu_model.h +++ b/include/cef_menu_model.h @@ -48,7 +48,7 @@ // this class can only be accessed on the browser process the UI thread. /// /*--cef(source=library)--*/ -class CefMenuModel : public virtual CefBase { +class CefMenuModel : public virtual CefBaseRefCounted { public: typedef cef_menu_item_type_t MenuItemType; diff --git a/include/cef_menu_model_delegate.h b/include/cef_menu_model_delegate.h index 84ebae18e..aa23ffcb5 100644 --- a/include/cef_menu_model_delegate.h +++ b/include/cef_menu_model_delegate.h @@ -48,7 +48,7 @@ class CefMenuModel; // indicated. /// /*--cef(source=client)--*/ -class CefMenuModelDelegate : public virtual CefBase { +class CefMenuModelDelegate : public virtual CefBaseRefCounted { public: /// // Perform the action associated with the specified |command_id| and diff --git a/include/cef_navigation_entry.h b/include/cef_navigation_entry.h index 6dc3a4c57..9c86a338a 100644 --- a/include/cef_navigation_entry.h +++ b/include/cef_navigation_entry.h @@ -45,7 +45,7 @@ // Class used to represent an entry in navigation history. /// /*--cef(source=library)--*/ -class CefNavigationEntry : public virtual CefBase { +class CefNavigationEntry : public virtual CefBaseRefCounted { public: typedef cef_transition_type_t TransitionType; diff --git a/include/cef_print_handler.h b/include/cef_print_handler.h index cac16244b..50519c4fe 100644 --- a/include/cef_print_handler.h +++ b/include/cef_print_handler.h @@ -46,7 +46,7 @@ // Callback interface for asynchronous continuation of print dialog requests. /// /*--cef(source=library)--*/ -class CefPrintDialogCallback : public virtual CefBase { +class CefPrintDialogCallback : public virtual CefBaseRefCounted { public: /// // Continue printing with the specified |settings|. @@ -65,7 +65,7 @@ class CefPrintDialogCallback : public virtual CefBase { // Callback interface for asynchronous continuation of print job requests. /// /*--cef(source=library)--*/ -class CefPrintJobCallback : public virtual CefBase { +class CefPrintJobCallback : public virtual CefBaseRefCounted { public: /// // Indicate completion of the print job. @@ -80,7 +80,7 @@ class CefPrintJobCallback : public virtual CefBase { // class will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefPrintHandler : public virtual CefBase { +class CefPrintHandler : public virtual CefBaseRefCounted { public: /// // Called when printing has started for the specified |browser|. This method diff --git a/include/cef_print_settings.h b/include/cef_print_settings.h index 709d36b39..0fe2a0ba0 100644 --- a/include/cef_print_settings.h +++ b/include/cef_print_settings.h @@ -46,7 +46,7 @@ // Class representing print settings. /// /*--cef(source=library)--*/ -class CefPrintSettings : public virtual CefBase { +class CefPrintSettings : public virtual CefBaseRefCounted { public: typedef cef_color_model_t ColorModel; typedef cef_duplex_mode_t DuplexMode; diff --git a/include/cef_process_message.h b/include/cef_process_message.h index 1e27bd681..a6b6a18aa 100644 --- a/include/cef_process_message.h +++ b/include/cef_process_message.h @@ -47,7 +47,7 @@ typedef cef_process_id_t CefProcessId; // Class representing a message. Can be used on any process and thread. /// /*--cef(source=library)--*/ -class CefProcessMessage : public virtual CefBase { +class CefProcessMessage : public virtual CefBaseRefCounted { public: /// // Create a new CefProcessMessage object with the specified name. diff --git a/include/cef_render_handler.h b/include/cef_render_handler.h index 0f857b07d..9c253535e 100644 --- a/include/cef_render_handler.h +++ b/include/cef_render_handler.h @@ -49,7 +49,7 @@ // The methods of this class will be called on the UI thread. /// /*--cef(source=client)--*/ -class CefRenderHandler : public virtual CefBase { +class CefRenderHandler : public virtual CefBaseRefCounted { public: typedef cef_cursor_type_t CursorType; typedef cef_drag_operations_mask_t DragOperation; diff --git a/include/cef_render_process_handler.h b/include/cef_render_process_handler.h index 98ab391bc..ecf6fc59e 100644 --- a/include/cef_render_process_handler.h +++ b/include/cef_render_process_handler.h @@ -53,7 +53,7 @@ // otherwise indicated. /// /*--cef(source=client)--*/ -class CefRenderProcessHandler : public virtual CefBase { +class CefRenderProcessHandler : public virtual CefBaseRefCounted { public: typedef cef_navigation_type_t NavigationType; diff --git a/include/cef_request.h b/include/cef_request.h index a4626aa02..8d48f41d9 100644 --- a/include/cef_request.h +++ b/include/cef_request.h @@ -50,7 +50,7 @@ class CefPostDataElement; // called on any thread. /// /*--cef(source=library,no_debugct_check)--*/ -class CefRequest : public virtual CefBase { +class CefRequest : public virtual CefBaseRefCounted { public: typedef std::multimap HeaderMap; typedef cef_referrer_policy_t ReferrerPolicy; @@ -207,7 +207,7 @@ class CefRequest : public virtual CefBase { // class may be called on any thread. /// /*--cef(source=library,no_debugct_check)--*/ -class CefPostData : public virtual CefBase { +class CefPostData : public virtual CefBaseRefCounted { public: typedef std::vector > ElementVector; @@ -270,7 +270,7 @@ class CefPostData : public virtual CefBase { // methods of this class may be called on any thread. /// /*--cef(source=library,no_debugct_check)--*/ -class CefPostDataElement : public virtual CefBase { +class CefPostDataElement : public virtual CefBaseRefCounted { public: /// // Post data elements may represent either bytes or files. diff --git a/include/cef_request_context.h b/include/cef_request_context.h index 8892d5f7f..3f6d8fd4c 100644 --- a/include/cef_request_context.h +++ b/include/cef_request_context.h @@ -52,7 +52,7 @@ class CefSchemeHandlerFactory; // Callback interface for CefRequestContext::ResolveHost. /// /*--cef(source=client)--*/ -class CefResolveCallback : public virtual CefBase { +class CefResolveCallback : public virtual CefBaseRefCounted { public: /// // Called after the ResolveHost request has completed. |result| will be the @@ -83,7 +83,7 @@ class CefResolveCallback : public virtual CefBase { // all other request context objects will be ignored. /// /*--cef(source=library,no_debugct_check)--*/ -class CefRequestContext : public virtual CefBase { +class CefRequestContext : public virtual CefBaseRefCounted { public: /// // Returns the global context object. diff --git a/include/cef_request_context_handler.h b/include/cef_request_context_handler.h index 6996d9ede..26864e88b 100644 --- a/include/cef_request_context_handler.h +++ b/include/cef_request_context_handler.h @@ -48,7 +48,7 @@ // been destroyed. /// /*--cef(source=client,no_debugct_check)--*/ -class CefRequestContextHandler : public virtual CefBase { +class CefRequestContextHandler : public virtual CefBaseRefCounted { public: typedef cef_plugin_policy_t PluginPolicy; diff --git a/include/cef_request_handler.h b/include/cef_request_handler.h index 69334397a..c44a3dfaa 100644 --- a/include/cef_request_handler.h +++ b/include/cef_request_handler.h @@ -55,7 +55,7 @@ // Callback interface used for asynchronous continuation of url requests. /// /*--cef(source=library)--*/ -class CefRequestCallback : public virtual CefBase { +class CefRequestCallback : public virtual CefBaseRefCounted { public: /// // Continue the url request. If |allow| is true the request will be continued. @@ -76,7 +76,7 @@ class CefRequestCallback : public virtual CefBase { // Callback interface used to select a client certificate for authentication. /// /*--cef(source=library)--*/ -class CefSelectClientCertificateCallback : public virtual CefBase { +class CefSelectClientCertificateCallback : public virtual CefBaseRefCounted { public: /// // Chooses the specified certificate for client certificate authentication. @@ -92,7 +92,7 @@ class CefSelectClientCertificateCallback : public virtual CefBase { // methods of this class will be called on the thread indicated. /// /*--cef(source=client)--*/ -class CefRequestHandler : public virtual CefBase { +class CefRequestHandler : public virtual CefBaseRefCounted { public: typedef cef_return_value_t ReturnValue; typedef cef_termination_status_t TerminationStatus; diff --git a/include/cef_resource_bundle.h b/include/cef_resource_bundle.h index 3b064ffec..3fda8998e 100644 --- a/include/cef_resource_bundle.h +++ b/include/cef_resource_bundle.h @@ -48,7 +48,7 @@ // on any thread unless otherwise indicated. /// /*--cef(source=library,no_debugct_check)--*/ -class CefResourceBundle : public virtual CefBase { +class CefResourceBundle : public virtual CefBaseRefCounted { public: typedef cef_scale_factor_t ScaleFactor; diff --git a/include/cef_resource_bundle_handler.h b/include/cef_resource_bundle_handler.h index afc46da74..932ef9f5b 100644 --- a/include/cef_resource_bundle_handler.h +++ b/include/cef_resource_bundle_handler.h @@ -46,7 +46,7 @@ // this class may be called on multiple threads. /// /*--cef(source=client)--*/ -class CefResourceBundleHandler : public virtual CefBase { +class CefResourceBundleHandler : public virtual CefBaseRefCounted { public: typedef cef_scale_factor_t ScaleFactor; diff --git a/include/cef_resource_handler.h b/include/cef_resource_handler.h index 19913c756..abe7196dc 100644 --- a/include/cef_resource_handler.h +++ b/include/cef_resource_handler.h @@ -50,7 +50,7 @@ // this class will always be called on the IO thread. /// /*--cef(source=client)--*/ -class CefResourceHandler : public virtual CefBase { +class CefResourceHandler : public virtual CefBaseRefCounted { public: /// // Begin processing the request. To handle the request return true and call diff --git a/include/cef_response.h b/include/cef_response.h index 6fcb4e236..cd7356efd 100644 --- a/include/cef_response.h +++ b/include/cef_response.h @@ -46,7 +46,7 @@ // called on any thread. /// /*--cef(source=library,no_debugct_check)--*/ -class CefResponse : public virtual CefBase { +class CefResponse : public virtual CefBaseRefCounted { public: typedef std::multimap HeaderMap; diff --git a/include/cef_response_filter.h b/include/cef_response_filter.h index 55e667770..58c978ea1 100644 --- a/include/cef_response_filter.h +++ b/include/cef_response_filter.h @@ -45,7 +45,7 @@ // this class will be called on the browser process IO thread. /// /*--cef(source=client)--*/ -class CefResponseFilter : public virtual CefBase { +class CefResponseFilter : public virtual CefBaseRefCounted { public: typedef cef_response_filter_status_t FilterStatus; diff --git a/include/cef_scheme.h b/include/cef_scheme.h index 5861d85b1..d4b1ac0c5 100644 --- a/include/cef_scheme.h +++ b/include/cef_scheme.h @@ -154,7 +154,7 @@ class CefSchemeRegistrar : public CefBaseScoped { // The methods of this class will always be called on the IO thread. /// /*--cef(source=client)--*/ -class CefSchemeHandlerFactory : public virtual CefBase { +class CefSchemeHandlerFactory : public virtual CefBaseRefCounted { public: /// // Return a new resource handler instance to handle the request or an empty diff --git a/include/cef_ssl_info.h b/include/cef_ssl_info.h index 732171889..db075cabc 100644 --- a/include/cef_ssl_info.h +++ b/include/cef_ssl_info.h @@ -47,7 +47,7 @@ // Class representing SSL information. /// /*--cef(source=library)--*/ -class CefSSLInfo : public virtual CefBase { +class CefSSLInfo : public virtual CefBaseRefCounted { public: /// // Returns a bitmask containing any and all problems verifying the server diff --git a/include/cef_ssl_status.h b/include/cef_ssl_status.h index 614a607d5..3a5f39501 100644 --- a/include/cef_ssl_status.h +++ b/include/cef_ssl_status.h @@ -46,7 +46,7 @@ // Class representing the SSL information for a navigation entry. /// /*--cef(source=library)--*/ -class CefSSLStatus : public virtual CefBase { +class CefSSLStatus : public virtual CefBaseRefCounted { public: /// // Returns true if the status is related to a secure SSL/TLS connection. diff --git a/include/cef_stream.h b/include/cef_stream.h index 3d0633c25..81b0b9164 100644 --- a/include/cef_stream.h +++ b/include/cef_stream.h @@ -44,7 +44,7 @@ // methods of this class may be called on any thread. /// /*--cef(source=client)--*/ -class CefReadHandler : public virtual CefBase { +class CefReadHandler : public virtual CefBaseRefCounted { public: /// // Read raw binary data. @@ -87,7 +87,7 @@ class CefReadHandler : public virtual CefBase { // called on any thread. /// /*--cef(source=library)--*/ -class CefStreamReader : public virtual CefBase { +class CefStreamReader : public virtual CefBaseRefCounted { public: /// // Create a new CefStreamReader object from a file. @@ -147,7 +147,7 @@ class CefStreamReader : public virtual CefBase { // methods of this class may be called on any thread. /// /*--cef(source=client)--*/ -class CefWriteHandler : public virtual CefBase { +class CefWriteHandler : public virtual CefBaseRefCounted { public: /// // Write raw binary data. @@ -190,7 +190,7 @@ class CefWriteHandler : public virtual CefBase { // on any thread. /// /*--cef(source=library)--*/ -class CefStreamWriter : public virtual CefBase { +class CefStreamWriter : public virtual CefBaseRefCounted { public: /// // Create a new CefStreamWriter object for a file. diff --git a/include/cef_string_visitor.h b/include/cef_string_visitor.h index 549371473..36a97ba35 100644 --- a/include/cef_string_visitor.h +++ b/include/cef_string_visitor.h @@ -43,7 +43,7 @@ // Implement this interface to receive string values asynchronously. /// /*--cef(source=client)--*/ -class CefStringVisitor : public virtual CefBase { +class CefStringVisitor : public virtual CefBaseRefCounted { public: /// // Method that will be executed. diff --git a/include/cef_task.h b/include/cef_task.h index 0ecaa7526..ea3b2d96b 100644 --- a/include/cef_task.h +++ b/include/cef_task.h @@ -50,7 +50,7 @@ typedef cef_thread_id_t CefThreadId; // task object destructor. /// /*--cef(source=client)--*/ -class CefTask : public virtual CefBase { +class CefTask : public virtual CefBaseRefCounted { public: /// // Method that will be executed on the target thread. @@ -69,7 +69,7 @@ class CefTask : public virtual CefBase { // other CEF threads as appropriate (for example, V8 WebWorker threads). /// /*--cef(source=library)--*/ -class CefTaskRunner : public virtual CefBase { +class CefTaskRunner : public virtual CefBaseRefCounted { public: /// // Returns the task runner for the current thread. Only CEF threads will have diff --git a/include/cef_thread.h b/include/cef_thread.h index a0e78c493..dfe652d2e 100644 --- a/include/cef_thread.h +++ b/include/cef_thread.h @@ -53,7 +53,7 @@ // see cef_task.h for details. /// /*--cef(source=library)--*/ -class CefThread : public CefBase { +class CefThread : public CefBaseRefCounted { public: /// // Create and start a new thread. This method does not block waiting for the diff --git a/include/cef_trace.h b/include/cef_trace.h index 5b977c6e5..fa7f62781 100644 --- a/include/cef_trace.h +++ b/include/cef_trace.h @@ -49,7 +49,7 @@ // The methods of this class will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefEndTracingCallback : public virtual CefBase { +class CefEndTracingCallback : public virtual CefBaseRefCounted { public: /// // Called after all processes have sent their trace data. |tracing_file| is diff --git a/include/cef_urlrequest.h b/include/cef_urlrequest.h index 5b58b6349..23bc821ec 100644 --- a/include/cef_urlrequest.h +++ b/include/cef_urlrequest.h @@ -54,7 +54,7 @@ class CefURLRequestClient; // on the same thread that created it. /// /*--cef(source=library)--*/ -class CefURLRequest : public virtual CefBase { +class CefURLRequest : public virtual CefBaseRefCounted { public: typedef cef_urlrequest_status_t Status; typedef cef_errorcode_t ErrorCode; @@ -127,7 +127,7 @@ class CefURLRequest : public virtual CefBase { // request unless otherwise documented. /// /*--cef(source=client)--*/ -class CefURLRequestClient : public virtual CefBase { +class CefURLRequestClient : public virtual CefBaseRefCounted { public: /// // Notifies the client that the request has completed. Use the diff --git a/include/cef_v8.h b/include/cef_v8.h index f33090a46..2ec4feb8e 100644 --- a/include/cef_v8.h +++ b/include/cef_v8.h @@ -124,7 +124,7 @@ bool CefRegisterExtension(const CefString& extension_name, // the CefV8Context::GetTaskRunner() method. /// /*--cef(source=library)--*/ -class CefV8Context : public virtual CefBase { +class CefV8Context : public virtual CefBaseRefCounted { public: /// // Returns the current (top) context object in the V8 context stack. @@ -229,7 +229,7 @@ typedef std::vector > CefV8ValueList; // of this class will be called on the thread associated with the V8 function. /// /*--cef(source=client)--*/ -class CefV8Handler : public virtual CefBase { +class CefV8Handler : public virtual CefBaseRefCounted { public: /// // Handle execution of the function identified by |name|. |object| is the @@ -252,7 +252,7 @@ class CefV8Handler : public virtual CefBase { // of this class will be called on the thread associated with the V8 accessor. /// /*--cef(source=client)--*/ -class CefV8Accessor : public virtual CefBase { +class CefV8Accessor : public virtual CefBaseRefCounted { public: /// // Handle retrieval the accessor value identified by |name|. |object| is the @@ -290,7 +290,7 @@ class CefV8Accessor : public virtual CefBase { // by integer. /// /*--cef(source=client)--*/ -class CefV8Interceptor : public virtual CefBase { +class CefV8Interceptor : public virtual CefBaseRefCounted { public: /// // Handle retrieval of the interceptor value identified by |name|. |object| is @@ -354,7 +354,7 @@ public: // any render process thread. /// /*--cef(source=library)--*/ -class CefV8Exception : public virtual CefBase { +class CefV8Exception : public virtual CefBaseRefCounted { public: /// // Returns the exception message. @@ -419,7 +419,7 @@ class CefV8Exception : public virtual CefBase { // the CefV8Context::GetTaskRunner() method. /// /*--cef(source=library)--*/ -class CefV8Value : public virtual CefBase { +class CefV8Value : public virtual CefBaseRefCounted { public: typedef cef_v8_accesscontrol_t AccessControl; typedef cef_v8_propertyattribute_t PropertyAttribute; @@ -759,13 +759,13 @@ class CefV8Value : public virtual CefBase { // on user created objects. /// /*--cef(optional_param=user_data)--*/ - virtual bool SetUserData(CefRefPtr user_data) =0; + virtual bool SetUserData(CefRefPtr user_data) =0; /// // Returns the user data, if any, assigned to this object. /// /*--cef()--*/ - virtual CefRefPtr GetUserData() =0; + virtual CefRefPtr GetUserData() =0; /// // Returns the amount of externally allocated memory registered for the @@ -850,7 +850,7 @@ class CefV8Value : public virtual CefBase { // retrieved via the CefV8Context::GetTaskRunner() method. /// /*--cef(source=library)--*/ -class CefV8StackTrace : public virtual CefBase { +class CefV8StackTrace : public virtual CefBaseRefCounted { public: /// // Returns the stack trace for the currently active context. |frame_limit| is @@ -888,7 +888,7 @@ class CefV8StackTrace : public virtual CefBase { // retrieved via the CefV8Context::GetTaskRunner() method. /// /*--cef(source=library)--*/ -class CefV8StackFrame : public virtual CefBase { +class CefV8StackFrame : public virtual CefBaseRefCounted { public: /// // Returns true if the underlying handle is valid and it can be accessed on diff --git a/include/cef_values.h b/include/cef_values.h index 86fa40ef6..6bbd1e27d 100644 --- a/include/cef_values.h +++ b/include/cef_values.h @@ -53,7 +53,7 @@ typedef cef_value_type_t CefValueType; // process and thread. /// /*--cef(source=library)--*/ -class CefValue : public virtual CefBase { +class CefValue : public virtual CefBaseRefCounted { public: /// // Creates a new object. @@ -234,7 +234,7 @@ class CefValue : public virtual CefBase { // Class representing a binary value. Can be used on any process and thread. /// /*--cef(source=library)--*/ -class CefBinaryValue : public virtual CefBase { +class CefBinaryValue : public virtual CefBaseRefCounted { public: /// // Creates a new object that is not owned by any other object. The specified @@ -300,7 +300,7 @@ class CefBinaryValue : public virtual CefBase { // Class representing a dictionary value. Can be used on any process and thread. /// /*--cef(source=library)--*/ -class CefDictionaryValue : public virtual CefBase { +class CefDictionaryValue : public virtual CefBaseRefCounted { public: typedef std::vector KeyList; @@ -533,7 +533,7 @@ class CefDictionaryValue : public virtual CefBase { // Class representing a list value. Can be used on any process and thread. /// /*--cef(source=library)--*/ -class CefListValue : public virtual CefBase { +class CefListValue : public virtual CefBaseRefCounted { public: /// // Creates a new object that is not owned by any other object. diff --git a/include/cef_waitable_event.h b/include/cef_waitable_event.h index 4a4e9950c..070ca6813 100644 --- a/include/cef_waitable_event.h +++ b/include/cef_waitable_event.h @@ -52,7 +52,7 @@ // process UI or IO threads. /// /*--cef(source=library)--*/ -class CefWaitableEvent : public CefBase { +class CefWaitableEvent : public CefBaseRefCounted { public: /// // Create a new waitable event. If |automatic_reset| is true then the event diff --git a/include/cef_web_plugin.h b/include/cef_web_plugin.h index 731be7b94..3eea54130 100644 --- a/include/cef_web_plugin.h +++ b/include/cef_web_plugin.h @@ -45,7 +45,7 @@ class CefBrowser; // Information about a specific web plugin. /// /*--cef(source=library)--*/ -class CefWebPluginInfo : public virtual CefBase { +class CefWebPluginInfo : public virtual CefBaseRefCounted { public: /// // Returns the plugin name (i.e. Flash). @@ -77,7 +77,7 @@ class CefWebPluginInfo : public virtual CefBase { // this class will be called on the browser process UI thread. /// /*--cef(source=client)--*/ -class CefWebPluginInfoVisitor : public virtual CefBase { +class CefWebPluginInfoVisitor : public virtual CefBaseRefCounted { public: /// // Method that will be called once for each plugin. |count| is the 0-based @@ -124,7 +124,7 @@ void CefRegisterWebPluginCrash(const CefString& path); // of this class will be called on the browser process IO thread. /// /*--cef(source=client)--*/ -class CefWebPluginUnstableCallback : public virtual CefBase { +class CefWebPluginUnstableCallback : public virtual CefBaseRefCounted { public: /// // Method that will be called for the requested plugin. |unstable| will be @@ -150,7 +150,7 @@ void CefIsWebPluginUnstable(const CefString& path, // UI thread. /// /*--cef(source=client)--*/ -class CefRegisterCdmCallback : public virtual CefBase { +class CefRegisterCdmCallback : public virtual CefBaseRefCounted { public: /// // Method that will be called when CDM registration is complete. |result| diff --git a/include/cef_x509_certificate.h b/include/cef_x509_certificate.h index f036ab5ed..c784ce1b0 100644 --- a/include/cef_x509_certificate.h +++ b/include/cef_x509_certificate.h @@ -47,7 +47,7 @@ // Class representing the issuer or subject field of an X.509 certificate. /// /*--cef(source=library)--*/ -class CefX509CertPrincipal : public virtual CefBase { +class CefX509CertPrincipal : public virtual CefBaseRefCounted { public: /// // Returns a name that can be used to represent the issuer. It tries in this @@ -110,7 +110,7 @@ class CefX509CertPrincipal : public virtual CefBase { // Class representing a X.509 certificate. /// /*--cef(source=library)--*/ -class CefX509Certificate : public virtual CefBase { +class CefX509Certificate : public virtual CefBaseRefCounted { public: typedef std::vector > IssuerChainBinaryList; diff --git a/include/cef_xml_reader.h b/include/cef_xml_reader.h index 86be8bac7..ab5244e34 100644 --- a/include/cef_xml_reader.h +++ b/include/cef_xml_reader.h @@ -47,7 +47,7 @@ // the object. /// /*--cef(source=library)--*/ -class CefXmlReader : public virtual CefBase { +class CefXmlReader : public virtual CefBaseRefCounted { public: typedef cef_xml_encoding_type_t EncodingType; typedef cef_xml_node_type_t NodeType; diff --git a/include/cef_zip_reader.h b/include/cef_zip_reader.h index 5d8788e94..80640087f 100644 --- a/include/cef_zip_reader.h +++ b/include/cef_zip_reader.h @@ -46,7 +46,7 @@ // the object. /// /*--cef(source=library)--*/ -class CefZipReader : public virtual CefBase { +class CefZipReader : public virtual CefBaseRefCounted { public: /// // Create a new CefZipReader object. The returned object's methods can only diff --git a/include/internal/cef_ptr.h b/include/internal/cef_ptr.h index 7874699f5..25ce74557 100644 --- a/include/internal/cef_ptr.h +++ b/include/internal/cef_ptr.h @@ -50,7 +50,7 @@ // avoid common memory leaks caused by forgetting to Release an object // reference. Sample usage: //
-//   class MyFoo : public CefBase {
+//   class MyFoo : public CefBaseRefCounted {
 //    ...
 //   };
 //
diff --git a/include/test/cef_translator_test.h b/include/test/cef_translator_test.h
index 9c5d4288d..be27652b1 100644
--- a/include/test/cef_translator_test.h
+++ b/include/test/cef_translator_test.h
@@ -84,7 +84,7 @@ class CefTranslatorTestScopedLibraryChild;
 // Class for testing all of the possible data transfer types.
 ///
 /*--cef(source=library,no_debugct_check)--*/
-class CefTranslatorTest : public CefBase {
+class CefTranslatorTest : public CefBaseRefCounted {
  public:
   ///
   // Create the test object.
@@ -611,7 +611,7 @@ class CefTranslatorTest : public CefBase {
 // Library-side test object for RefPtr.
 ///
 /*--cef(source=library,no_debugct_check)--*/
-class CefTranslatorTestRefPtrLibrary : public CefBase {
+class CefTranslatorTestRefPtrLibrary : public CefBaseRefCounted {
  public:
   ///
   // Create the test object.
@@ -693,7 +693,7 @@ class CefTranslatorTestRefPtrLibraryChildChild :
 // Client-side test object for RefPtr.
 ///
 /*--cef(source=client,no_debugct_check)--*/
-class CefTranslatorTestRefPtrClient : public virtual CefBase {
+class CefTranslatorTestRefPtrClient : public virtual CefBaseRefCounted {
  public:
   ///
   // Return a value.
diff --git a/include/views/cef_display.h b/include/views/cef_display.h
index d9da06029..e3a84561d 100644
--- a/include/views/cef_display.h
+++ b/include/views/cef_display.h
@@ -51,7 +51,7 @@
 // indicated.
 ///
 /*--cef(source=library)--*/
-class CefDisplay : public CefBase {
+class CefDisplay : public CefBaseRefCounted {
  public:
   ///
   // Returns the primary Display.
diff --git a/include/views/cef_layout.h b/include/views/cef_layout.h
index d820a2753..5f1fcf4ef 100644
--- a/include/views/cef_layout.h
+++ b/include/views/cef_layout.h
@@ -49,7 +49,7 @@ class CefFillLayout;
 // process UI thread unless otherwise indicated.
 ///
 /*--cef(source=library)--*/
-class CefLayout : public CefBase {
+class CefLayout : public CefBaseRefCounted {
  public:
   ///
   // Returns this Layout as a BoxLayout or NULL if this is not a BoxLayout.
diff --git a/include/views/cef_view.h b/include/views/cef_view.h
index b6f321e01..d694ec516 100644
--- a/include/views/cef_view.h
+++ b/include/views/cef_view.h
@@ -54,7 +54,7 @@ class CefWindow;
 // process UI thread unless otherwise indicated.
 ///
 /*--cef(source=library)--*/
-class CefView : public CefBase {
+class CefView : public CefBaseRefCounted {
  public:
   ///
   // Returns this View as a BrowserView or NULL if this is not a BrowserView.
diff --git a/include/views/cef_view_delegate.h b/include/views/cef_view_delegate.h
index 70fd176c5..1bfc7bb1f 100644
--- a/include/views/cef_view_delegate.h
+++ b/include/views/cef_view_delegate.h
@@ -47,7 +47,7 @@ class CefView;
 // will be called on the browser process UI thread unless otherwise indicated.
 ///
 /*--cef(source=client)--*/
-class CefViewDelegate : public virtual CefBase {
+class CefViewDelegate : public virtual CefBaseRefCounted {
  public:
   ///
   // Return the preferred size for |view|. The Layout will use this information
diff --git a/include/wrapper/cef_byte_read_handler.h b/include/wrapper/cef_byte_read_handler.h
index 559cdd818..bf593d0ab 100644
--- a/include/wrapper/cef_byte_read_handler.h
+++ b/include/wrapper/cef_byte_read_handler.h
@@ -55,7 +55,7 @@ class CefByteReadHandler : public CefReadHandler {
   ///
   CefByteReadHandler(const unsigned char* bytes,
                      size_t size,
-                     CefRefPtr source);
+                     CefRefPtr source);
 
   // CefReadHandler methods.
   virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE;
@@ -68,7 +68,7 @@ class CefByteReadHandler : public CefReadHandler {
   const unsigned char* bytes_;
   int64 size_;
   int64 offset_;
-  CefRefPtr source_;
+  CefRefPtr source_;
 
   base::Lock lock_;
 
diff --git a/include/wrapper/cef_closure_task.h b/include/wrapper/cef_closure_task.h
index 8828c6566..d9b559b6f 100644
--- a/include/wrapper/cef_closure_task.h
+++ b/include/wrapper/cef_closure_task.h
@@ -64,7 +64,7 @@
 // Example of executing a bound method:
 //
 // // Define a class.
-// class MyClass : public CefBase {
+// class MyClass : public CefBaseRefCounted {
 //  public:
 //   MyClass() {}
 //   void MyMethod(int arg) { /* do something with |arg| on the UI thread */ }
diff --git a/include/wrapper/cef_message_router.h b/include/wrapper/cef_message_router.h
index 2a6fcfe6f..23510ddcb 100644
--- a/include/wrapper/cef_message_router.h
+++ b/include/wrapper/cef_message_router.h
@@ -223,7 +223,7 @@ class CefMessageRouterBrowserSide :
   // the callback methods. The methods of this class may be called on any
   // browser process thread.
   ///
-  class Callback : public CefBase {
+  class Callback : public CefBaseRefCounted {
    public:
     ///
     // Notify the associated JavaScript onSuccess callback that the query has
diff --git a/include/wrapper/cef_zip_archive.h b/include/wrapper/cef_zip_archive.h
index 7ad10bda8..5de0960fc 100644
--- a/include/wrapper/cef_zip_archive.h
+++ b/include/wrapper/cef_zip_archive.h
@@ -62,7 +62,7 @@ class CefZipArchive : public base::RefCountedThreadSafe {
   // Class representing a file in the archive. Accessing the file data from
   // multiple threads is safe provided a reference to the File object is kept.
   ///
-  class File : public CefBase {
+  class File : public CefBaseRefCounted {
    public:
     ///
     // Returns the read-only data contained in the file.
diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h
index 55ad08c73..ddd03c18a 100644
--- a/libcef/browser/browser_host_impl.h
+++ b/libcef/browser/browser_host_impl.h
@@ -78,7 +78,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
                            public content::NotificationObserver {
  public:
   // Used for handling the response to command messages.
-  class CommandResponseHandler : public virtual CefBase {
+  class CommandResponseHandler : public virtual CefBaseRefCounted {
    public:
      virtual void OnResponse(const std::string& response) =0;
   };
diff --git a/libcef/common/response_manager.h b/libcef/common/response_manager.h
index ee383cc83..08baefc9c 100644
--- a/libcef/common/response_manager.h
+++ b/libcef/common/response_manager.h
@@ -16,13 +16,13 @@ struct Cef_Response_Params;
 class CefResponseManager : base::NonThreadSafe {
  public:
   // Used for handling response messages.
-  class Handler : public virtual CefBase {
+  class Handler : public virtual CefBaseRefCounted {
    public:
      virtual void OnResponse(const Cef_Response_Params& params) =0;
   };
 
   // Used for handling response ack messages.
-  class AckHandler : public virtual CefBase {
+  class AckHandler : public virtual CefBaseRefCounted {
    public:
      virtual void OnResponseAck() =0;
   };
diff --git a/libcef/common/tracker.h b/libcef/common/tracker.h
index cf6f8b8c6..a165ef857 100644
--- a/libcef/common/tracker.h
+++ b/libcef/common/tracker.h
@@ -48,7 +48,7 @@ class CefTrackNode {
 // manager object is destroyed.  A manager object can be created as either a
 // member variable of another class or by using lazy initialization:
 // base::LazyInstance g_singleton = LAZY_INSTANCE_INITIALIZER;
-class CefTrackManager : public CefBase {
+class CefTrackManager : public CefBaseRefCounted {
  public:
   CefTrackManager();
   ~CefTrackManager() override;
diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc
index 825e58812..32c4d6d86 100644
--- a/libcef/renderer/v8_impl.cc
+++ b/libcef/renderer/v8_impl.cc
@@ -353,11 +353,11 @@ class V8TrackObject : public CefTrackNode {
     return handler_;
   }
 
-  inline void SetUserData(CefRefPtr user_data) {
+  inline void SetUserData(CefRefPtr user_data) {
     user_data_ = user_data;
   }
 
-  inline CefRefPtr GetUserData() {
+  inline CefRefPtr GetUserData() {
     return user_data_;
   }
 
@@ -383,7 +383,7 @@ class V8TrackObject : public CefTrackNode {
   CefRefPtr accessor_;
   CefRefPtr interceptor_;
   CefRefPtr handler_;
-  CefRefPtr user_data_;
+  CefRefPtr user_data_;
   int external_memory_;
 };
 
@@ -2094,7 +2094,7 @@ bool CefV8ValueImpl::GetKeys(std::vector& keys) {
   return true;
 }
 
-bool CefV8ValueImpl::SetUserData(CefRefPtr user_data) {
+bool CefV8ValueImpl::SetUserData(CefRefPtr user_data) {
   CEF_V8_REQUIRE_OBJECT_RETURN(false);
 
   v8::Isolate* isolate = handle_->isolate();
@@ -2118,7 +2118,7 @@ bool CefV8ValueImpl::SetUserData(CefRefPtr user_data) {
   return false;
 }
 
-CefRefPtr CefV8ValueImpl::GetUserData() {
+CefRefPtr CefV8ValueImpl::GetUserData() {
   CEF_V8_REQUIRE_OBJECT_RETURN(NULL);
 
   v8::Isolate* isolate = handle_->isolate();
diff --git a/libcef/renderer/v8_impl.h b/libcef/renderer/v8_impl.h
index 433ebaaf7..b9f7746e4 100644
--- a/libcef/renderer/v8_impl.h
+++ b/libcef/renderer/v8_impl.h
@@ -264,8 +264,8 @@ class CefV8ValueImpl : public CefV8Value {
   bool SetValue(const CefString& key, AccessControl settings,
                 PropertyAttribute attribute) override;
   bool GetKeys(std::vector& keys) override;
-  bool SetUserData(CefRefPtr user_data) override;
-  CefRefPtr GetUserData() override;
+  bool SetUserData(CefRefPtr user_data) override;
+  CefRefPtr GetUserData() override;
   int GetExternallyAllocatedMemory() override;
   int AdjustExternallyAllocatedMemory(int change_in_bytes) override;
   int GetArrayLength() override;
diff --git a/libcef_dll/cpptoc/app_cpptoc.cc b/libcef_dll/cpptoc/app_cpptoc.cc
index 0963510d1..cd786f5d7 100644
--- a/libcef_dll/cpptoc/app_cpptoc.cc
+++ b/libcef_dll/cpptoc/app_cpptoc.cc
@@ -125,16 +125,16 @@ CefAppCppToC::CefAppCppToC() {
   GetStruct()->get_render_process_handler = app_get_render_process_handler;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_app_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_APP;
diff --git a/libcef_dll/cpptoc/app_cpptoc.h b/libcef_dll/cpptoc/app_cpptoc.h
index 4be843972..194308582 100644
--- a/libcef_dll/cpptoc/app_cpptoc.h
+++ b/libcef_dll/cpptoc/app_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_app.h"
 #include "include/capi/cef_app_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefAppCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefAppCppToC();
 };
diff --git a/libcef_dll/cpptoc/auth_callback_cpptoc.cc b/libcef_dll/cpptoc/auth_callback_cpptoc.cc
index 2ba37a247..aab0f644d 100644
--- a/libcef_dll/cpptoc/auth_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/auth_callback_cpptoc.cc
@@ -60,7 +60,7 @@ CefAuthCallbackCppToC::CefAuthCallbackCppToC() {
   GetStruct()->cancel = auth_callback_cancel;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_auth_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -68,9 +68,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_AUTH_CALLBACK;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_AUTH_CALLBACK;
diff --git a/libcef_dll/cpptoc/auth_callback_cpptoc.h b/libcef_dll/cpptoc/auth_callback_cpptoc.h
index 8e6445dfe..f61b038c8 100644
--- a/libcef_dll/cpptoc/auth_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/auth_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_auth_callback.h"
 #include "include/capi/cef_auth_callback_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefAuthCallbackCppToC
-    : public CefCppToC {
  public:
   CefAuthCallbackCppToC();
diff --git a/libcef_dll/cpptoc/base_cpptoc.cc b/libcef_dll/cpptoc/base_cpptoc.cc
deleted file mode 100644
index 2c67988b8..000000000
--- a/libcef_dll/cpptoc/base_cpptoc.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-#include "libcef_dll/cpptoc/base_cpptoc.h"
-
-CefBaseCppToC::CefBaseCppToC() {
-}
-
-template<> CefRefPtr CefCppToC::
-    UnwrapDerived(CefWrapperType type, cef_base_t* s) {
-  NOTREACHED();
-  return NULL;
-}
-
-#if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
-#endif
-
-template<> CefWrapperType CefCppToC::
-    kWrapperType = WT_BASE;
diff --git a/libcef_dll/cpptoc/base_ref_counted_cpptoc.cc b/libcef_dll/cpptoc/base_ref_counted_cpptoc.cc
new file mode 100644
index 000000000..8a528b344
--- /dev/null
+++ b/libcef_dll/cpptoc/base_ref_counted_cpptoc.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+#include "libcef_dll/cpptoc/base_ref_counted_cpptoc.h"
+
+CefBaseRefCountedCppToC::CefBaseRefCountedCppToC() {
+}
+
+template<> CefRefPtr CefCppToCRefCounted<
+    CefBaseRefCountedCppToC, CefBaseRefCounted, cef_base_ref_counted_t>::
+    UnwrapDerived(CefWrapperType type, cef_base_ref_counted_t* s) {
+  NOTREACHED();
+  return NULL;
+}
+
+#if DCHECK_IS_ON()
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
+#endif
+
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_BASE_REF_COUNTED;
diff --git a/libcef_dll/cpptoc/base_cpptoc.h b/libcef_dll/cpptoc/base_ref_counted_cpptoc.h
similarity index 50%
rename from libcef_dll/cpptoc/base_cpptoc.h
rename to libcef_dll/cpptoc/base_ref_counted_cpptoc.h
index 8be2681b6..c3b845ec1 100644
--- a/libcef_dll/cpptoc/base_cpptoc.h
+++ b/libcef_dll/cpptoc/base_ref_counted_cpptoc.h
@@ -2,23 +2,24 @@
 // reserved. Use of this source code is governed by a BSD-style license that
 // can be found in the LICENSE file.
 
-#ifndef CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
-#define CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
+#ifndef CEF_LIBCEF_DLL_CPPTOC_BASE_REF_COUNTED_CPPTOC_H_
+#define CEF_LIBCEF_DLL_CPPTOC_BASE_REF_COUNTED_CPPTOC_H_
 #pragma once
 
 #include "include/cef_base.h"
 #include "include/capi/cef_base_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 #if !defined(WRAPPING_CEF_SHARED)
 #error This file can be included wrapper-side only
 #endif
 
 // Wrap a C++ class with a C structure.
-class CefBaseCppToC
-    : public CefCppToC {
+class CefBaseRefCountedCppToC
+    : public CefCppToCRefCounted {
  public:
-  CefBaseCppToC();
+  CefBaseRefCountedCppToC();
 };
 
-#endif  // CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_
+#endif  // CEF_LIBCEF_DLL_CPPTOC_BASE_REF_COUNTED_CPPTOC_H_
diff --git a/libcef_dll/cpptoc/base_scoped_cpptoc.cc b/libcef_dll/cpptoc/base_scoped_cpptoc.cc
index 7562b04ff..7ae2d3303 100644
--- a/libcef_dll/cpptoc/base_scoped_cpptoc.cc
+++ b/libcef_dll/cpptoc/base_scoped_cpptoc.cc
@@ -27,4 +27,4 @@ template<> base::AtomicRefCount CefCppToCScoped CefWrapperType CefCppToCScoped::kWrapperType = WT_BASE;
+    cef_base_scoped_t>::kWrapperType = WT_BASE_SCOPED;
diff --git a/libcef_dll/cpptoc/before_download_callback_cpptoc.cc b/libcef_dll/cpptoc/before_download_callback_cpptoc.cc
index a4a845d7f..9ecc06dfa 100644
--- a/libcef_dll/cpptoc/before_download_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/before_download_callback_cpptoc.cc
@@ -42,7 +42,7 @@ CefBeforeDownloadCallbackCppToC::CefBeforeDownloadCallbackCppToC() {
   GetStruct()->cont = before_download_callback_cont;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_before_download_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -50,11 +50,11 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_BEFORE_DOWNLOAD_CALLBACK;
diff --git a/libcef_dll/cpptoc/before_download_callback_cpptoc.h b/libcef_dll/cpptoc/before_download_callback_cpptoc.h
index b0f670461..97ff7ad68 100644
--- a/libcef_dll/cpptoc/before_download_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/before_download_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_download_handler.h"
 #include "include/capi/cef_download_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefBeforeDownloadCallbackCppToC
-    : public CefCppToC {
  public:
   CefBeforeDownloadCallbackCppToC();
diff --git a/libcef_dll/cpptoc/binary_value_cpptoc.cc b/libcef_dll/cpptoc/binary_value_cpptoc.cc
index 136a0e78e..89c868dcb 100644
--- a/libcef_dll/cpptoc/binary_value_cpptoc.cc
+++ b/libcef_dll/cpptoc/binary_value_cpptoc.cc
@@ -172,7 +172,7 @@ CefBinaryValueCppToC::CefBinaryValueCppToC() {
   GetStruct()->get_data = binary_value_get_data;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_binary_value_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -180,9 +180,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_BINARY_VALUE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BINARY_VALUE;
diff --git a/libcef_dll/cpptoc/binary_value_cpptoc.h b/libcef_dll/cpptoc/binary_value_cpptoc.h
index 2b1c069f5..5d5081706 100644
--- a/libcef_dll/cpptoc/binary_value_cpptoc.h
+++ b/libcef_dll/cpptoc/binary_value_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefBinaryValueCppToC
-    : public CefCppToC {
  public:
   CefBinaryValueCppToC();
diff --git a/libcef_dll/cpptoc/browser_cpptoc.cc b/libcef_dll/cpptoc/browser_cpptoc.cc
index 1b1a94b6e..4be108440 100644
--- a/libcef_dll/cpptoc/browser_cpptoc.cc
+++ b/libcef_dll/cpptoc/browser_cpptoc.cc
@@ -383,16 +383,17 @@ CefBrowserCppToC::CefBrowserCppToC() {
   GetStruct()->send_process_message = browser_send_process_message;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_browser_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_browser_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER;
diff --git a/libcef_dll/cpptoc/browser_cpptoc.h b/libcef_dll/cpptoc/browser_cpptoc.h
index 28e5a4281..17c1a8717 100644
--- a/libcef_dll/cpptoc/browser_cpptoc.h
+++ b/libcef_dll/cpptoc/browser_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefBrowserCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefBrowserCppToC();
 };
diff --git a/libcef_dll/cpptoc/browser_host_cpptoc.cc b/libcef_dll/cpptoc/browser_host_cpptoc.cc
index cd3ce2936..09fd64372 100644
--- a/libcef_dll/cpptoc/browser_host_cpptoc.cc
+++ b/libcef_dll/cpptoc/browser_host_cpptoc.cc
@@ -1074,7 +1074,7 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
       browser_host_get_visible_navigation_entry;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_browser_host_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -1082,9 +1082,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_BROWSER_HOST;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER_HOST;
diff --git a/libcef_dll/cpptoc/browser_host_cpptoc.h b/libcef_dll/cpptoc/browser_host_cpptoc.h
index 2b49bb599..62d0bce31 100644
--- a/libcef_dll/cpptoc/browser_host_cpptoc.h
+++ b/libcef_dll/cpptoc/browser_host_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefBrowserHostCppToC
-    : public CefCppToC {
  public:
   CefBrowserHostCppToC();
diff --git a/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc b/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc
index 458d897b5..81261b974 100644
--- a/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc
@@ -114,7 +114,7 @@ CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC() {
       browser_process_handler_on_schedule_message_pump_work;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_browser_process_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -122,10 +122,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_BROWSER_PROCESS_HANDLER;
diff --git a/libcef_dll/cpptoc/browser_process_handler_cpptoc.h b/libcef_dll/cpptoc/browser_process_handler_cpptoc.h
index 458562fc9..ca1c8a8bb 100644
--- a/libcef_dll/cpptoc/browser_process_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/browser_process_handler_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_browser_process_handler.h"
 #include "include/capi/cef_browser_process_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBrowserProcessHandlerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefBrowserProcessHandlerCppToC();
 };
diff --git a/libcef_dll/cpptoc/callback_cpptoc.cc b/libcef_dll/cpptoc/callback_cpptoc.cc
index 6d9285f76..b0cb5458c 100644
--- a/libcef_dll/cpptoc/callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/callback_cpptoc.cc
@@ -49,16 +49,17 @@ CefCallbackCppToC::CefCallbackCppToC() {
   GetStruct()->cancel = callback_cancel;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_callback_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_CALLBACK;
diff --git a/libcef_dll/cpptoc/callback_cpptoc.h b/libcef_dll/cpptoc/callback_cpptoc.h
index 1c203f9a3..c0b9670c8 100644
--- a/libcef_dll/cpptoc/callback_cpptoc.h
+++ b/libcef_dll/cpptoc/callback_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_callback.h"
 #include "include/capi/cef_callback_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/client_cpptoc.cc b/libcef_dll/cpptoc/client_cpptoc.cc
index b01a78956..5eb7b0452 100644
--- a/libcef_dll/cpptoc/client_cpptoc.cc
+++ b/libcef_dll/cpptoc/client_cpptoc.cc
@@ -307,16 +307,16 @@ CefClientCppToC::CefClientCppToC() {
   GetStruct()->on_process_message_received = client_on_process_message_received;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_client_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_CLIENT;
diff --git a/libcef_dll/cpptoc/client_cpptoc.h b/libcef_dll/cpptoc/client_cpptoc.h
index ecd4c843e..4b529af01 100644
--- a/libcef_dll/cpptoc/client_cpptoc.h
+++ b/libcef_dll/cpptoc/client_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefClientCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefClientCppToC();
 };
diff --git a/libcef_dll/cpptoc/command_line_cpptoc.cc b/libcef_dll/cpptoc/command_line_cpptoc.cc
index ca8fdfee1..42e3d772b 100644
--- a/libcef_dll/cpptoc/command_line_cpptoc.cc
+++ b/libcef_dll/cpptoc/command_line_cpptoc.cc
@@ -422,7 +422,7 @@ CefCommandLineCppToC::CefCommandLineCppToC() {
   GetStruct()->prepend_wrapper = command_line_prepend_wrapper;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_command_line_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -430,9 +430,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_COMMAND_LINE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_COMMAND_LINE;
diff --git a/libcef_dll/cpptoc/command_line_cpptoc.h b/libcef_dll/cpptoc/command_line_cpptoc.h
index a525ba799..becee9935 100644
--- a/libcef_dll/cpptoc/command_line_cpptoc.h
+++ b/libcef_dll/cpptoc/command_line_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_command_line.h"
 #include "include/capi/cef_command_line_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefCommandLineCppToC
-    : public CefCppToC {
  public:
   CefCommandLineCppToC();
diff --git a/libcef_dll/cpptoc/completion_callback_cpptoc.cc b/libcef_dll/cpptoc/completion_callback_cpptoc.cc
index 18ae3f789..1c1802c70 100644
--- a/libcef_dll/cpptoc/completion_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/completion_callback_cpptoc.cc
@@ -38,7 +38,7 @@ CefCompletionCallbackCppToC::CefCompletionCallbackCppToC() {
   GetStruct()->on_complete = completion_callback_on_complete;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_completion_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -46,10 +46,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_COMPLETION_CALLBACK;
diff --git a/libcef_dll/cpptoc/completion_callback_cpptoc.h b/libcef_dll/cpptoc/completion_callback_cpptoc.h
index 062ec87f7..41fcaadff 100644
--- a/libcef_dll/cpptoc/completion_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/completion_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_callback.h"
 #include "include/capi/cef_callback_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefCompletionCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefCompletionCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc b/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc
index 7116b06a3..1c899fca7 100644
--- a/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc
@@ -171,7 +171,7 @@ CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC() {
       context_menu_handler_on_context_menu_dismissed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_context_menu_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -179,10 +179,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_CONTEXT_MENU_HANDLER;
diff --git a/libcef_dll/cpptoc/context_menu_handler_cpptoc.h b/libcef_dll/cpptoc/context_menu_handler_cpptoc.h
index 371ab6b40..65db9d771 100644
--- a/libcef_dll/cpptoc/context_menu_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/context_menu_handler_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_context_menu_handler.h"
 #include "include/capi/cef_context_menu_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefContextMenuHandlerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefContextMenuHandlerCppToC();
 };
diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc
index 17a41fa50..75f0b0f7b 100644
--- a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc
+++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc
@@ -386,7 +386,7 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() {
   GetStruct()->is_pepper_menu = context_menu_params_is_pepper_menu;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_context_menu_params_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -394,10 +394,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_CONTEXT_MENU_PARAMS;
diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.h b/libcef_dll/cpptoc/context_menu_params_cpptoc.h
index e392b0538..17eeda6a5 100644
--- a/libcef_dll/cpptoc/context_menu_params_cpptoc.h
+++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_context_menu_handler.h"
 #include "include/capi/cef_context_menu_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefContextMenuParamsCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefContextMenuParamsCppToC();
 };
diff --git a/libcef_dll/cpptoc/cookie_manager_cpptoc.cc b/libcef_dll/cpptoc/cookie_manager_cpptoc.cc
index 393950b91..02f7233e0 100644
--- a/libcef_dll/cpptoc/cookie_manager_cpptoc.cc
+++ b/libcef_dll/cpptoc/cookie_manager_cpptoc.cc
@@ -234,7 +234,7 @@ CefCookieManagerCppToC::CefCookieManagerCppToC() {
   GetStruct()->flush_store = cookie_manager_flush_store;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_cookie_manager_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -242,9 +242,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_COOKIE_MANAGER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_COOKIE_MANAGER;
diff --git a/libcef_dll/cpptoc/cookie_manager_cpptoc.h b/libcef_dll/cpptoc/cookie_manager_cpptoc.h
index e7c540c4f..5c4f0ed70 100644
--- a/libcef_dll/cpptoc/cookie_manager_cpptoc.h
+++ b/libcef_dll/cpptoc/cookie_manager_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefCookieManagerCppToC
-    : public CefCppToC {
  public:
   CefCookieManagerCppToC();
diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc
index 4dea7ca2a..17fdebc7f 100644
--- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc
+++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc
@@ -65,7 +65,7 @@ CefCookieVisitorCppToC::CefCookieVisitorCppToC() {
   GetStruct()->visit = cookie_visitor_visit;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_cookie_visitor_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -73,9 +73,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_COOKIE_VISITOR;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_COOKIE_VISITOR;
diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h
index fc7474484..a9d775ddc 100644
--- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h
+++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefCookieVisitorCppToC
-    : public CefCppToC {
  public:
   CefCookieVisitorCppToC();
diff --git a/libcef_dll/cpptoc/cpptoc.h b/libcef_dll/cpptoc/cpptoc_ref_counted.h
similarity index 84%
rename from libcef_dll/cpptoc/cpptoc.h
rename to libcef_dll/cpptoc/cpptoc_ref_counted.h
index 5bf26b245..41adf81e4 100644
--- a/libcef_dll/cpptoc/cpptoc.h
+++ b/libcef_dll/cpptoc/cpptoc_ref_counted.h
@@ -2,8 +2,8 @@
 // reserved. Use of this source code is governed by a BSD-style license that
 // can be found in the LICENSE file.
 
-#ifndef CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_
-#define CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_
+#ifndef CEF_LIBCEF_DLL_CPPTOC_CPPTOC_REF_COUNTED_H_
+#define CEF_LIBCEF_DLL_CPPTOC_CPPTOC_REF_COUNTED_H_
 #pragma once
 
 #include "include/base/cef_logging.h"
@@ -16,7 +16,7 @@
 // implementation exists on this side of the DLL boundary but will have methods
 // called from the other side of the DLL boundary.
 template 
-class CefCppToC : public CefBase {
+class CefCppToCRefCounted : public CefBaseRefCounted {
  public:
   // Create a new wrapper instance and associated structure reference for
   // passing an object instance the other side.
@@ -24,7 +24,7 @@ class CefCppToC : public CefBase {
     if (!c.get())
       return NULL;
 
-    // Wrap our object with the CefCppToC class.
+    // Wrap our object with the CefCppToCRefCounted class.
     ClassName* wrapper = new ClassName();
     wrapper->wrapper_struct_.object_ = c.get();
     // Add a reference to our wrapper object that will be released once our
@@ -69,12 +69,12 @@ class CefCppToC : public CefBase {
   }
 
   // If returning the structure across the DLL boundary you should call
-  // AddRef() on this CefCppToC object.  On the other side of the DLL boundary,
-  // call UnderlyingRelease() on the wrapping CefCToCpp object.
+  // AddRef() on this CefCppToCRefCounted object. On the other side of the DLL
+  // boundary, call UnderlyingRelease() on the wrapping CefCToCpp object.
   StructName* GetStruct() { return &wrapper_struct_.struct_; }
 
-  // CefBase methods increment/decrement reference counts on both this object
-  // and the underlying wrapper class.
+  // CefBaseRefCounted methods increment/decrement reference counts on both this
+  // object and the underlying wrapper class.
   void AddRef() const {
     UnderlyingAddRef();
     ref_count_.AddRef();
@@ -95,12 +95,13 @@ class CefCppToC : public CefBase {
 #endif
 
  protected:
-  CefCppToC() {
+  CefCppToCRefCounted() {
     wrapper_struct_.type_ = kWrapperType;
     wrapper_struct_.wrapper_ = this;
     memset(GetStruct(), 0, sizeof(StructName));
 
-    cef_base_t* base = reinterpret_cast(GetStruct());
+    cef_base_ref_counted_t* base =
+        reinterpret_cast(GetStruct());
     base->size = sizeof(StructName);
     base->add_ref = struct_add_ref;
     base->release = struct_release;
@@ -111,7 +112,7 @@ class CefCppToC : public CefBase {
 #endif
   }
 
-  virtual ~CefCppToC() {
+  virtual ~CefCppToCRefCounted() {
 #if DCHECK_IS_ON()
     base::AtomicRefCountDec(&DebugObjCt);
 #endif
@@ -123,7 +124,7 @@ class CefCppToC : public CefBase {
   struct WrapperStruct {
     CefWrapperType type_;
     BaseName* object_;
-    CefCppToC* wrapper_;
+    CefCppToCRefCounted* wrapper_;
     StructName struct_;
   };
 
@@ -150,7 +151,7 @@ class CefCppToC : public CefBase {
     return wrapper_struct_.object_->HasOneRef();
   }
 
-  static void CEF_CALLBACK struct_add_ref(cef_base_t* base) {
+  static void CEF_CALLBACK struct_add_ref(cef_base_ref_counted_t* base) {
     DCHECK(base);
     if (!base)
       return;
@@ -163,7 +164,7 @@ class CefCppToC : public CefBase {
     wrapperStruct->wrapper_->AddRef();
   }
 
-  static int CEF_CALLBACK struct_release(cef_base_t* base) {
+  static int CEF_CALLBACK struct_release(cef_base_ref_counted_t* base) {
     DCHECK(base);
     if (!base)
       return 0;
@@ -176,7 +177,7 @@ class CefCppToC : public CefBase {
     return wrapperStruct->wrapper_->Release();
   }
 
-  static int CEF_CALLBACK struct_has_one_ref(cef_base_t* base) {
+  static int CEF_CALLBACK struct_has_one_ref(cef_base_ref_counted_t* base) {
     DCHECK(base);
     if (!base)
       return 0;
@@ -194,7 +195,7 @@ class CefCppToC : public CefBase {
 
   static CefWrapperType kWrapperType;
 
-  DISALLOW_COPY_AND_ASSIGN(CefCppToC);
+  DISALLOW_COPY_AND_ASSIGN(CefCppToCRefCounted);
 };
 
-#endif  // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_
+#endif  // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_REF_COUNTED_H_
diff --git a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc
index 15f243ea1..540fa8e5d 100644
--- a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc
@@ -39,7 +39,7 @@ CefDeleteCookiesCallbackCppToC::CefDeleteCookiesCallbackCppToC() {
   GetStruct()->on_complete = delete_cookies_callback_on_complete;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_delete_cookies_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -47,10 +47,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_DELETE_COOKIES_CALLBACK;
diff --git a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h
index e02950285..6b5fbc1a7 100644
--- a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDeleteCookiesCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefDeleteCookiesCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/dialog_handler_cpptoc.cc b/libcef_dll/cpptoc/dialog_handler_cpptoc.cc
index 8d1ca062a..943099f71 100644
--- a/libcef_dll/cpptoc/dialog_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/dialog_handler_cpptoc.cc
@@ -71,7 +71,7 @@ CefDialogHandlerCppToC::CefDialogHandlerCppToC() {
   GetStruct()->on_file_dialog = dialog_handler_on_file_dialog;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_dialog_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -79,9 +79,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_DIALOG_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DIALOG_HANDLER;
diff --git a/libcef_dll/cpptoc/dialog_handler_cpptoc.h b/libcef_dll/cpptoc/dialog_handler_cpptoc.h
index 939d6b9c5..f50500b50 100644
--- a/libcef_dll/cpptoc/dialog_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/dialog_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_dialog_handler.h"
 #include "include/capi/cef_dialog_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDialogHandlerCppToC
-    : public CefCppToC {
  public:
   CefDialogHandlerCppToC();
diff --git a/libcef_dll/cpptoc/dictionary_value_cpptoc.cc b/libcef_dll/cpptoc/dictionary_value_cpptoc.cc
index 8b14dc3e1..835e9370c 100644
--- a/libcef_dll/cpptoc/dictionary_value_cpptoc.cc
+++ b/libcef_dll/cpptoc/dictionary_value_cpptoc.cc
@@ -663,7 +663,7 @@ CefDictionaryValueCppToC::CefDictionaryValueCppToC() {
   GetStruct()->set_list = dictionary_value_set_list;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_dictionary_value_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -671,10 +671,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_DICTIONARY_VALUE;
diff --git a/libcef_dll/cpptoc/dictionary_value_cpptoc.h b/libcef_dll/cpptoc/dictionary_value_cpptoc.h
index 3e7bd74f9..b939f493d 100644
--- a/libcef_dll/cpptoc/dictionary_value_cpptoc.h
+++ b/libcef_dll/cpptoc/dictionary_value_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefDictionaryValueCppToC
-    : public CefCppToC {
  public:
   CefDictionaryValueCppToC();
diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.cc b/libcef_dll/cpptoc/display_handler_cpptoc.cc
index 1baa2a050..9d8618d54 100644
--- a/libcef_dll/cpptoc/display_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/display_handler_cpptoc.cc
@@ -197,7 +197,7 @@ CefDisplayHandlerCppToC::CefDisplayHandlerCppToC() {
   GetStruct()->on_console_message = display_handler_on_console_message;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_display_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -205,9 +205,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_DISPLAY_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_DISPLAY_HANDLER;
diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.h b/libcef_dll/cpptoc/display_handler_cpptoc.h
index c03a2e1b5..f999d7733 100644
--- a/libcef_dll/cpptoc/display_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/display_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_display_handler.h"
 #include "include/capi/cef_display_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDisplayHandlerCppToC
-    : public CefCppToC {
  public:
   CefDisplayHandlerCppToC();
diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.cc b/libcef_dll/cpptoc/domdocument_cpptoc.cc
index 644ceb8b4..943e41100 100644
--- a/libcef_dll/cpptoc/domdocument_cpptoc.cc
+++ b/libcef_dll/cpptoc/domdocument_cpptoc.cc
@@ -263,7 +263,7 @@ CefDOMDocumentCppToC::CefDOMDocumentCppToC() {
   GetStruct()->get_complete_url = domdocument_get_complete_url;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_domdocument_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -271,9 +271,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_DOMDOCUMENT;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOMDOCUMENT;
diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.h b/libcef_dll/cpptoc/domdocument_cpptoc.h
index 693161f8a..4b65bdeeb 100644
--- a/libcef_dll/cpptoc/domdocument_cpptoc.h
+++ b/libcef_dll/cpptoc/domdocument_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_dom.h"
 #include "include/capi/cef_dom_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefDOMDocumentCppToC
-    : public CefCppToC {
  public:
   CefDOMDocumentCppToC();
diff --git a/libcef_dll/cpptoc/domnode_cpptoc.cc b/libcef_dll/cpptoc/domnode_cpptoc.cc
index 841dcb720..2eaf515b2 100644
--- a/libcef_dll/cpptoc/domnode_cpptoc.cc
+++ b/libcef_dll/cpptoc/domnode_cpptoc.cc
@@ -479,16 +479,17 @@ CefDOMNodeCppToC::CefDOMNodeCppToC() {
   GetStruct()->get_element_bounds = domnode_get_element_bounds;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_domnode_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_domnode_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOMNODE;
diff --git a/libcef_dll/cpptoc/domnode_cpptoc.h b/libcef_dll/cpptoc/domnode_cpptoc.h
index 8a2e4e11a..a5e6c2c69 100644
--- a/libcef_dll/cpptoc/domnode_cpptoc.h
+++ b/libcef_dll/cpptoc/domnode_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_dom.h"
 #include "include/capi/cef_dom_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefDOMNodeCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefDOMNodeCppToC();
 };
diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/libcef_dll/cpptoc/domvisitor_cpptoc.cc
index 09fce198f..fb803c4da 100644
--- a/libcef_dll/cpptoc/domvisitor_cpptoc.cc
+++ b/libcef_dll/cpptoc/domvisitor_cpptoc.cc
@@ -44,7 +44,7 @@ CefDOMVisitorCppToC::CefDOMVisitorCppToC() {
   GetStruct()->visit = domvisitor_visit;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_domvisitor_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -52,9 +52,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_DOMVISITOR;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOMVISITOR;
diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.h b/libcef_dll/cpptoc/domvisitor_cpptoc.h
index 58f6c2726..520ed6f50 100644
--- a/libcef_dll/cpptoc/domvisitor_cpptoc.h
+++ b/libcef_dll/cpptoc/domvisitor_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_dom.h"
 #include "include/capi/cef_dom_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDOMVisitorCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefDOMVisitorCppToC();
 };
diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.cc b/libcef_dll/cpptoc/download_handler_cpptoc.cc
index feb11cdcc..646fcde75 100644
--- a/libcef_dll/cpptoc/download_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/download_handler_cpptoc.cc
@@ -95,7 +95,7 @@ CefDownloadHandlerCppToC::CefDownloadHandlerCppToC() {
   GetStruct()->on_download_updated = download_handler_on_download_updated;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_download_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -103,10 +103,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_DOWNLOAD_HANDLER;
diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.h b/libcef_dll/cpptoc/download_handler_cpptoc.h
index 66f7c29b6..9af10db5a 100644
--- a/libcef_dll/cpptoc/download_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/download_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_download_handler.h"
 #include "include/capi/cef_download_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDownloadHandlerCppToC
-    : public CefCppToC {
  public:
   CefDownloadHandlerCppToC();
diff --git a/libcef_dll/cpptoc/download_image_callback_cpptoc.cc b/libcef_dll/cpptoc/download_image_callback_cpptoc.cc
index b7c3a85a0..85dc48c50 100644
--- a/libcef_dll/cpptoc/download_image_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/download_image_callback_cpptoc.cc
@@ -49,7 +49,7 @@ CefDownloadImageCallbackCppToC::CefDownloadImageCallbackCppToC() {
       download_image_callback_on_download_image_finished;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_download_image_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -57,10 +57,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_DOWNLOAD_IMAGE_CALLBACK;
diff --git a/libcef_dll/cpptoc/download_image_callback_cpptoc.h b/libcef_dll/cpptoc/download_image_callback_cpptoc.h
index b7cd0f0c2..6a5c27390 100644
--- a/libcef_dll/cpptoc/download_image_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/download_image_callback_cpptoc.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDownloadImageCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefDownloadImageCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/download_item_callback_cpptoc.cc b/libcef_dll/cpptoc/download_item_callback_cpptoc.cc
index 32b17fb0e..1b5882427 100644
--- a/libcef_dll/cpptoc/download_item_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/download_item_callback_cpptoc.cc
@@ -64,7 +64,7 @@ CefDownloadItemCallbackCppToC::CefDownloadItemCallbackCppToC() {
   GetStruct()->resume = download_item_callback_resume;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_download_item_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -72,10 +72,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_DOWNLOAD_ITEM_CALLBACK;
diff --git a/libcef_dll/cpptoc/download_item_callback_cpptoc.h b/libcef_dll/cpptoc/download_item_callback_cpptoc.h
index e54439fde..e4b8ce5e1 100644
--- a/libcef_dll/cpptoc/download_item_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/download_item_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_download_handler.h"
 #include "include/capi/cef_download_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefDownloadItemCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefDownloadItemCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/download_item_cpptoc.cc b/libcef_dll/cpptoc/download_item_cpptoc.cc
index 23dbbb1e6..75d3a5bbb 100644
--- a/libcef_dll/cpptoc/download_item_cpptoc.cc
+++ b/libcef_dll/cpptoc/download_item_cpptoc.cc
@@ -293,7 +293,7 @@ CefDownloadItemCppToC::CefDownloadItemCppToC() {
   GetStruct()->get_mime_type = download_item_get_mime_type;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_download_item_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -301,9 +301,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_DOWNLOAD_ITEM;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DOWNLOAD_ITEM;
diff --git a/libcef_dll/cpptoc/download_item_cpptoc.h b/libcef_dll/cpptoc/download_item_cpptoc.h
index 5b9cd582b..83acbea17 100644
--- a/libcef_dll/cpptoc/download_item_cpptoc.h
+++ b/libcef_dll/cpptoc/download_item_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_download_item.h"
 #include "include/capi/cef_download_item_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefDownloadItemCppToC
-    : public CefCppToC {
  public:
   CefDownloadItemCppToC();
diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.cc b/libcef_dll/cpptoc/drag_data_cpptoc.cc
index ffad1755a..381b88b92 100644
--- a/libcef_dll/cpptoc/drag_data_cpptoc.cc
+++ b/libcef_dll/cpptoc/drag_data_cpptoc.cc
@@ -397,16 +397,17 @@ CefDragDataCppToC::CefDragDataCppToC() {
   GetStruct()->add_file = drag_data_add_file;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_drag_data_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_drag_data_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DRAG_DATA;
diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.h b/libcef_dll/cpptoc/drag_data_cpptoc.h
index c5641e744..a21043703 100644
--- a/libcef_dll/cpptoc/drag_data_cpptoc.h
+++ b/libcef_dll/cpptoc/drag_data_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_drag_data.h"
 #include "include/capi/cef_drag_data_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefDragDataCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefDragDataCppToC();
 };
diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/libcef_dll/cpptoc/drag_handler_cpptoc.cc
index 459c1e797..fd9f3adfb 100644
--- a/libcef_dll/cpptoc/drag_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/drag_handler_cpptoc.cc
@@ -89,7 +89,7 @@ CefDragHandlerCppToC::CefDragHandlerCppToC() {
       drag_handler_on_draggable_regions_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_drag_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -97,9 +97,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_DRAG_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DRAG_HANDLER;
diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.h b/libcef_dll/cpptoc/drag_handler_cpptoc.h
index 0b7d59475..3704d3acb 100644
--- a/libcef_dll/cpptoc/drag_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/drag_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_drag_handler.h"
 #include "include/capi/cef_drag_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDragHandlerCppToC
-    : public CefCppToC {
  public:
   CefDragHandlerCppToC();
diff --git a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc
index c55227b6b..b2931b567 100644
--- a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc
@@ -45,7 +45,7 @@ CefEndTracingCallbackCppToC::CefEndTracingCallbackCppToC() {
       end_tracing_callback_on_end_tracing_complete;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_end_tracing_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -53,10 +53,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_END_TRACING_CALLBACK;
diff --git a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h
index d634aee5e..892547787 100644
--- a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_trace.h"
 #include "include/capi/cef_trace_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefEndTracingCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefEndTracingCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc
index e254032d9..78173e430 100644
--- a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc
@@ -64,7 +64,7 @@ CefFileDialogCallbackCppToC::CefFileDialogCallbackCppToC() {
   GetStruct()->cancel = file_dialog_callback_cancel;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_file_dialog_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -72,10 +72,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_FILE_DIALOG_CALLBACK;
diff --git a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h
index d0e4776cf..4322e8134 100644
--- a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_dialog_handler.h"
 #include "include/capi/cef_dialog_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefFileDialogCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefFileDialogCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.cc b/libcef_dll/cpptoc/find_handler_cpptoc.cc
index c6803b2ff..56702f2dc 100644
--- a/libcef_dll/cpptoc/find_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/find_handler_cpptoc.cc
@@ -58,7 +58,7 @@ CefFindHandlerCppToC::CefFindHandlerCppToC() {
   GetStruct()->on_find_result = find_handler_on_find_result;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_find_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -66,9 +66,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_FIND_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FIND_HANDLER;
diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.h b/libcef_dll/cpptoc/find_handler_cpptoc.h
index b07da128e..c8f6168d6 100644
--- a/libcef_dll/cpptoc/find_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/find_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_find_handler.h"
 #include "include/capi/cef_find_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefFindHandlerCppToC
-    : public CefCppToC {
  public:
   CefFindHandlerCppToC();
diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/libcef_dll/cpptoc/focus_handler_cpptoc.cc
index 8c4db4b68..9d89e6801 100644
--- a/libcef_dll/cpptoc/focus_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/focus_handler_cpptoc.cc
@@ -85,7 +85,7 @@ CefFocusHandlerCppToC::CefFocusHandlerCppToC() {
   GetStruct()->on_got_focus = focus_handler_on_got_focus;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_focus_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -93,9 +93,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_FOCUS_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FOCUS_HANDLER;
diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.h b/libcef_dll/cpptoc/focus_handler_cpptoc.h
index af674b17f..d559d2a8b 100644
--- a/libcef_dll/cpptoc/focus_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/focus_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_focus_handler.h"
 #include "include/capi/cef_focus_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefFocusHandlerCppToC
-    : public CefCppToC {
  public:
   CefFocusHandlerCppToC();
diff --git a/libcef_dll/cpptoc/frame_cpptoc.cc b/libcef_dll/cpptoc/frame_cpptoc.cc
index 622e343e0..978735c6a 100644
--- a/libcef_dll/cpptoc/frame_cpptoc.cc
+++ b/libcef_dll/cpptoc/frame_cpptoc.cc
@@ -397,16 +397,16 @@ CefFrameCppToC::CefFrameCppToC() {
   GetStruct()->visit_dom = frame_visit_dom;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_frame_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FRAME;
diff --git a/libcef_dll/cpptoc/frame_cpptoc.h b/libcef_dll/cpptoc/frame_cpptoc.h
index e3e406dad..0a8cd199e 100644
--- a/libcef_dll/cpptoc/frame_cpptoc.h
+++ b/libcef_dll/cpptoc/frame_cpptoc.h
@@ -24,12 +24,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefFrameCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefFrameCppToC();
 };
diff --git a/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc b/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc
index 37b2ec9d7..9c14de5d6 100644
--- a/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc
@@ -39,7 +39,7 @@ CefGeolocationCallbackCppToC::CefGeolocationCallbackCppToC() {
   GetStruct()->cont = geolocation_callback_cont;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_geolocation_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -47,10 +47,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_GEOLOCATION_CALLBACK;
diff --git a/libcef_dll/cpptoc/geolocation_callback_cpptoc.h b/libcef_dll/cpptoc/geolocation_callback_cpptoc.h
index 38b06b73f..ef869c5a0 100644
--- a/libcef_dll/cpptoc/geolocation_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/geolocation_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_geolocation_handler.h"
 #include "include/capi/cef_geolocation_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefGeolocationCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefGeolocationCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc b/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc
index 673f6696f..0598b7b96 100644
--- a/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc
@@ -84,7 +84,7 @@ CefGeolocationHandlerCppToC::CefGeolocationHandlerCppToC() {
       geolocation_handler_on_cancel_geolocation_permission;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_geolocation_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -92,10 +92,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_GEOLOCATION_HANDLER;
diff --git a/libcef_dll/cpptoc/geolocation_handler_cpptoc.h b/libcef_dll/cpptoc/geolocation_handler_cpptoc.h
index 38091facd..66a5ac4b1 100644
--- a/libcef_dll/cpptoc/geolocation_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/geolocation_handler_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_geolocation_handler.h"
 #include "include/capi/cef_geolocation_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefGeolocationHandlerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefGeolocationHandlerCppToC();
 };
diff --git a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc
index e5ec2551c..bb1a0d05f 100644
--- a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc
@@ -49,7 +49,7 @@ CefGetGeolocationCallbackCppToC::CefGetGeolocationCallbackCppToC() {
   GetStruct()->on_location_update = get_geolocation_callback_on_location_update;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_get_geolocation_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -57,11 +57,11 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_GET_GEOLOCATION_CALLBACK;
diff --git a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h
index e8143e8fe..594e0049f 100644
--- a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_geolocation.h"
 #include "include/capi/cef_geolocation_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefGetGeolocationCallbackCppToC
-    : public CefCppToC {
  public:
   CefGetGeolocationCallbackCppToC();
diff --git a/libcef_dll/cpptoc/image_cpptoc.cc b/libcef_dll/cpptoc/image_cpptoc.cc
index b89f9ec92..f7d816c3f 100644
--- a/libcef_dll/cpptoc/image_cpptoc.cc
+++ b/libcef_dll/cpptoc/image_cpptoc.cc
@@ -388,16 +388,16 @@ CefImageCppToC::CefImageCppToC() {
   GetStruct()->get_as_jpeg = image_get_as_jpeg;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_image_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_IMAGE;
diff --git a/libcef_dll/cpptoc/image_cpptoc.h b/libcef_dll/cpptoc/image_cpptoc.h
index f27c4df18..7871f47a6 100644
--- a/libcef_dll/cpptoc/image_cpptoc.h
+++ b/libcef_dll/cpptoc/image_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_image.h"
 #include "include/capi/cef_image_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefImageCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefImageCppToC();
 };
diff --git a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc
index 36747949a..5ae872ba8 100644
--- a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc
@@ -41,7 +41,7 @@ CefJSDialogCallbackCppToC::CefJSDialogCallbackCppToC() {
   GetStruct()->cont = jsdialog_callback_cont;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_jsdialog_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -49,10 +49,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_JSDIALOG_CALLBACK;
diff --git a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h
index a07874b96..3cff8cbd3 100644
--- a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_jsdialog_handler.h"
 #include "include/capi/cef_jsdialog_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefJSDialogCallbackCppToC
-    : public CefCppToC {
  public:
   CefJSDialogCallbackCppToC();
diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc
index a64863c5c..22e142990 100644
--- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc
@@ -142,7 +142,7 @@ CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC() {
   GetStruct()->on_dialog_closed = jsdialog_handler_on_dialog_closed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_jsdialog_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -150,10 +150,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_JSDIALOG_HANDLER;
diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h
index beb91a8e8..7a0cba550 100644
--- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_jsdialog_handler.h"
 #include "include/capi/cef_jsdialog_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefJSDialogHandlerCppToC
-    : public CefCppToC {
  public:
   CefJSDialogHandlerCppToC();
diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc
index 85da445a6..845d7fd6e 100644
--- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc
@@ -105,7 +105,7 @@ CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC() {
   GetStruct()->on_key_event = keyboard_handler_on_key_event;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_keyboard_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -113,10 +113,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_KEYBOARD_HANDLER;
diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h
index 3daed21bd..11f875cb1 100644
--- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_keyboard_handler.h"
 #include "include/capi/cef_keyboard_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefKeyboardHandlerCppToC
-    : public CefCppToC {
  public:
   CefKeyboardHandlerCppToC();
diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc
index 95cc7d880..33ad78765 100644
--- a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc
@@ -188,7 +188,7 @@ CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC() {
   GetStruct()->on_before_close = life_span_handler_on_before_close;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_life_span_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -196,10 +196,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_LIFE_SPAN_HANDLER;
diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/libcef_dll/cpptoc/life_span_handler_cpptoc.h
index 36b9eef17..35fa3b71d 100644
--- a/libcef_dll/cpptoc/life_span_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_life_span_handler_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefLifeSpanHandlerCppToC
-    : public CefCppToC {
  public:
   CefLifeSpanHandlerCppToC();
diff --git a/libcef_dll/cpptoc/list_value_cpptoc.cc b/libcef_dll/cpptoc/list_value_cpptoc.cc
index b726b86e8..c2473a2a0 100644
--- a/libcef_dll/cpptoc/list_value_cpptoc.cc
+++ b/libcef_dll/cpptoc/list_value_cpptoc.cc
@@ -540,17 +540,17 @@ CefListValueCppToC::CefListValueCppToC() {
   GetStruct()->set_list = list_value_set_list;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type,
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_list_value_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LIST_VALUE;
diff --git a/libcef_dll/cpptoc/list_value_cpptoc.h b/libcef_dll/cpptoc/list_value_cpptoc.h
index 39afa5e94..80b1a26cb 100644
--- a/libcef_dll/cpptoc/list_value_cpptoc.h
+++ b/libcef_dll/cpptoc/list_value_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefListValueCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefListValueCppToC();
 };
diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.cc b/libcef_dll/cpptoc/load_handler_cpptoc.cc
index 58fca7350..c45758a28 100644
--- a/libcef_dll/cpptoc/load_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/load_handler_cpptoc.cc
@@ -130,7 +130,7 @@ CefLoadHandlerCppToC::CefLoadHandlerCppToC() {
   GetStruct()->on_load_error = load_handler_on_load_error;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_load_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -138,9 +138,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_LOAD_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LOAD_HANDLER;
diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.h b/libcef_dll/cpptoc/load_handler_cpptoc.h
index 00dc79d7d..18865dd81 100644
--- a/libcef_dll/cpptoc/load_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/load_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_load_handler.h"
 #include "include/capi/cef_load_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefLoadHandlerCppToC
-    : public CefCppToC {
  public:
   CefLoadHandlerCppToC();
diff --git a/libcef_dll/cpptoc/menu_model_cpptoc.cc b/libcef_dll/cpptoc/menu_model_cpptoc.cc
index 35d4b717a..5e1aa20c3 100644
--- a/libcef_dll/cpptoc/menu_model_cpptoc.cc
+++ b/libcef_dll/cpptoc/menu_model_cpptoc.cc
@@ -1037,17 +1037,17 @@ CefMenuModelCppToC::CefMenuModelCppToC() {
   GetStruct()->get_accelerator_at = menu_model_get_accelerator_at;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type,
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_menu_model_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_MENU_MODEL;
diff --git a/libcef_dll/cpptoc/menu_model_cpptoc.h b/libcef_dll/cpptoc/menu_model_cpptoc.h
index 0a2dd4a94..9cadc6e1a 100644
--- a/libcef_dll/cpptoc/menu_model_cpptoc.h
+++ b/libcef_dll/cpptoc/menu_model_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_menu_model.h"
 #include "include/capi/cef_menu_model_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefMenuModelCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefMenuModelCppToC();
 };
diff --git a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc
index 99aa71acf..f022b8189 100644
--- a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.cc
@@ -113,7 +113,7 @@ CefMenuModelDelegateCppToC::CefMenuModelDelegateCppToC() {
   GetStruct()->format_label = menu_model_delegate_format_label;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_menu_model_delegate_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -121,10 +121,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_MENU_MODEL_DELEGATE;
diff --git a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h
index 418e0e670..3ca65ad2e 100644
--- a/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/menu_model_delegate_cpptoc.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_menu_model_delegate_capi.h"
 #include "include/cef_menu_model.h"
 #include "include/capi/cef_menu_model_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefMenuModelDelegateCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefMenuModelDelegateCppToC();
 };
diff --git a/libcef_dll/cpptoc/navigation_entry_cpptoc.cc b/libcef_dll/cpptoc/navigation_entry_cpptoc.cc
index cee596ad1..212d65312 100644
--- a/libcef_dll/cpptoc/navigation_entry_cpptoc.cc
+++ b/libcef_dll/cpptoc/navigation_entry_cpptoc.cc
@@ -188,7 +188,7 @@ CefNavigationEntryCppToC::CefNavigationEntryCppToC() {
   GetStruct()->get_sslstatus = navigation_entry_get_sslstatus;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_navigation_entry_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -196,10 +196,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_NAVIGATION_ENTRY;
diff --git a/libcef_dll/cpptoc/navigation_entry_cpptoc.h b/libcef_dll/cpptoc/navigation_entry_cpptoc.h
index 50163fd2d..ec8dd605c 100644
--- a/libcef_dll/cpptoc/navigation_entry_cpptoc.h
+++ b/libcef_dll/cpptoc/navigation_entry_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_navigation_entry.h"
 #include "include/capi/cef_navigation_entry_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefNavigationEntryCppToC
-    : public CefCppToC {
  public:
   CefNavigationEntryCppToC();
diff --git a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc
index 199194dbb..e288dace0 100644
--- a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc
+++ b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc
@@ -52,7 +52,7 @@ CefNavigationEntryVisitorCppToC::CefNavigationEntryVisitorCppToC() {
   GetStruct()->visit = navigation_entry_visitor_visit;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_navigation_entry_visitor_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -60,11 +60,11 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_NAVIGATION_ENTRY_VISITOR;
diff --git a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h
index f0f2ccfc7..9d54c47db 100644
--- a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h
+++ b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefNavigationEntryVisitorCppToC
-    : public CefCppToC {
  public:
   CefNavigationEntryVisitorCppToC();
diff --git a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc
index 8a1d5e1c5..6a96785c0 100644
--- a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.cc
@@ -44,7 +44,7 @@ CefPdfPrintCallbackCppToC::CefPdfPrintCallbackCppToC() {
   GetStruct()->on_pdf_print_finished = pdf_print_callback_on_pdf_print_finished;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_pdf_print_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -52,10 +52,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_PDF_PRINT_CALLBACK;
diff --git a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h
index 3da22358e..4ae264e16 100644
--- a/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/pdf_print_callback_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPdfPrintCallbackCppToC
-    : public CefCppToC {
  public:
   CefPdfPrintCallbackCppToC();
diff --git a/libcef_dll/cpptoc/post_data_cpptoc.cc b/libcef_dll/cpptoc/post_data_cpptoc.cc
index a934176cd..1ced479b5 100644
--- a/libcef_dll/cpptoc/post_data_cpptoc.cc
+++ b/libcef_dll/cpptoc/post_data_cpptoc.cc
@@ -176,16 +176,17 @@ CefPostDataCppToC::CefPostDataCppToC() {
   GetStruct()->remove_elements = post_data_remove_elements;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_post_data_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_post_data_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_POST_DATA;
diff --git a/libcef_dll/cpptoc/post_data_cpptoc.h b/libcef_dll/cpptoc/post_data_cpptoc.h
index 1bb6fe9bd..a4a2dd700 100644
--- a/libcef_dll/cpptoc/post_data_cpptoc.h
+++ b/libcef_dll/cpptoc/post_data_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_request.h"
 #include "include/capi/cef_request_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefPostDataCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefPostDataCppToC();
 };
diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.cc b/libcef_dll/cpptoc/post_data_element_cpptoc.cc
index 27b17f013..97a0a09a4 100644
--- a/libcef_dll/cpptoc/post_data_element_cpptoc.cc
+++ b/libcef_dll/cpptoc/post_data_element_cpptoc.cc
@@ -175,7 +175,7 @@ CefPostDataElementCppToC::CefPostDataElementCppToC() {
   GetStruct()->get_bytes = post_data_element_get_bytes;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_post_data_element_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -183,10 +183,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_POST_DATA_ELEMENT;
diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.h b/libcef_dll/cpptoc/post_data_element_cpptoc.h
index 4ab16a7f8..0af30a495 100644
--- a/libcef_dll/cpptoc/post_data_element_cpptoc.h
+++ b/libcef_dll/cpptoc/post_data_element_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request.h"
 #include "include/capi/cef_request_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefPostDataElementCppToC
-    : public CefCppToC {
  public:
   CefPostDataElementCppToC();
diff --git a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc
index 06f7c9e8f..2f518617c 100644
--- a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc
@@ -58,7 +58,7 @@ CefPrintDialogCallbackCppToC::CefPrintDialogCallbackCppToC() {
   GetStruct()->cancel = print_dialog_callback_cancel;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_print_dialog_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -66,10 +66,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_PRINT_DIALOG_CALLBACK;
diff --git a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h
index c31a760f3..63869885e 100644
--- a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_print_handler.h"
 #include "include/capi/cef_print_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefPrintDialogCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefPrintDialogCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.cc b/libcef_dll/cpptoc/print_handler_cpptoc.cc
index c0d6f86b2..71a830d11 100644
--- a/libcef_dll/cpptoc/print_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/print_handler_cpptoc.cc
@@ -152,7 +152,7 @@ CefPrintHandlerCppToC::CefPrintHandlerCppToC() {
   GetStruct()->get_pdf_paper_size = print_handler_get_pdf_paper_size;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_print_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -160,9 +160,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_PRINT_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PRINT_HANDLER;
diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.h b/libcef_dll/cpptoc/print_handler_cpptoc.h
index 9032b319e..02ec23ede 100644
--- a/libcef_dll/cpptoc/print_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/print_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_print_handler.h"
 #include "include/capi/cef_print_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPrintHandlerCppToC
-    : public CefCppToC {
  public:
   CefPrintHandlerCppToC();
diff --git a/libcef_dll/cpptoc/print_job_callback_cpptoc.cc b/libcef_dll/cpptoc/print_job_callback_cpptoc.cc
index 9b1f78f17..b1eb6f2b6 100644
--- a/libcef_dll/cpptoc/print_job_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/print_job_callback_cpptoc.cc
@@ -38,7 +38,7 @@ CefPrintJobCallbackCppToC::CefPrintJobCallbackCppToC() {
   GetStruct()->cont = print_job_callback_cont;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_print_job_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -46,10 +46,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_PRINT_JOB_CALLBACK;
diff --git a/libcef_dll/cpptoc/print_job_callback_cpptoc.h b/libcef_dll/cpptoc/print_job_callback_cpptoc.h
index b6cd90a0a..75b32ae0e 100644
--- a/libcef_dll/cpptoc/print_job_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/print_job_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_print_handler.h"
 #include "include/capi/cef_print_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefPrintJobCallbackCppToC
-    : public CefCppToC {
  public:
   CefPrintJobCallbackCppToC();
diff --git a/libcef_dll/cpptoc/print_settings_cpptoc.cc b/libcef_dll/cpptoc/print_settings_cpptoc.cc
index 277d29d9b..80931bda6 100644
--- a/libcef_dll/cpptoc/print_settings_cpptoc.cc
+++ b/libcef_dll/cpptoc/print_settings_cpptoc.cc
@@ -443,7 +443,7 @@ CefPrintSettingsCppToC::CefPrintSettingsCppToC() {
   GetStruct()->get_duplex_mode = print_settings_get_duplex_mode;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_print_settings_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -451,9 +451,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_PRINT_SETTINGS;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PRINT_SETTINGS;
diff --git a/libcef_dll/cpptoc/print_settings_cpptoc.h b/libcef_dll/cpptoc/print_settings_cpptoc.h
index 51dfbb76d..7eab31a32 100644
--- a/libcef_dll/cpptoc/print_settings_cpptoc.h
+++ b/libcef_dll/cpptoc/print_settings_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_print_settings.h"
 #include "include/capi/cef_print_settings_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefPrintSettingsCppToC
-    : public CefCppToC {
  public:
   CefPrintSettingsCppToC();
diff --git a/libcef_dll/cpptoc/process_message_cpptoc.cc b/libcef_dll/cpptoc/process_message_cpptoc.cc
index 6d2f1a003..a84ae1ec5 100644
--- a/libcef_dll/cpptoc/process_message_cpptoc.cc
+++ b/libcef_dll/cpptoc/process_message_cpptoc.cc
@@ -127,7 +127,7 @@ CefProcessMessageCppToC::CefProcessMessageCppToC() {
   GetStruct()->get_argument_list = process_message_get_argument_list;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_process_message_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -135,9 +135,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_PROCESS_MESSAGE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_PROCESS_MESSAGE;
diff --git a/libcef_dll/cpptoc/process_message_cpptoc.h b/libcef_dll/cpptoc/process_message_cpptoc.h
index bc5f8de53..97369561f 100644
--- a/libcef_dll/cpptoc/process_message_cpptoc.h
+++ b/libcef_dll/cpptoc/process_message_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_process_message.h"
 #include "include/capi/cef_process_message_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefProcessMessageCppToC
-    : public CefCppToC {
  public:
   CefProcessMessageCppToC();
diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.cc b/libcef_dll/cpptoc/read_handler_cpptoc.cc
index 6ff64d77f..cad1820cf 100644
--- a/libcef_dll/cpptoc/read_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/read_handler_cpptoc.cc
@@ -111,7 +111,7 @@ CefReadHandlerCppToC::CefReadHandlerCppToC() {
   GetStruct()->may_block = read_handler_may_block;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_read_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -119,9 +119,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_READ_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_READ_HANDLER;
diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.h b/libcef_dll/cpptoc/read_handler_cpptoc.h
index 93918e24d..4ffcf74dd 100644
--- a/libcef_dll/cpptoc/read_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/read_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefReadHandlerCppToC
-    : public CefCppToC {
  public:
   CefReadHandlerCppToC();
diff --git a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc
index 5b27ec4df..1fe8e4e3c 100644
--- a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.cc
@@ -43,7 +43,7 @@ CefRegisterCdmCallbackCppToC::CefRegisterCdmCallbackCppToC() {
       register_cdm_callback_on_cdm_registration_complete;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_register_cdm_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -51,10 +51,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_REGISTER_CDM_CALLBACK;
diff --git a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h
index 5e9dc1345..788b79c81 100644
--- a/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/register_cdm_callback_cpptoc.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRegisterCdmCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefRegisterCdmCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.cc b/libcef_dll/cpptoc/render_handler_cpptoc.cc
index 36076ccf1..63dcdb09c 100644
--- a/libcef_dll/cpptoc/render_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/render_handler_cpptoc.cc
@@ -412,7 +412,7 @@ CefRenderHandlerCppToC::CefRenderHandlerCppToC() {
       render_handler_on_ime_composition_range_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_render_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -420,9 +420,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_RENDER_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RENDER_HANDLER;
diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.h b/libcef_dll/cpptoc/render_handler_cpptoc.h
index 8a70abd37..3c62d30f5 100644
--- a/libcef_dll/cpptoc/render_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/render_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_render_handler.h"
 #include "include/capi/cef_render_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRenderHandlerCppToC
-    : public CefCppToC {
  public:
   CefRenderHandlerCppToC();
diff --git a/libcef_dll/cpptoc/render_process_handler_cpptoc.cc b/libcef_dll/cpptoc/render_process_handler_cpptoc.cc
index 8cb692c1c..ec133b0af 100644
--- a/libcef_dll/cpptoc/render_process_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/render_process_handler_cpptoc.cc
@@ -312,7 +312,7 @@ CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC() {
       render_process_handler_on_process_message_received;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_render_process_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -320,10 +320,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_RENDER_PROCESS_HANDLER;
diff --git a/libcef_dll/cpptoc/render_process_handler_cpptoc.h b/libcef_dll/cpptoc/render_process_handler_cpptoc.h
index 9fa95aab9..bad14ecb7 100644
--- a/libcef_dll/cpptoc/render_process_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/render_process_handler_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_render_process_handler.h"
 #include "include/capi/cef_render_process_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRenderProcessHandlerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefRenderProcessHandlerCppToC();
 };
diff --git a/libcef_dll/cpptoc/request_callback_cpptoc.cc b/libcef_dll/cpptoc/request_callback_cpptoc.cc
index 40aa37414..aa78ac70f 100644
--- a/libcef_dll/cpptoc/request_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/request_callback_cpptoc.cc
@@ -52,7 +52,7 @@ CefRequestCallbackCppToC::CefRequestCallbackCppToC() {
   GetStruct()->cancel = request_callback_cancel;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_request_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -60,10 +60,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_REQUEST_CALLBACK;
diff --git a/libcef_dll/cpptoc/request_callback_cpptoc.h b/libcef_dll/cpptoc/request_callback_cpptoc.h
index dd6ac0b23..ab48ecf34 100644
--- a/libcef_dll/cpptoc/request_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/request_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request_handler.h"
 #include "include/capi/cef_request_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefRequestCallbackCppToC
-    : public CefCppToC {
  public:
   CefRequestCallbackCppToC();
diff --git a/libcef_dll/cpptoc/request_context_cpptoc.cc b/libcef_dll/cpptoc/request_context_cpptoc.cc
index 4e5621cc6..660aa06cb 100644
--- a/libcef_dll/cpptoc/request_context_cpptoc.cc
+++ b/libcef_dll/cpptoc/request_context_cpptoc.cc
@@ -469,7 +469,7 @@ CefRequestContextCppToC::CefRequestContextCppToC() {
   GetStruct()->resolve_host_cached = request_context_resolve_host_cached;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_request_context_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -477,9 +477,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_REQUEST_CONTEXT;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_REQUEST_CONTEXT;
diff --git a/libcef_dll/cpptoc/request_context_cpptoc.h b/libcef_dll/cpptoc/request_context_cpptoc.h
index 4d90831c5..d0ced02d8 100644
--- a/libcef_dll/cpptoc/request_context_cpptoc.h
+++ b/libcef_dll/cpptoc/request_context_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_request_context_capi.h"
 #include "include/cef_scheme.h"
 #include "include/capi/cef_scheme_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefRequestContextCppToC
-    : public CefCppToC {
  public:
   CefRequestContextCppToC();
diff --git a/libcef_dll/cpptoc/request_context_handler_cpptoc.cc b/libcef_dll/cpptoc/request_context_handler_cpptoc.cc
index 1ee0b8791..308afff13 100644
--- a/libcef_dll/cpptoc/request_context_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/request_context_handler_cpptoc.cc
@@ -84,7 +84,7 @@ CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC() {
       request_context_handler_on_before_plugin_load;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_request_context_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -92,10 +92,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_REQUEST_CONTEXT_HANDLER;
diff --git a/libcef_dll/cpptoc/request_context_handler_cpptoc.h b/libcef_dll/cpptoc/request_context_handler_cpptoc.h
index bf1c750c8..9c111a594 100644
--- a/libcef_dll/cpptoc/request_context_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/request_context_handler_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_request_context_handler.h"
 #include "include/capi/cef_request_context_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRequestContextHandlerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefRequestContextHandlerCppToC();
 };
diff --git a/libcef_dll/cpptoc/request_cpptoc.cc b/libcef_dll/cpptoc/request_cpptoc.cc
index 58f85290d..7e797ab74 100644
--- a/libcef_dll/cpptoc/request_cpptoc.cc
+++ b/libcef_dll/cpptoc/request_cpptoc.cc
@@ -404,16 +404,17 @@ CefRequestCppToC::CefRequestCppToC() {
   GetStruct()->get_identifier = request_get_identifier;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_request_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_request_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_REQUEST;
diff --git a/libcef_dll/cpptoc/request_cpptoc.h b/libcef_dll/cpptoc/request_cpptoc.h
index b8d1dbc8c..9f53f8113 100644
--- a/libcef_dll/cpptoc/request_cpptoc.h
+++ b/libcef_dll/cpptoc/request_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request.h"
 #include "include/capi/cef_request_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefRequestCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefRequestCppToC();
 };
diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.cc b/libcef_dll/cpptoc/request_handler_cpptoc.cc
index 3961ebb3e..5115ac275 100644
--- a/libcef_dll/cpptoc/request_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/request_handler_cpptoc.cc
@@ -606,7 +606,7 @@ CefRequestHandlerCppToC::CefRequestHandlerCppToC() {
       request_handler_on_render_process_terminated;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_request_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -614,9 +614,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_REQUEST_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_REQUEST_HANDLER;
diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.h b/libcef_dll/cpptoc/request_handler_cpptoc.h
index 6c028c8da..f5654c2a2 100644
--- a/libcef_dll/cpptoc/request_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/request_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request_handler.h"
 #include "include/capi/cef_request_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRequestHandlerCppToC
-    : public CefCppToC {
  public:
   CefRequestHandlerCppToC();
diff --git a/libcef_dll/cpptoc/resolve_callback_cpptoc.cc b/libcef_dll/cpptoc/resolve_callback_cpptoc.cc
index 3d0f2bef5..38f060a64 100644
--- a/libcef_dll/cpptoc/resolve_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/resolve_callback_cpptoc.cc
@@ -47,7 +47,7 @@ CefResolveCallbackCppToC::CefResolveCallbackCppToC() {
   GetStruct()->on_resolve_completed = resolve_callback_on_resolve_completed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_resolve_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -55,10 +55,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_RESOLVE_CALLBACK;
diff --git a/libcef_dll/cpptoc/resolve_callback_cpptoc.h b/libcef_dll/cpptoc/resolve_callback_cpptoc.h
index a70915637..5a700d3d7 100644
--- a/libcef_dll/cpptoc/resolve_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/resolve_callback_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_request_context_capi.h"
 #include "include/cef_scheme.h"
 #include "include/capi/cef_scheme_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefResolveCallbackCppToC
-    : public CefCppToC {
  public:
   CefResolveCallbackCppToC();
diff --git a/libcef_dll/cpptoc/resource_bundle_cpptoc.cc b/libcef_dll/cpptoc/resource_bundle_cpptoc.cc
index 4d551ce1f..9951f9df4 100644
--- a/libcef_dll/cpptoc/resource_bundle_cpptoc.cc
+++ b/libcef_dll/cpptoc/resource_bundle_cpptoc.cc
@@ -137,7 +137,7 @@ CefResourceBundleCppToC::CefResourceBundleCppToC() {
       resource_bundle_get_data_resource_for_scale;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_resource_bundle_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -145,9 +145,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_RESOURCE_BUNDLE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_RESOURCE_BUNDLE;
diff --git a/libcef_dll/cpptoc/resource_bundle_cpptoc.h b/libcef_dll/cpptoc/resource_bundle_cpptoc.h
index 59aeac043..a8625bb79 100644
--- a/libcef_dll/cpptoc/resource_bundle_cpptoc.h
+++ b/libcef_dll/cpptoc/resource_bundle_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_resource_bundle.h"
 #include "include/capi/cef_resource_bundle_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefResourceBundleCppToC
-    : public CefCppToC {
  public:
   CefResourceBundleCppToC();
diff --git a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc
index 4617ba9d7..92939822c 100644
--- a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc
@@ -135,7 +135,7 @@ CefResourceBundleHandlerCppToC::CefResourceBundleHandlerCppToC() {
       resource_bundle_handler_get_data_resource_for_scale;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_resource_bundle_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -143,10 +143,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_RESOURCE_BUNDLE_HANDLER;
diff --git a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h
index fec421b29..31fc05d14 100644
--- a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_resource_bundle_handler.h"
 #include "include/capi/cef_resource_bundle_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefResourceBundleHandlerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefResourceBundleHandlerCppToC();
 };
diff --git a/libcef_dll/cpptoc/resource_handler_cpptoc.cc b/libcef_dll/cpptoc/resource_handler_cpptoc.cc
index 8f484f22a..9ed9356c8 100644
--- a/libcef_dll/cpptoc/resource_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/resource_handler_cpptoc.cc
@@ -198,7 +198,7 @@ CefResourceHandlerCppToC::CefResourceHandlerCppToC() {
   GetStruct()->cancel = resource_handler_cancel;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_resource_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -206,10 +206,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_RESOURCE_HANDLER;
diff --git a/libcef_dll/cpptoc/resource_handler_cpptoc.h b/libcef_dll/cpptoc/resource_handler_cpptoc.h
index 9565dad2d..e4a42ee7f 100644
--- a/libcef_dll/cpptoc/resource_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/resource_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_resource_handler.h"
 #include "include/capi/cef_resource_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefResourceHandlerCppToC
-    : public CefCppToC {
  public:
   CefResourceHandlerCppToC();
diff --git a/libcef_dll/cpptoc/response_cpptoc.cc b/libcef_dll/cpptoc/response_cpptoc.cc
index 650b7be1a..bccc75590 100644
--- a/libcef_dll/cpptoc/response_cpptoc.cc
+++ b/libcef_dll/cpptoc/response_cpptoc.cc
@@ -249,16 +249,17 @@ CefResponseCppToC::CefResponseCppToC() {
   GetStruct()->set_header_map = response_set_header_map;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_response_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_response_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_RESPONSE;
diff --git a/libcef_dll/cpptoc/response_cpptoc.h b/libcef_dll/cpptoc/response_cpptoc.h
index 65d122c96..8eb7b281d 100644
--- a/libcef_dll/cpptoc/response_cpptoc.h
+++ b/libcef_dll/cpptoc/response_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_response.h"
 #include "include/capi/cef_response_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefResponseCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefResponseCppToC();
 };
diff --git a/libcef_dll/cpptoc/response_filter_cpptoc.cc b/libcef_dll/cpptoc/response_filter_cpptoc.cc
index 350709b93..9f4dbcfe9 100644
--- a/libcef_dll/cpptoc/response_filter_cpptoc.cc
+++ b/libcef_dll/cpptoc/response_filter_cpptoc.cc
@@ -91,7 +91,7 @@ CefResponseFilterCppToC::CefResponseFilterCppToC() {
   GetStruct()->filter = response_filter_filter;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_response_filter_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -99,9 +99,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_RESPONSE_FILTER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_RESPONSE_FILTER;
diff --git a/libcef_dll/cpptoc/response_filter_cpptoc.h b/libcef_dll/cpptoc/response_filter_cpptoc.h
index 607992f09..4a3cd1e63 100644
--- a/libcef_dll/cpptoc/response_filter_cpptoc.h
+++ b/libcef_dll/cpptoc/response_filter_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_response_filter.h"
 #include "include/capi/cef_response_filter_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefResponseFilterCppToC
-    : public CefCppToC {
  public:
   CefResponseFilterCppToC();
diff --git a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc
index 7ceb9a1d4..d357f6b5b 100644
--- a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.cc
@@ -54,7 +54,7 @@ CefRunContextMenuCallbackCppToC::CefRunContextMenuCallbackCppToC() {
   GetStruct()->cancel = run_context_menu_callback_cancel;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_run_context_menu_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -62,11 +62,11 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_RUN_CONTEXT_MENU_CALLBACK;
diff --git a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h
index 246953527..9141baeec 100644
--- a/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_context_menu_handler.h"
 #include "include/capi/cef_context_menu_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefRunContextMenuCallbackCppToC
-    : public CefCppToC {
  public:
   CefRunContextMenuCallbackCppToC();
diff --git a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc
index 225d326f7..af47f3f26 100644
--- a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc
@@ -52,7 +52,7 @@ CefRunFileDialogCallbackCppToC::CefRunFileDialogCallbackCppToC() {
       run_file_dialog_callback_on_file_dialog_dismissed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_run_file_dialog_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -60,10 +60,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_RUN_FILE_DIALOG_CALLBACK;
diff --git a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h
index fd8b6da95..d88f2ed82 100644
--- a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRunFileDialogCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefRunFileDialogCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc
index 909cfd855..c86ea120a 100644
--- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc
+++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc
@@ -61,7 +61,7 @@ CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC() {
   GetStruct()->create = scheme_handler_factory_create;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_scheme_handler_factory_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -69,10 +69,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_SCHEME_HANDLER_FACTORY;
diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h
index 7d0467208..b239a78b4 100644
--- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h
+++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_scheme.h"
 #include "include/capi/cef_scheme_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefSchemeHandlerFactoryCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefSchemeHandlerFactoryCppToC();
 };
diff --git a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc
index ece400b55..4c309f2a7 100644
--- a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.cc
@@ -43,7 +43,7 @@ CefSelectClientCertificateCallbackCppToC::CefSelectClientCertificateCallbackCppT
   GetStruct()->select = select_client_certificate_callback_select;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_select_client_certificate_callback_t* s) {
@@ -52,12 +52,12 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_SELECT_CLIENT_CERTIFICATE_CALLBACK;
diff --git a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h
index 923abd35c..b76c34432 100644
--- a/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/select_client_certificate_callback_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request_handler.h"
 #include "include/capi/cef_request_handler_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefSelectClientCertificateCallbackCppToC
-    : public CefCppToC {
  public:
diff --git a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc
index 0576d799c..92ab99989 100644
--- a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc
@@ -39,7 +39,7 @@ CefSetCookieCallbackCppToC::CefSetCookieCallbackCppToC() {
   GetStruct()->on_complete = set_cookie_callback_on_complete;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_set_cookie_callback_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -47,10 +47,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_SET_COOKIE_CALLBACK;
diff --git a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h
index 2079452c1..62e583dee 100644
--- a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefSetCookieCallbackCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefSetCookieCallbackCppToC();
 };
diff --git a/libcef_dll/cpptoc/sslinfo_cpptoc.cc b/libcef_dll/cpptoc/sslinfo_cpptoc.cc
index 0b7ce0dbb..98ddba1b0 100644
--- a/libcef_dll/cpptoc/sslinfo_cpptoc.cc
+++ b/libcef_dll/cpptoc/sslinfo_cpptoc.cc
@@ -59,16 +59,17 @@ CefSSLInfoCppToC::CefSSLInfoCppToC() {
   GetStruct()->get_x509certificate = sslinfo_get_x509certificate;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_sslinfo_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_sslinfo_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SSLINFO;
diff --git a/libcef_dll/cpptoc/sslinfo_cpptoc.h b/libcef_dll/cpptoc/sslinfo_cpptoc.h
index ec5345aa2..dae2ccb34 100644
--- a/libcef_dll/cpptoc/sslinfo_cpptoc.h
+++ b/libcef_dll/cpptoc/sslinfo_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_ssl_info.h"
 #include "include/capi/cef_ssl_info_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefSSLInfoCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefSSLInfoCppToC();
 };
diff --git a/libcef_dll/cpptoc/sslstatus_cpptoc.cc b/libcef_dll/cpptoc/sslstatus_cpptoc.cc
index ea494dbaa..488342ae4 100644
--- a/libcef_dll/cpptoc/sslstatus_cpptoc.cc
+++ b/libcef_dll/cpptoc/sslstatus_cpptoc.cc
@@ -107,16 +107,17 @@ CefSSLStatusCppToC::CefSSLStatusCppToC() {
   GetStruct()->get_x509certificate = sslstatus_get_x509certificate;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_sslstatus_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_sslstatus_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SSLSTATUS;
diff --git a/libcef_dll/cpptoc/sslstatus_cpptoc.h b/libcef_dll/cpptoc/sslstatus_cpptoc.h
index 5c9f853f0..028dd1361 100644
--- a/libcef_dll/cpptoc/sslstatus_cpptoc.h
+++ b/libcef_dll/cpptoc/sslstatus_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_ssl_status.h"
 #include "include/capi/cef_ssl_status_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefSSLStatusCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefSSLStatusCppToC();
 };
diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.cc b/libcef_dll/cpptoc/stream_reader_cpptoc.cc
index fdeb2864b..01480f89d 100644
--- a/libcef_dll/cpptoc/stream_reader_cpptoc.cc
+++ b/libcef_dll/cpptoc/stream_reader_cpptoc.cc
@@ -167,7 +167,7 @@ CefStreamReaderCppToC::CefStreamReaderCppToC() {
   GetStruct()->may_block = stream_reader_may_block;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_stream_reader_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -175,9 +175,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_STREAM_READER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_STREAM_READER;
diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.h b/libcef_dll/cpptoc/stream_reader_cpptoc.h
index 1d15b9f09..4bdbc5247 100644
--- a/libcef_dll/cpptoc/stream_reader_cpptoc.h
+++ b/libcef_dll/cpptoc/stream_reader_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefStreamReaderCppToC
-    : public CefCppToC {
  public:
   CefStreamReaderCppToC();
diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.cc b/libcef_dll/cpptoc/stream_writer_cpptoc.cc
index 6ec43261a..e090332d5 100644
--- a/libcef_dll/cpptoc/stream_writer_cpptoc.cc
+++ b/libcef_dll/cpptoc/stream_writer_cpptoc.cc
@@ -149,7 +149,7 @@ CefStreamWriterCppToC::CefStreamWriterCppToC() {
   GetStruct()->may_block = stream_writer_may_block;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_stream_writer_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -157,9 +157,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_STREAM_WRITER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_STREAM_WRITER;
diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.h b/libcef_dll/cpptoc/stream_writer_cpptoc.h
index dd8a4b1fd..71711898c 100644
--- a/libcef_dll/cpptoc/stream_writer_cpptoc.h
+++ b/libcef_dll/cpptoc/stream_writer_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefStreamWriterCppToC
-    : public CefCppToC {
  public:
   CefStreamWriterCppToC();
diff --git a/libcef_dll/cpptoc/string_visitor_cpptoc.cc b/libcef_dll/cpptoc/string_visitor_cpptoc.cc
index 77585322b..d15dbece8 100644
--- a/libcef_dll/cpptoc/string_visitor_cpptoc.cc
+++ b/libcef_dll/cpptoc/string_visitor_cpptoc.cc
@@ -40,7 +40,7 @@ CefStringVisitorCppToC::CefStringVisitorCppToC() {
   GetStruct()->visit = string_visitor_visit;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_string_visitor_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -48,9 +48,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_STRING_VISITOR;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_STRING_VISITOR;
diff --git a/libcef_dll/cpptoc/string_visitor_cpptoc.h b/libcef_dll/cpptoc/string_visitor_cpptoc.h
index a449b4304..9aa85c199 100644
--- a/libcef_dll/cpptoc/string_visitor_cpptoc.h
+++ b/libcef_dll/cpptoc/string_visitor_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_string_visitor.h"
 #include "include/capi/cef_string_visitor_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefStringVisitorCppToC
-    : public CefCppToC {
  public:
   CefStringVisitorCppToC();
diff --git a/libcef_dll/cpptoc/task_cpptoc.cc b/libcef_dll/cpptoc/task_cpptoc.cc
index 8611b9fb9..0ee203ea3 100644
--- a/libcef_dll/cpptoc/task_cpptoc.cc
+++ b/libcef_dll/cpptoc/task_cpptoc.cc
@@ -37,16 +37,16 @@ CefTaskCppToC::CefTaskCppToC() {
   GetStruct()->execute = task_execute;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_task_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TASK;
diff --git a/libcef_dll/cpptoc/task_cpptoc.h b/libcef_dll/cpptoc/task_cpptoc.h
index 9d5f5c0db..d0f657568 100644
--- a/libcef_dll/cpptoc/task_cpptoc.h
+++ b/libcef_dll/cpptoc/task_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_task.h"
 #include "include/capi/cef_task_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTaskCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefTaskCppToC();
 };
diff --git a/libcef_dll/cpptoc/task_runner_cpptoc.cc b/libcef_dll/cpptoc/task_runner_cpptoc.cc
index a67ad67ea..3600f6682 100644
--- a/libcef_dll/cpptoc/task_runner_cpptoc.cc
+++ b/libcef_dll/cpptoc/task_runner_cpptoc.cc
@@ -149,7 +149,7 @@ CefTaskRunnerCppToC::CefTaskRunnerCppToC() {
   GetStruct()->post_delayed_task = task_runner_post_delayed_task;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_task_runner_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -157,9 +157,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_TASK_RUNNER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TASK_RUNNER;
diff --git a/libcef_dll/cpptoc/task_runner_cpptoc.h b/libcef_dll/cpptoc/task_runner_cpptoc.h
index 89a82884d..a46a30e11 100644
--- a/libcef_dll/cpptoc/task_runner_cpptoc.h
+++ b/libcef_dll/cpptoc/task_runner_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_task.h"
 #include "include/capi/cef_task_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefTaskRunnerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefTaskRunnerCppToC();
 };
diff --git a/libcef_dll/cpptoc/test/translator_test_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_cpptoc.cc
index 558021dd7..e966b06b0 100644
--- a/libcef_dll/cpptoc/test/translator_test_cpptoc.cc
+++ b/libcef_dll/cpptoc/test/translator_test_cpptoc.cc
@@ -1501,7 +1501,7 @@ CefTranslatorTestCppToC::CefTranslatorTestCppToC() {
       translator_test_set_raw_ptr_client_list;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_translator_test_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -1509,9 +1509,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_TRANSLATOR_TEST;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_TRANSLATOR_TEST;
diff --git a/libcef_dll/cpptoc/test/translator_test_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_cpptoc.h
index c341b7da3..1f6f4c095 100644
--- a/libcef_dll/cpptoc/test/translator_test_cpptoc.h
+++ b/libcef_dll/cpptoc/test/translator_test_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefTranslatorTestCppToC
-    : public CefCppToC {
  public:
   CefTranslatorTestCppToC();
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc
index 2698bcf1e..68e748e88 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.cc
@@ -62,7 +62,7 @@ CefTranslatorTestRefPtrClientChildCppToC::CefTranslatorTestRefPtrClientChildCppT
   GetStruct()->base.get_value = translator_test_ref_ptr_client_child_get_value;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_translator_test_ref_ptr_client_child_t* s) {
@@ -71,12 +71,12 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD;
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h
index 9c36a40b1..510e27249 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_child_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTranslatorTestRefPtrClientChildCppToC
-    : public CefCppToC {
  public:
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc
index 96d6a39fd..6982bf1bc 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.cc
@@ -42,7 +42,7 @@ CefTranslatorTestRefPtrClientCppToC::CefTranslatorTestRefPtrClientCppToC() {
   GetStruct()->get_value = translator_test_ref_ptr_client_get_value;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_translator_test_ref_ptr_client_t* s) {
@@ -55,12 +55,12 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_CLIENT;
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h
index c8c14aeb8..906b62049 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_client_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTranslatorTestRefPtrClientCppToC
-    : public CefCppToC {
  public:
   CefTranslatorTestRefPtrClientCppToC();
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc
index 548d45fe5..a86357ab0 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.cc
@@ -150,7 +150,7 @@ CefTranslatorTestRefPtrLibraryChildChildCppToC::CefTranslatorTestRefPtrLibraryCh
       translator_test_ref_ptr_library_child_child_set_value;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type,
@@ -160,12 +160,12 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD;
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h
index ebddb29db..ed1e1cb39 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_child_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefTranslatorTestRefPtrLibraryChildChildCppToC
-    : public CefCppToC {
  public:
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc
index 4aff1f509..c226081cc 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.cc
@@ -111,7 +111,7 @@ CefTranslatorTestRefPtrLibraryChildCppToC::CefTranslatorTestRefPtrLibraryChildCp
   GetStruct()->base.set_value = translator_test_ref_ptr_library_child_set_value;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_translator_test_ref_ptr_library_child_t* s) {
@@ -125,12 +125,12 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD;
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h
index 688ae461e..33e3cab95 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_child_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefTranslatorTestRefPtrLibraryChildCppToC
-    : public CefCppToC {
  public:
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc
index 893e34064..62274e04c 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.cc
@@ -73,7 +73,7 @@ CefTranslatorTestRefPtrLibraryCppToC::CefTranslatorTestRefPtrLibraryCppToC() {
   GetStruct()->set_value = translator_test_ref_ptr_library_set_value;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_translator_test_ref_ptr_library_t* s) {
@@ -91,12 +91,12 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_LIBRARY;
diff --git a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h
index c41d93357..e3a7e3478 100644
--- a/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h
+++ b/libcef_dll/cpptoc/test/translator_test_ref_ptr_library_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefTranslatorTestRefPtrLibraryCppToC
-    : public CefCppToC {
  public:
diff --git a/libcef_dll/cpptoc/thread_cpptoc.cc b/libcef_dll/cpptoc/thread_cpptoc.cc
index a6135a266..3bc39d242 100644
--- a/libcef_dll/cpptoc/thread_cpptoc.cc
+++ b/libcef_dll/cpptoc/thread_cpptoc.cc
@@ -109,16 +109,16 @@ CefThreadCppToC::CefThreadCppToC() {
   GetStruct()->is_running = thread_is_running;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_thread_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_THREAD;
diff --git a/libcef_dll/cpptoc/thread_cpptoc.h b/libcef_dll/cpptoc/thread_cpptoc.h
index b78664d73..5ab89ba90 100644
--- a/libcef_dll/cpptoc/thread_cpptoc.h
+++ b/libcef_dll/cpptoc/thread_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_thread.h"
 #include "include/capi/cef_thread_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefThreadCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefThreadCppToC();
 };
diff --git a/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc b/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc
index d64f43ed5..0b9122b31 100644
--- a/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc
+++ b/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc
@@ -149,7 +149,7 @@ CefURLRequestClientCppToC::CefURLRequestClientCppToC() {
   GetStruct()->get_auth_credentials = urlrequest_client_get_auth_credentials;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_urlrequest_client_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -157,10 +157,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_URLREQUEST_CLIENT;
diff --git a/libcef_dll/cpptoc/urlrequest_client_cpptoc.h b/libcef_dll/cpptoc/urlrequest_client_cpptoc.h
index 384cacb9f..9949caedb 100644
--- a/libcef_dll/cpptoc/urlrequest_client_cpptoc.h
+++ b/libcef_dll/cpptoc/urlrequest_client_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_urlrequest.h"
 #include "include/capi/cef_urlrequest_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefURLRequestClientCppToC
-    : public CefCppToC {
  public:
   CefURLRequestClientCppToC();
diff --git a/libcef_dll/cpptoc/urlrequest_cpptoc.cc b/libcef_dll/cpptoc/urlrequest_cpptoc.cc
index 7293b8b77..38064333c 100644
--- a/libcef_dll/cpptoc/urlrequest_cpptoc.cc
+++ b/libcef_dll/cpptoc/urlrequest_cpptoc.cc
@@ -152,7 +152,7 @@ CefURLRequestCppToC::CefURLRequestCppToC() {
   GetStruct()->cancel = urlrequest_cancel;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_urlrequest_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -160,9 +160,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_URLREQUEST;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_URLREQUEST;
diff --git a/libcef_dll/cpptoc/urlrequest_cpptoc.h b/libcef_dll/cpptoc/urlrequest_cpptoc.h
index 31cd2e786..7fd5617a8 100644
--- a/libcef_dll/cpptoc/urlrequest_cpptoc.h
+++ b/libcef_dll/cpptoc/urlrequest_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_urlrequest.h"
 #include "include/capi/cef_urlrequest_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefURLRequestCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefURLRequestCppToC();
 };
diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/libcef_dll/cpptoc/v8accessor_cpptoc.cc
index 5b79c7f89..d7a465238 100644
--- a/libcef_dll/cpptoc/v8accessor_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8accessor_cpptoc.cc
@@ -122,7 +122,7 @@ CefV8AccessorCppToC::CefV8AccessorCppToC() {
   GetStruct()->set = v8accessor_set;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_v8accessor_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -130,9 +130,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_V8ACCESSOR;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8ACCESSOR;
diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.h b/libcef_dll/cpptoc/v8accessor_cpptoc.h
index 5a97de81a..b840dca41 100644
--- a/libcef_dll/cpptoc/v8accessor_cpptoc.h
+++ b/libcef_dll/cpptoc/v8accessor_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8AccessorCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefV8AccessorCppToC();
 };
diff --git a/libcef_dll/cpptoc/v8context_cpptoc.cc b/libcef_dll/cpptoc/v8context_cpptoc.cc
index e2e86a15f..2dd8de226 100644
--- a/libcef_dll/cpptoc/v8context_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8context_cpptoc.cc
@@ -260,16 +260,17 @@ CefV8ContextCppToC::CefV8ContextCppToC() {
   GetStruct()->eval = v8context_eval;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_v8context_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_v8context_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8CONTEXT;
diff --git a/libcef_dll/cpptoc/v8context_cpptoc.h b/libcef_dll/cpptoc/v8context_cpptoc.h
index d58197fd4..053ac0343 100644
--- a/libcef_dll/cpptoc/v8context_cpptoc.h
+++ b/libcef_dll/cpptoc/v8context_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8ContextCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefV8ContextCppToC();
 };
diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.cc b/libcef_dll/cpptoc/v8exception_cpptoc.cc
index fffcdbb8c..c7c882765 100644
--- a/libcef_dll/cpptoc/v8exception_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8exception_cpptoc.cc
@@ -149,7 +149,7 @@ CefV8ExceptionCppToC::CefV8ExceptionCppToC() {
   GetStruct()->get_end_column = v8exception_get_end_column;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_v8exception_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -157,9 +157,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_V8EXCEPTION;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8EXCEPTION;
diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.h b/libcef_dll/cpptoc/v8exception_cpptoc.h
index b3b7fb777..a7aef090a 100644
--- a/libcef_dll/cpptoc/v8exception_cpptoc.h
+++ b/libcef_dll/cpptoc/v8exception_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8ExceptionCppToC
-    : public CefCppToC {
  public:
   CefV8ExceptionCppToC();
diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.cc b/libcef_dll/cpptoc/v8handler_cpptoc.cc
index c9efddbaf..1092fe5c8 100644
--- a/libcef_dll/cpptoc/v8handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8handler_cpptoc.cc
@@ -96,16 +96,17 @@ CefV8HandlerCppToC::CefV8HandlerCppToC() {
   GetStruct()->execute = v8handler_execute;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_v8handler_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_v8handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8HANDLER;
diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.h b/libcef_dll/cpptoc/v8handler_cpptoc.h
index 8c4c4c1fa..ccc9dd6eb 100644
--- a/libcef_dll/cpptoc/v8handler_cpptoc.h
+++ b/libcef_dll/cpptoc/v8handler_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8HandlerCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefV8HandlerCppToC();
 };
diff --git a/libcef_dll/cpptoc/v8interceptor_cpptoc.cc b/libcef_dll/cpptoc/v8interceptor_cpptoc.cc
index 82451d285..28d962237 100644
--- a/libcef_dll/cpptoc/v8interceptor_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8interceptor_cpptoc.cc
@@ -218,7 +218,7 @@ CefV8InterceptorCppToC::CefV8InterceptorCppToC() {
   GetStruct()->set_byindex = v8interceptor_set_byindex;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_v8interceptor_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -226,9 +226,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_V8INTERCEPTOR;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8INTERCEPTOR;
diff --git a/libcef_dll/cpptoc/v8interceptor_cpptoc.h b/libcef_dll/cpptoc/v8interceptor_cpptoc.h
index 143029c16..f2fbcbcae 100644
--- a/libcef_dll/cpptoc/v8interceptor_cpptoc.h
+++ b/libcef_dll/cpptoc/v8interceptor_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8InterceptorCppToC
-    : public CefCppToC {
  public:
   CefV8InterceptorCppToC();
diff --git a/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc b/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc
index c01c9e21f..7ec0f27d7 100644
--- a/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc
@@ -152,7 +152,7 @@ CefV8StackFrameCppToC::CefV8StackFrameCppToC() {
   GetStruct()->is_constructor = v8stack_frame_is_constructor;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_v8stack_frame_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -160,9 +160,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_V8STACK_FRAME;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8STACK_FRAME;
diff --git a/libcef_dll/cpptoc/v8stack_frame_cpptoc.h b/libcef_dll/cpptoc/v8stack_frame_cpptoc.h
index cf101fb03..a9dc2fefc 100644
--- a/libcef_dll/cpptoc/v8stack_frame_cpptoc.h
+++ b/libcef_dll/cpptoc/v8stack_frame_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8StackFrameCppToC
-    : public CefCppToC {
  public:
   CefV8StackFrameCppToC();
diff --git a/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc b/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc
index fbaaabf71..b8d89bd2d 100644
--- a/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc
@@ -89,7 +89,7 @@ CefV8StackTraceCppToC::CefV8StackTraceCppToC() {
   GetStruct()->get_frame = v8stack_trace_get_frame;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_v8stack_trace_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -97,9 +97,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_V8STACK_TRACE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8STACK_TRACE;
diff --git a/libcef_dll/cpptoc/v8stack_trace_cpptoc.h b/libcef_dll/cpptoc/v8stack_trace_cpptoc.h
index 2fb54980e..946de7448 100644
--- a/libcef_dll/cpptoc/v8stack_trace_cpptoc.h
+++ b/libcef_dll/cpptoc/v8stack_trace_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8StackTraceCppToC
-    : public CefCppToC {
  public:
   CefV8StackTraceCppToC();
diff --git a/libcef_dll/cpptoc/v8value_cpptoc.cc b/libcef_dll/cpptoc/v8value_cpptoc.cc
index deadc191a..379294eae 100644
--- a/libcef_dll/cpptoc/v8value_cpptoc.cc
+++ b/libcef_dll/cpptoc/v8value_cpptoc.cc
@@ -13,7 +13,7 @@
 #include "libcef_dll/cpptoc/v8context_cpptoc.h"
 #include "libcef_dll/cpptoc/v8exception_cpptoc.h"
 #include "libcef_dll/cpptoc/v8value_cpptoc.h"
-#include "libcef_dll/ctocpp/base_ctocpp.h"
+#include "libcef_dll/ctocpp/base_ref_counted_ctocpp.h"
 #include "libcef_dll/ctocpp/v8accessor_ctocpp.h"
 #include "libcef_dll/ctocpp/v8handler_ctocpp.h"
 #include "libcef_dll/ctocpp/v8interceptor_ctocpp.h"
@@ -741,7 +741,7 @@ int CEF_CALLBACK v8value_get_keys(struct _cef_v8value_t* self,
 }
 
 int CEF_CALLBACK v8value_set_user_data(struct _cef_v8value_t* self,
-    cef_base_t* user_data) {
+    cef_base_ref_counted_t* user_data) {
   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
 
   DCHECK(self);
@@ -751,13 +751,14 @@ int CEF_CALLBACK v8value_set_user_data(struct _cef_v8value_t* self,
 
   // Execute
   bool _retval = CefV8ValueCppToC::Get(self)->SetUserData(
-      CefBaseCToCpp::Wrap(user_data));
+      CefBaseRefCountedCToCpp::Wrap(user_data));
 
   // Return type: bool
   return _retval;
 }
 
-cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) {
+cef_base_ref_counted_t* CEF_CALLBACK v8value_get_user_data(
+    struct _cef_v8value_t* self) {
   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
 
   DCHECK(self);
@@ -765,10 +766,11 @@ cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) {
     return NULL;
 
   // Execute
-  CefRefPtr _retval = CefV8ValueCppToC::Get(self)->GetUserData();
+  CefRefPtr _retval = CefV8ValueCppToC::Get(
+      self)->GetUserData();
 
   // Return type: refptr_diff
-  return CefBaseCToCpp::Unwrap(_retval);
+  return CefBaseRefCountedCToCpp::Unwrap(_retval);
 }
 
 int CEF_CALLBACK v8value_get_externally_allocated_memory(
@@ -975,16 +977,17 @@ CefV8ValueCppToC::CefV8ValueCppToC() {
       v8value_execute_function_with_context;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_v8value_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_v8value_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_V8VALUE;
diff --git a/libcef_dll/cpptoc/v8value_cpptoc.h b/libcef_dll/cpptoc/v8value_cpptoc.h
index fe5048a1e..9a01b4704 100644
--- a/libcef_dll/cpptoc/v8value_cpptoc.h
+++ b/libcef_dll/cpptoc/v8value_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8ValueCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefV8ValueCppToC();
 };
diff --git a/libcef_dll/cpptoc/value_cpptoc.cc b/libcef_dll/cpptoc/value_cpptoc.cc
index d24e417e6..2e65b608e 100644
--- a/libcef_dll/cpptoc/value_cpptoc.cc
+++ b/libcef_dll/cpptoc/value_cpptoc.cc
@@ -411,16 +411,16 @@ CefValueCppToC::CefValueCppToC() {
   GetStruct()->set_list = value_set_list;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_value_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_VALUE;
diff --git a/libcef_dll/cpptoc/value_cpptoc.h b/libcef_dll/cpptoc/value_cpptoc.h
index 57185aaf6..0704da724 100644
--- a/libcef_dll/cpptoc/value_cpptoc.h
+++ b/libcef_dll/cpptoc/value_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefValueCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefValueCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/box_layout_cpptoc.cc b/libcef_dll/cpptoc/views/box_layout_cpptoc.cc
index fd2c2a8bd..aaf01e3a6 100644
--- a/libcef_dll/cpptoc/views/box_layout_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/box_layout_cpptoc.cc
@@ -114,17 +114,17 @@ CefBoxLayoutCppToC::CefBoxLayoutCppToC() {
   GetStruct()->base.is_valid = box_layout_is_valid;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type,
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_box_layout_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BOX_LAYOUT;
diff --git a/libcef_dll/cpptoc/views/box_layout_cpptoc.h b/libcef_dll/cpptoc/views/box_layout_cpptoc.h
index 416b77062..1de9e7840 100644
--- a/libcef_dll/cpptoc/views/box_layout_cpptoc.h
+++ b/libcef_dll/cpptoc/views/box_layout_cpptoc.h
@@ -22,12 +22,13 @@
 #include "include/capi/views/cef_box_layout_capi.h"
 #include "include/views/cef_view.h"
 #include "include/capi/views/cef_view_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefBoxLayoutCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefBoxLayoutCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/browser_view_cpptoc.cc b/libcef_dll/cpptoc/views/browser_view_cpptoc.cc
index 0d7c37b9d..21cf0e085 100644
--- a/libcef_dll/cpptoc/views/browser_view_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/browser_view_cpptoc.cc
@@ -960,7 +960,7 @@ CefBrowserViewCppToC::CefBrowserViewCppToC() {
       browser_view_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_browser_view_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -968,9 +968,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_BROWSER_VIEW;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BROWSER_VIEW;
diff --git a/libcef_dll/cpptoc/views/browser_view_cpptoc.h b/libcef_dll/cpptoc/views/browser_view_cpptoc.h
index 1118d76f2..0afb58c3a 100644
--- a/libcef_dll/cpptoc/views/browser_view_cpptoc.h
+++ b/libcef_dll/cpptoc/views/browser_view_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/views/cef_browser_view.h"
 #include "include/capi/views/cef_browser_view_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefBrowserViewCppToC
-    : public CefCppToC {
  public:
   CefBrowserViewCppToC();
diff --git a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc
index 0b661bfe5..f7a14b401 100644
--- a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.cc
@@ -295,7 +295,7 @@ CefBrowserViewDelegateCppToC::CefBrowserViewDelegateCppToC() {
       browser_view_delegate_on_child_view_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_browser_view_delegate_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -303,10 +303,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_BROWSER_VIEW_DELEGATE;
diff --git a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h
index fd6e9dfa5..15799a91c 100644
--- a/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/views/browser_view_delegate_cpptoc.h
@@ -24,13 +24,13 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/views/cef_browser_view.h"
 #include "include/capi/views/cef_browser_view_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBrowserViewDelegateCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefBrowserViewDelegateCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/button_cpptoc.cc b/libcef_dll/cpptoc/views/button_cpptoc.cc
index 68ae89551..a94e01a31 100644
--- a/libcef_dll/cpptoc/views/button_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/button_cpptoc.cc
@@ -953,7 +953,7 @@ CefButtonCppToC::CefButtonCppToC() {
   GetStruct()->base.convert_point_from_view = button_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_button_t* s) {
   if (type == WT_LABEL_BUTTON) {
     return CefLabelButtonCppToC::Unwrap(reinterpret_cast(
@@ -967,9 +967,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_BUTTON;
diff --git a/libcef_dll/cpptoc/views/button_cpptoc.h b/libcef_dll/cpptoc/views/button_cpptoc.h
index 6ddac9720..3ce365002 100644
--- a/libcef_dll/cpptoc/views/button_cpptoc.h
+++ b/libcef_dll/cpptoc/views/button_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_button_capi.h"
 #include "include/views/cef_label_button.h"
 #include "include/capi/views/cef_label_button_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefButtonCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefButtonCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc
index 8e0380570..5ddb2f25e 100644
--- a/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/button_delegate_cpptoc.cc
@@ -189,7 +189,7 @@ CefButtonDelegateCppToC::CefButtonDelegateCppToC() {
       button_delegate_on_child_view_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_button_delegate_t* s) {
   if (type == WT_MENU_BUTTON_DELEGATE) {
@@ -201,9 +201,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_BUTTON_DELEGATE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_BUTTON_DELEGATE;
diff --git a/libcef_dll/cpptoc/views/button_delegate_cpptoc.h b/libcef_dll/cpptoc/views/button_delegate_cpptoc.h
index 9a545a9ed..add0ecf89 100644
--- a/libcef_dll/cpptoc/views/button_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/views/button_delegate_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_button_delegate_capi.h"
 #include "include/views/cef_button.h"
 #include "include/capi/views/cef_button_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefButtonDelegateCppToC
-    : public CefCppToC {
  public:
   CefButtonDelegateCppToC();
diff --git a/libcef_dll/cpptoc/views/display_cpptoc.cc b/libcef_dll/cpptoc/views/display_cpptoc.cc
index 4813204e8..760a08ebc 100644
--- a/libcef_dll/cpptoc/views/display_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/display_cpptoc.cc
@@ -249,16 +249,17 @@ CefDisplayCppToC::CefDisplayCppToC() {
   GetStruct()->get_rotation = display_get_rotation;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_display_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_display_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_DISPLAY;
diff --git a/libcef_dll/cpptoc/views/display_cpptoc.h b/libcef_dll/cpptoc/views/display_cpptoc.h
index 65398cddf..6faa6a1ad 100644
--- a/libcef_dll/cpptoc/views/display_cpptoc.h
+++ b/libcef_dll/cpptoc/views/display_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/views/cef_display.h"
 #include "include/capi/views/cef_display_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefDisplayCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefDisplayCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc b/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc
index 8eb609ea4..08aa865ad 100644
--- a/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/fill_layout_cpptoc.cc
@@ -76,7 +76,7 @@ CefFillLayoutCppToC::CefFillLayoutCppToC() {
   GetStruct()->base.is_valid = fill_layout_is_valid;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_fill_layout_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -84,9 +84,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_FILL_LAYOUT;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_FILL_LAYOUT;
diff --git a/libcef_dll/cpptoc/views/fill_layout_cpptoc.h b/libcef_dll/cpptoc/views/fill_layout_cpptoc.h
index 00456881d..60c25c6a5 100644
--- a/libcef_dll/cpptoc/views/fill_layout_cpptoc.h
+++ b/libcef_dll/cpptoc/views/fill_layout_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_fill_layout.h"
 #include "include/capi/views/cef_fill_layout_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefFillLayoutCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefFillLayoutCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/label_button_cpptoc.cc b/libcef_dll/cpptoc/views/label_button_cpptoc.cc
index 617fa7f80..24b62d9d0 100644
--- a/libcef_dll/cpptoc/views/label_button_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/label_button_cpptoc.cc
@@ -1198,7 +1198,7 @@ CefLabelButtonCppToC::CefLabelButtonCppToC() {
       label_button_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_label_button_t* s) {
   if (type == WT_MENU_BUTTON) {
@@ -1209,9 +1209,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_LABEL_BUTTON;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LABEL_BUTTON;
diff --git a/libcef_dll/cpptoc/views/label_button_cpptoc.h b/libcef_dll/cpptoc/views/label_button_cpptoc.h
index a82b1988d..d3a0ca2e3 100644
--- a/libcef_dll/cpptoc/views/label_button_cpptoc.h
+++ b/libcef_dll/cpptoc/views/label_button_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_label_button_capi.h"
 #include "include/views/cef_menu_button.h"
 #include "include/capi/views/cef_menu_button_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefLabelButtonCppToC
-    : public CefCppToC {
  public:
   CefLabelButtonCppToC();
diff --git a/libcef_dll/cpptoc/views/layout_cpptoc.cc b/libcef_dll/cpptoc/views/layout_cpptoc.cc
index 1d98c6cb4..1ec3283fa 100644
--- a/libcef_dll/cpptoc/views/layout_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/layout_cpptoc.cc
@@ -74,7 +74,7 @@ CefLayoutCppToC::CefLayoutCppToC() {
   GetStruct()->is_valid = layout_is_valid;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_layout_t* s) {
   if (type == WT_BOX_LAYOUT) {
     return CefBoxLayoutCppToC::Unwrap(reinterpret_cast(s));
@@ -87,9 +87,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_LAYOUT;
diff --git a/libcef_dll/cpptoc/views/layout_cpptoc.h b/libcef_dll/cpptoc/views/layout_cpptoc.h
index a9b3838ae..bb8347afa 100644
--- a/libcef_dll/cpptoc/views/layout_cpptoc.h
+++ b/libcef_dll/cpptoc/views/layout_cpptoc.h
@@ -24,12 +24,12 @@
 #include "include/capi/views/cef_box_layout_capi.h"
 #include "include/views/cef_fill_layout.h"
 #include "include/capi/views/cef_fill_layout_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefLayoutCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefLayoutCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/menu_button_cpptoc.cc b/libcef_dll/cpptoc/views/menu_button_cpptoc.cc
index 22b4fed0c..1a9247f42 100644
--- a/libcef_dll/cpptoc/views/menu_button_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/menu_button_cpptoc.cc
@@ -1236,7 +1236,7 @@ CefMenuButtonCppToC::CefMenuButtonCppToC() {
       menu_button_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_menu_button_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -1244,9 +1244,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_MENU_BUTTON;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_MENU_BUTTON;
diff --git a/libcef_dll/cpptoc/views/menu_button_cpptoc.h b/libcef_dll/cpptoc/views/menu_button_cpptoc.h
index 609f56e82..d45ea6aa4 100644
--- a/libcef_dll/cpptoc/views/menu_button_cpptoc.h
+++ b/libcef_dll/cpptoc/views/menu_button_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_menu_button.h"
 #include "include/capi/views/cef_menu_button_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefMenuButtonCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefMenuButtonCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc
index 0ee13ff66..b71d8cc03 100644
--- a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.cc
@@ -222,7 +222,7 @@ CefMenuButtonDelegateCppToC::CefMenuButtonDelegateCppToC() {
       menu_button_delegate_on_child_view_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_menu_button_delegate_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -230,10 +230,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_MENU_BUTTON_DELEGATE;
diff --git a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h
index ebdaf8817..339320471 100644
--- a/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h
@@ -22,13 +22,13 @@
 #include "include/capi/views/cef_menu_button_delegate_capi.h"
 #include "include/views/cef_menu_button.h"
 #include "include/capi/views/cef_menu_button_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefMenuButtonDelegateCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefMenuButtonDelegateCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/panel_cpptoc.cc b/libcef_dll/cpptoc/views/panel_cpptoc.cc
index 37ce92772..a0d635907 100644
--- a/libcef_dll/cpptoc/views/panel_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/panel_cpptoc.cc
@@ -1095,7 +1095,7 @@ CefPanelCppToC::CefPanelCppToC() {
   GetStruct()->base.convert_point_from_view = panel_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_panel_t* s) {
   if (type == WT_WINDOW) {
     return CefWindowCppToC::Unwrap(reinterpret_cast(s));
@@ -1105,9 +1105,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PANEL;
diff --git a/libcef_dll/cpptoc/views/panel_cpptoc.h b/libcef_dll/cpptoc/views/panel_cpptoc.h
index 6edff1d73..0bf452265 100644
--- a/libcef_dll/cpptoc/views/panel_cpptoc.h
+++ b/libcef_dll/cpptoc/views/panel_cpptoc.h
@@ -28,12 +28,12 @@
 #include "include/capi/views/cef_layout_capi.h"
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefPanelCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefPanelCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc
index 59beae3f4..c730b0d59 100644
--- a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.cc
@@ -170,7 +170,7 @@ CefPanelDelegateCppToC::CefPanelDelegateCppToC() {
       panel_delegate_on_child_view_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_panel_delegate_t* s) {
   if (type == WT_WINDOW_DELEGATE) {
@@ -182,9 +182,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_PANEL_DELEGATE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_PANEL_DELEGATE;
diff --git a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h
index fb5c8373e..562dacf1f 100644
--- a/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/views/panel_delegate_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/views/cef_panel_delegate.h"
 #include "include/capi/views/cef_panel_delegate_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPanelDelegateCppToC
-    : public CefCppToC {
  public:
   CefPanelDelegateCppToC();
diff --git a/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc b/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc
index 675b10e66..68979dd45 100644
--- a/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/scroll_view_cpptoc.cc
@@ -1019,7 +1019,7 @@ CefScrollViewCppToC::CefScrollViewCppToC() {
       scroll_view_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_scroll_view_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -1027,9 +1027,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_SCROLL_VIEW;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_SCROLL_VIEW;
diff --git a/libcef_dll/cpptoc/views/scroll_view_cpptoc.h b/libcef_dll/cpptoc/views/scroll_view_cpptoc.h
index 098148118..64a126b27 100644
--- a/libcef_dll/cpptoc/views/scroll_view_cpptoc.h
+++ b/libcef_dll/cpptoc/views/scroll_view_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_scroll_view.h"
 #include "include/capi/views/cef_scroll_view_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefScrollViewCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefScrollViewCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/textfield_cpptoc.cc b/libcef_dll/cpptoc/views/textfield_cpptoc.cc
index 805e766f1..89c942f94 100644
--- a/libcef_dll/cpptoc/views/textfield_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/textfield_cpptoc.cc
@@ -1398,16 +1398,17 @@ CefTextfieldCppToC::CefTextfieldCppToC() {
   GetStruct()->base.convert_point_from_view = textfield_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_textfield_t* s) {
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
+    cef_textfield_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_TEXTFIELD;
diff --git a/libcef_dll/cpptoc/views/textfield_cpptoc.h b/libcef_dll/cpptoc/views/textfield_cpptoc.h
index a83a483d8..69c55eaaf 100644
--- a/libcef_dll/cpptoc/views/textfield_cpptoc.h
+++ b/libcef_dll/cpptoc/views/textfield_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_textfield.h"
 #include "include/capi/views/cef_textfield_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefTextfieldCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefTextfieldCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc
index c69b04994..b7fde4309 100644
--- a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.cc
@@ -221,7 +221,7 @@ CefTextfieldDelegateCppToC::CefTextfieldDelegateCppToC() {
       textfield_delegate_on_child_view_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_textfield_delegate_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -229,10 +229,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_TEXTFIELD_DELEGATE;
diff --git a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h
index f32109311..6fcf88934 100644
--- a/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/views/textfield_delegate_cpptoc.h
@@ -22,13 +22,13 @@
 #include "include/capi/views/cef_textfield_delegate_capi.h"
 #include "include/views/cef_textfield.h"
 #include "include/capi/views/cef_textfield_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTextfieldDelegateCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefTextfieldDelegateCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/view_cpptoc.cc b/libcef_dll/cpptoc/views/view_cpptoc.cc
index 8a3bdc83c..c08f1dc9d 100644
--- a/libcef_dll/cpptoc/views/view_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/view_cpptoc.cc
@@ -828,7 +828,7 @@ CefViewCppToC::CefViewCppToC() {
   GetStruct()->convert_point_from_view = view_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_view_t* s) {
   if (type == WT_BROWSER_VIEW) {
     return CefBrowserViewCppToC::Unwrap(reinterpret_cast(
@@ -861,9 +861,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_VIEW;
diff --git a/libcef_dll/cpptoc/views/view_cpptoc.h b/libcef_dll/cpptoc/views/view_cpptoc.h
index 37c92c176..ca36f9f7f 100644
--- a/libcef_dll/cpptoc/views/view_cpptoc.h
+++ b/libcef_dll/cpptoc/views/view_cpptoc.h
@@ -32,12 +32,12 @@
 #include "include/capi/views/cef_textfield_capi.h"
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefViewCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefViewCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc
index db97fd30d..74c7ca9f2 100644
--- a/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/view_delegate_cpptoc.cc
@@ -167,7 +167,7 @@ CefViewDelegateCppToC::CefViewDelegateCppToC() {
   GetStruct()->on_child_view_changed = view_delegate_on_child_view_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_view_delegate_t* s) {
   if (type == WT_BROWSER_VIEW_DELEGATE) {
@@ -199,9 +199,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_VIEW_DELEGATE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_VIEW_DELEGATE;
diff --git a/libcef_dll/cpptoc/views/view_delegate_cpptoc.h b/libcef_dll/cpptoc/views/view_delegate_cpptoc.h
index 5b555dd58..38011f155 100644
--- a/libcef_dll/cpptoc/views/view_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/views/view_delegate_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_view_delegate_capi.h"
 #include "include/views/cef_view.h"
 #include "include/capi/views/cef_view_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefViewDelegateCppToC
-    : public CefCppToC {
  public:
   CefViewDelegateCppToC();
diff --git a/libcef_dll/cpptoc/views/window_cpptoc.cc b/libcef_dll/cpptoc/views/window_cpptoc.cc
index dbfd1ef2b..83e2fdfe8 100644
--- a/libcef_dll/cpptoc/views/window_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/window_cpptoc.cc
@@ -1616,16 +1616,16 @@ CefWindowCppToC::CefWindowCppToC() {
       window_convert_point_from_view;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type, cef_window_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WINDOW;
diff --git a/libcef_dll/cpptoc/views/window_cpptoc.h b/libcef_dll/cpptoc/views/window_cpptoc.h
index 207d12bdf..3af127f6c 100644
--- a/libcef_dll/cpptoc/views/window_cpptoc.h
+++ b/libcef_dll/cpptoc/views/window_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefWindowCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefWindowCppToC();
 };
diff --git a/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc b/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc
index 37481e960..5f1679d16 100644
--- a/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc
+++ b/libcef_dll/cpptoc/views/window_delegate_cpptoc.cc
@@ -313,7 +313,7 @@ CefWindowDelegateCppToC::CefWindowDelegateCppToC() {
       window_delegate_on_child_view_changed;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_window_delegate_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -321,9 +321,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_WINDOW_DELEGATE;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_WINDOW_DELEGATE;
diff --git a/libcef_dll/cpptoc/views/window_delegate_cpptoc.h b/libcef_dll/cpptoc/views/window_delegate_cpptoc.h
index edd5239a7..f37db11ec 100644
--- a/libcef_dll/cpptoc/views/window_delegate_cpptoc.h
+++ b/libcef_dll/cpptoc/views/window_delegate_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_window_delegate_capi.h"
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefWindowDelegateCppToC
-    : public CefCppToC {
  public:
   CefWindowDelegateCppToC();
diff --git a/libcef_dll/cpptoc/waitable_event_cpptoc.cc b/libcef_dll/cpptoc/waitable_event_cpptoc.cc
index 8a9935920..d51973710 100644
--- a/libcef_dll/cpptoc/waitable_event_cpptoc.cc
+++ b/libcef_dll/cpptoc/waitable_event_cpptoc.cc
@@ -110,7 +110,7 @@ CefWaitableEventCppToC::CefWaitableEventCppToC() {
   GetStruct()->timed_wait = waitable_event_timed_wait;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_waitable_event_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -118,9 +118,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_WAITABLE_EVENT;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WAITABLE_EVENT;
diff --git a/libcef_dll/cpptoc/waitable_event_cpptoc.h b/libcef_dll/cpptoc/waitable_event_cpptoc.h
index 9b5cf32a1..947196852 100644
--- a/libcef_dll/cpptoc/waitable_event_cpptoc.h
+++ b/libcef_dll/cpptoc/waitable_event_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_waitable_event.h"
 #include "include/capi/cef_waitable_event_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefWaitableEventCppToC
-    : public CefCppToC {
  public:
   CefWaitableEventCppToC();
diff --git a/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc
index 9c1d15fc9..26dad803e 100644
--- a/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc
+++ b/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc
@@ -89,7 +89,7 @@ CefWebPluginInfoCppToC::CefWebPluginInfoCppToC() {
   GetStruct()->get_description = web_plugin_info_get_description;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_web_plugin_info_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -97,9 +97,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_WEB_PLUGIN_INFO;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType =
+    WT_WEB_PLUGIN_INFO;
diff --git a/libcef_dll/cpptoc/web_plugin_info_cpptoc.h b/libcef_dll/cpptoc/web_plugin_info_cpptoc.h
index 41062916c..2016dd56c 100644
--- a/libcef_dll/cpptoc/web_plugin_info_cpptoc.h
+++ b/libcef_dll/cpptoc/web_plugin_info_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefWebPluginInfoCppToC
-    : public CefCppToC {
  public:
   CefWebPluginInfoCppToC();
diff --git a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc
index 615b27e1b..020f18073 100644
--- a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc
+++ b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc
@@ -50,7 +50,7 @@ CefWebPluginInfoVisitorCppToC::CefWebPluginInfoVisitorCppToC() {
   GetStruct()->visit = web_plugin_info_visitor_visit;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_web_plugin_info_visitor_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -58,10 +58,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_WEB_PLUGIN_INFO_VISITOR;
diff --git a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h
index d71cda7e6..d0891731a 100644
--- a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h
+++ b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefWebPluginInfoVisitorCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefWebPluginInfoVisitorCppToC();
 };
diff --git a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc
index 8561fa285..bf8cc7698 100644
--- a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc
+++ b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc
@@ -45,7 +45,7 @@ CefWebPluginUnstableCallbackCppToC::CefWebPluginUnstableCallbackCppToC() {
   GetStruct()->is_unstable = web_plugin_unstable_callback_is_unstable;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_web_plugin_unstable_callback_t* s) {
@@ -54,12 +54,12 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_WEB_PLUGIN_UNSTABLE_CALLBACK;
diff --git a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h
index a29e78658..08ad2373f 100644
--- a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h
+++ b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefWebPluginUnstableCallbackCppToC
-    : public CefCppToC {
  public:
   CefWebPluginUnstableCallbackCppToC();
diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.cc b/libcef_dll/cpptoc/write_handler_cpptoc.cc
index 23d209e30..270f3beb3 100644
--- a/libcef_dll/cpptoc/write_handler_cpptoc.cc
+++ b/libcef_dll/cpptoc/write_handler_cpptoc.cc
@@ -111,7 +111,7 @@ CefWriteHandlerCppToC::CefWriteHandlerCppToC() {
   GetStruct()->may_block = write_handler_may_block;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_write_handler_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -119,9 +119,9 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC::kWrapperType = WT_WRITE_HANDLER;
+template<> CefWrapperType CefCppToCRefCounted::kWrapperType = WT_WRITE_HANDLER;
diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.h b/libcef_dll/cpptoc/write_handler_cpptoc.h
index a6280db0a..68bb56b30 100644
--- a/libcef_dll/cpptoc/write_handler_cpptoc.h
+++ b/libcef_dll/cpptoc/write_handler_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed wrapper-side only.
 class CefWriteHandlerCppToC
-    : public CefCppToC {
  public:
   CefWriteHandlerCppToC();
diff --git a/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc b/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc
index 87a1f642e..b5bdcc899 100644
--- a/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc
+++ b/libcef_dll/cpptoc/x509cert_principal_cpptoc.cc
@@ -214,7 +214,7 @@ CefX509CertPrincipalCppToC::CefX509CertPrincipalCppToC() {
   GetStruct()->get_domain_components = x509cert_principal_get_domain_components;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_x509cert_principal_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -222,10 +222,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_X509CERT_PRINCIPAL;
diff --git a/libcef_dll/cpptoc/x509cert_principal_cpptoc.h b/libcef_dll/cpptoc/x509cert_principal_cpptoc.h
index b068beaf7..a586206fe 100644
--- a/libcef_dll/cpptoc/x509cert_principal_cpptoc.h
+++ b/libcef_dll/cpptoc/x509cert_principal_cpptoc.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_x509_certificate.h"
 #include "include/capi/cef_x509_certificate_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefX509CertPrincipalCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefX509CertPrincipalCppToC();
 };
diff --git a/libcef_dll/cpptoc/x509certificate_cpptoc.cc b/libcef_dll/cpptoc/x509certificate_cpptoc.cc
index dc1429040..16405fd46 100644
--- a/libcef_dll/cpptoc/x509certificate_cpptoc.cc
+++ b/libcef_dll/cpptoc/x509certificate_cpptoc.cc
@@ -237,7 +237,7 @@ CefX509CertificateCppToC::CefX509CertificateCppToC() {
       x509certificate_get_pemencoded_issuer_chain;
 }
 
-template<> CefRefPtr CefCppToC CefRefPtr CefCppToCRefCounted::UnwrapDerived(
     CefWrapperType type, cef_x509certificate_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -245,10 +245,10 @@ template<> CefRefPtr CefCppToC base::AtomicRefCount CefCppToC base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType =
     WT_X509CERTIFICATE;
diff --git a/libcef_dll/cpptoc/x509certificate_cpptoc.h b/libcef_dll/cpptoc/x509certificate_cpptoc.h
index 50a724281..76f9b04d6 100644
--- a/libcef_dll/cpptoc/x509certificate_cpptoc.h
+++ b/libcef_dll/cpptoc/x509certificate_cpptoc.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_x509_certificate.h"
 #include "include/capi/cef_x509_certificate_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefX509CertificateCppToC
-    : public CefCppToC {
  public:
   CefX509CertificateCppToC();
diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.cc b/libcef_dll/cpptoc/xml_reader_cpptoc.cc
index 9ba0f916d..a640e24c7 100644
--- a/libcef_dll/cpptoc/xml_reader_cpptoc.cc
+++ b/libcef_dll/cpptoc/xml_reader_cpptoc.cc
@@ -550,17 +550,17 @@ CefXmlReaderCppToC::CefXmlReaderCppToC() {
   GetStruct()->move_to_carrying_element = xml_reader_move_to_carrying_element;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type,
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_xml_reader_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_XML_READER;
diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.h b/libcef_dll/cpptoc/xml_reader_cpptoc.h
index 8a13b6158..b119cb86b 100644
--- a/libcef_dll/cpptoc/xml_reader_cpptoc.h
+++ b/libcef_dll/cpptoc/xml_reader_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_xml_reader.h"
 #include "include/capi/cef_xml_reader_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefXmlReaderCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefXmlReaderCppToC();
 };
diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.cc b/libcef_dll/cpptoc/zip_reader_cpptoc.cc
index 972bcf788..c6ae74e63 100644
--- a/libcef_dll/cpptoc/zip_reader_cpptoc.cc
+++ b/libcef_dll/cpptoc/zip_reader_cpptoc.cc
@@ -245,17 +245,17 @@ CefZipReaderCppToC::CefZipReaderCppToC() {
   GetStruct()->eof = zip_reader_eof;
 }
 
-template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type,
+template<> CefRefPtr CefCppToCRefCounted::UnwrapDerived(CefWrapperType type,
     cef_zip_reader_t* s) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCppToCRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCppToC CefWrapperType CefCppToCRefCounted::kWrapperType = WT_ZIP_READER;
diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.h b/libcef_dll/cpptoc/zip_reader_cpptoc.h
index 19252921a..6e01bd3c6 100644
--- a/libcef_dll/cpptoc/zip_reader_cpptoc.h
+++ b/libcef_dll/cpptoc/zip_reader_cpptoc.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_zip_reader.h"
 #include "include/capi/cef_zip_reader_capi.h"
-#include "libcef_dll/cpptoc/cpptoc.h"
+#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
 
 // Wrap a C++ class with a C structure.
 // This class may be instantiated and accessed DLL-side only.
 class CefZipReaderCppToC
-    : public CefCppToC {
+    : public CefCppToCRefCounted {
  public:
   CefZipReaderCppToC();
 };
diff --git a/libcef_dll/ctocpp/app_ctocpp.cc b/libcef_dll/ctocpp/app_ctocpp.cc
index 43c4e2e5a..0e840f0d8 100644
--- a/libcef_dll/ctocpp/app_ctocpp.cc
+++ b/libcef_dll/ctocpp/app_ctocpp.cc
@@ -113,16 +113,16 @@ CefRefPtr CefAppCToCpp::GetRenderProcessHandler() {
 CefAppCToCpp::CefAppCToCpp() {
 }
 
-template<> cef_app_t* CefCToCpp::UnwrapDerived(
-    CefWrapperType type, CefApp* c) {
+template<> cef_app_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefApp* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_APP;
diff --git a/libcef_dll/ctocpp/app_ctocpp.h b/libcef_dll/ctocpp/app_ctocpp.h
index 2f6975e56..287dfa2f9 100644
--- a/libcef_dll/ctocpp/app_ctocpp.h
+++ b/libcef_dll/ctocpp/app_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_app.h"
 #include "include/capi/cef_app_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefAppCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefAppCToCpp();
 
diff --git a/libcef_dll/ctocpp/auth_callback_ctocpp.cc b/libcef_dll/ctocpp/auth_callback_ctocpp.cc
index 1a99f23e4..1b8810f96 100644
--- a/libcef_dll/ctocpp/auth_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/auth_callback_ctocpp.cc
@@ -55,7 +55,7 @@ void CefAuthCallbackCToCpp::Cancel() {
 CefAuthCallbackCToCpp::CefAuthCallbackCToCpp() {
 }
 
-template<> cef_auth_callback_t* CefCToCpp cef_auth_callback_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefAuthCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -63,9 +63,9 @@ template<> cef_auth_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_AUTH_CALLBACK;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_AUTH_CALLBACK;
diff --git a/libcef_dll/ctocpp/auth_callback_ctocpp.h b/libcef_dll/ctocpp/auth_callback_ctocpp.h
index f50533cab..69ce967dc 100644
--- a/libcef_dll/ctocpp/auth_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/auth_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_auth_callback.h"
 #include "include/capi/cef_auth_callback_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefAuthCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefAuthCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/base_ctocpp.cc b/libcef_dll/ctocpp/base_ctocpp.cc
deleted file mode 100644
index 31e7bfcfa..000000000
--- a/libcef_dll/ctocpp/base_ctocpp.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-#include "libcef_dll/ctocpp/base_ctocpp.h"
-
-CefBaseCToCpp::CefBaseCToCpp() {
-}
-
-template<> cef_base_t* CefCToCpp::
-    UnwrapDerived(CefWrapperType type, CefBase* c) {
-  NOTREACHED();
-  return NULL;
-}
-
-#if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
-#endif
-
-template<> CefWrapperType CefCToCpp::
-    kWrapperType = WT_BASE;
diff --git a/libcef_dll/ctocpp/base_ctocpp.h b/libcef_dll/ctocpp/base_ctocpp.h
deleted file mode 100644
index 07051c3c7..000000000
--- a/libcef_dll/ctocpp/base_ctocpp.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
-// reserved. Use of this source code is governed by a BSD-style license that
-// can be found in the LICENSE file.
-
-#ifndef CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_
-#define CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_
-#pragma once
-
-#include "include/cef_base.h"
-#include "include/capi/cef_base_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
-
-#if !defined(BUILDING_CEF_SHARED)
-#error This file can be included DLL-side only
-#endif
-
-// Wrap a C structure with a C++ class.
-class CefBaseCToCpp
-    : public CefCToCpp {
- public:
-  CefBaseCToCpp();
-};
-
-#endif  // CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_
diff --git a/libcef_dll/ctocpp/base_ref_counted_ctocpp.cc b/libcef_dll/ctocpp/base_ref_counted_ctocpp.cc
new file mode 100644
index 000000000..90b8377bb
--- /dev/null
+++ b/libcef_dll/ctocpp/base_ref_counted_ctocpp.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+#include "libcef_dll/ctocpp/base_ref_counted_ctocpp.h"
+
+CefBaseRefCountedCToCpp::CefBaseRefCountedCToCpp() {
+}
+
+template<> cef_base_ref_counted_t* CefCToCppRefCounted::UnwrapDerived(
+    CefWrapperType type, CefBaseRefCounted* c) {
+  NOTREACHED();
+  return NULL;
+}
+
+#if DCHECK_IS_ON()
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
+#endif
+
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_BASE_REF_COUNTED;
diff --git a/libcef_dll/ctocpp/base_ref_counted_ctocpp.h b/libcef_dll/ctocpp/base_ref_counted_ctocpp.h
new file mode 100644
index 000000000..fce82f05d
--- /dev/null
+++ b/libcef_dll/ctocpp/base_ref_counted_ctocpp.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
+// reserved. Use of this source code is governed by a BSD-style license that
+// can be found in the LICENSE file.
+
+#ifndef CEF_LIBCEF_DLL_CTOCPP_BASE_REF_COUNTED_CTOCPP_H_
+#define CEF_LIBCEF_DLL_CTOCPP_BASE_REF_COUNTED_CTOCPP_H_
+#pragma once
+
+#include "include/cef_base.h"
+#include "include/capi/cef_base_capi.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
+
+#if !defined(BUILDING_CEF_SHARED)
+#error This file can be included DLL-side only
+#endif
+
+// Wrap a C structure with a C++ class.
+class CefBaseRefCountedCToCpp
+    : public CefCToCppRefCounted {
+ public:
+  CefBaseRefCountedCToCpp();
+};
+
+#endif  // CEF_LIBCEF_DLL_CTOCPP_BASE_REF_COUNTED_CTOCPP_H_
diff --git a/libcef_dll/ctocpp/base_scoped_ctocpp.cc b/libcef_dll/ctocpp/base_scoped_ctocpp.cc
index 2ee3a70c8..40d94e56d 100644
--- a/libcef_dll/ctocpp/base_scoped_ctocpp.cc
+++ b/libcef_dll/ctocpp/base_scoped_ctocpp.cc
@@ -27,4 +27,4 @@ template<> base::AtomicRefCount CefCToCppScoped CefWrapperType CefCToCppScoped::kWrapperType = WT_BASE;
+    CefBaseScoped, cef_base_scoped_t>::kWrapperType = WT_BASE_SCOPED;
diff --git a/libcef_dll/ctocpp/before_download_callback_ctocpp.cc b/libcef_dll/ctocpp/before_download_callback_ctocpp.cc
index ac4ca2954..ebf19c82f 100644
--- a/libcef_dll/ctocpp/before_download_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/before_download_callback_ctocpp.cc
@@ -37,7 +37,7 @@ void CefBeforeDownloadCallbackCToCpp::Continue(const CefString& download_path,
 CefBeforeDownloadCallbackCToCpp::CefBeforeDownloadCallbackCToCpp() {
 }
 
-template<> cef_before_download_callback_t* CefCToCpp cef_before_download_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefBeforeDownloadCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -45,11 +45,11 @@ template<> cef_before_download_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_BEFORE_DOWNLOAD_CALLBACK;
diff --git a/libcef_dll/ctocpp/before_download_callback_ctocpp.h b/libcef_dll/ctocpp/before_download_callback_ctocpp.h
index d9a6265e6..3e71d658b 100644
--- a/libcef_dll/ctocpp/before_download_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/before_download_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_download_handler.h"
 #include "include/capi/cef_download_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBeforeDownloadCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefBeforeDownloadCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/binary_value_ctocpp.cc b/libcef_dll/ctocpp/binary_value_ctocpp.cc
index 47241af6e..652be1cd5 100644
--- a/libcef_dll/ctocpp/binary_value_ctocpp.cc
+++ b/libcef_dll/ctocpp/binary_value_ctocpp.cc
@@ -161,17 +161,17 @@ size_t CefBinaryValueCToCpp::GetData(void* buffer, size_t buffer_size,
 CefBinaryValueCToCpp::CefBinaryValueCToCpp() {
 }
 
-template<> cef_binary_value_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_binary_value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefBinaryValue* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_BINARY_VALUE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BINARY_VALUE;
diff --git a/libcef_dll/ctocpp/binary_value_ctocpp.h b/libcef_dll/ctocpp/binary_value_ctocpp.h
index 72f82bafe..344689713 100644
--- a/libcef_dll/ctocpp/binary_value_ctocpp.h
+++ b/libcef_dll/ctocpp/binary_value_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBinaryValueCToCpp
-    : public CefCToCpp {
  public:
   CefBinaryValueCToCpp();
diff --git a/libcef_dll/ctocpp/browser_ctocpp.cc b/libcef_dll/ctocpp/browser_ctocpp.cc
index 78b42abed..2a419bf2c 100644
--- a/libcef_dll/ctocpp/browser_ctocpp.cc
+++ b/libcef_dll/ctocpp/browser_ctocpp.cc
@@ -359,16 +359,16 @@ bool CefBrowserCToCpp::SendProcessMessage(CefProcessId target_process,
 CefBrowserCToCpp::CefBrowserCToCpp() {
 }
 
-template<> cef_browser_t* CefCToCpp cef_browser_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefBrowser* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER;
diff --git a/libcef_dll/ctocpp/browser_ctocpp.h b/libcef_dll/ctocpp/browser_ctocpp.h
index 06070a3ab..7fbc2563b 100644
--- a/libcef_dll/ctocpp/browser_ctocpp.h
+++ b/libcef_dll/ctocpp/browser_ctocpp.h
@@ -23,12 +23,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBrowserCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefBrowserCToCpp();
 
diff --git a/libcef_dll/ctocpp/browser_host_ctocpp.cc b/libcef_dll/ctocpp/browser_host_ctocpp.cc
index eb3d3c90d..be2e52c78 100644
--- a/libcef_dll/ctocpp/browser_host_ctocpp.cc
+++ b/libcef_dll/ctocpp/browser_host_ctocpp.cc
@@ -849,17 +849,17 @@ CefRefPtr CefBrowserHostCToCpp::GetVisibleNavigationEntry(
 CefBrowserHostCToCpp::CefBrowserHostCToCpp() {
 }
 
-template<> cef_browser_host_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_browser_host_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefBrowserHost* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_BROWSER_HOST;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER_HOST;
diff --git a/libcef_dll/ctocpp/browser_host_ctocpp.h b/libcef_dll/ctocpp/browser_host_ctocpp.h
index 7c2413bf1..667d51132 100644
--- a/libcef_dll/ctocpp/browser_host_ctocpp.h
+++ b/libcef_dll/ctocpp/browser_host_ctocpp.h
@@ -23,12 +23,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBrowserHostCToCpp
-    : public CefCToCpp {
  public:
   CefBrowserHostCToCpp();
diff --git a/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc b/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc
index 454027159..604411436 100644
--- a/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc
@@ -97,7 +97,7 @@ void CefBrowserProcessHandlerCToCpp::OnScheduleMessagePumpWork(int64 delay_ms) {
 CefBrowserProcessHandlerCToCpp::CefBrowserProcessHandlerCToCpp() {
 }
 
-template<> cef_browser_process_handler_t* CefCToCpp cef_browser_process_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefBrowserProcessHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -105,10 +105,10 @@ template<> cef_browser_process_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_BROWSER_PROCESS_HANDLER;
diff --git a/libcef_dll/ctocpp/browser_process_handler_ctocpp.h b/libcef_dll/ctocpp/browser_process_handler_ctocpp.h
index 9432e4e62..1b5830cc6 100644
--- a/libcef_dll/ctocpp/browser_process_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/browser_process_handler_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_browser_process_handler.h"
 #include "include/capi/cef_browser_process_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefBrowserProcessHandlerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefBrowserProcessHandlerCToCpp();
 
diff --git a/libcef_dll/ctocpp/callback_ctocpp.cc b/libcef_dll/ctocpp/callback_ctocpp.cc
index 60e748147..8f79e986c 100644
--- a/libcef_dll/ctocpp/callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/callback_ctocpp.cc
@@ -43,16 +43,16 @@ void CefCallbackCToCpp::Cancel() {
 CefCallbackCToCpp::CefCallbackCToCpp() {
 }
 
-template<> cef_callback_t* CefCToCpp cef_callback_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_CALLBACK;
diff --git a/libcef_dll/ctocpp/callback_ctocpp.h b/libcef_dll/ctocpp/callback_ctocpp.h
index de1852694..892d6e7ab 100644
--- a/libcef_dll/ctocpp/callback_ctocpp.h
+++ b/libcef_dll/ctocpp/callback_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_callback.h"
 #include "include/capi/cef_callback_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/client_ctocpp.cc b/libcef_dll/ctocpp/client_ctocpp.cc
index 7919f75a8..fc61ac6e1 100644
--- a/libcef_dll/ctocpp/client_ctocpp.cc
+++ b/libcef_dll/ctocpp/client_ctocpp.cc
@@ -262,16 +262,16 @@ bool CefClientCToCpp::OnProcessMessageReceived(CefRefPtr browser,
 CefClientCToCpp::CefClientCToCpp() {
 }
 
-template<> cef_client_t* CefCToCpp cef_client_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefClient* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_CLIENT;
diff --git a/libcef_dll/ctocpp/client_ctocpp.h b/libcef_dll/ctocpp/client_ctocpp.h
index 1140ccc1b..1724d8b65 100644
--- a/libcef_dll/ctocpp/client_ctocpp.h
+++ b/libcef_dll/ctocpp/client_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefClientCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefClientCToCpp();
 
diff --git a/libcef_dll/ctocpp/command_line_ctocpp.cc b/libcef_dll/ctocpp/command_line_ctocpp.cc
index e61c51e16..116b2ec6f 100644
--- a/libcef_dll/ctocpp/command_line_ctocpp.cc
+++ b/libcef_dll/ctocpp/command_line_ctocpp.cc
@@ -416,17 +416,17 @@ void CefCommandLineCToCpp::PrependWrapper(const CefString& wrapper) {
 CefCommandLineCToCpp::CefCommandLineCToCpp() {
 }
 
-template<> cef_command_line_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_command_line_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefCommandLine* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_COMMAND_LINE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_COMMAND_LINE;
diff --git a/libcef_dll/ctocpp/command_line_ctocpp.h b/libcef_dll/ctocpp/command_line_ctocpp.h
index 5a92fa067..17364f55f 100644
--- a/libcef_dll/ctocpp/command_line_ctocpp.h
+++ b/libcef_dll/ctocpp/command_line_ctocpp.h
@@ -21,12 +21,12 @@
 #include 
 #include "include/cef_command_line.h"
 #include "include/capi/cef_command_line_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefCommandLineCToCpp
-    : public CefCToCpp {
  public:
   CefCommandLineCToCpp();
diff --git a/libcef_dll/ctocpp/completion_callback_ctocpp.cc b/libcef_dll/ctocpp/completion_callback_ctocpp.cc
index 3d649f663..cb0bb6d97 100644
--- a/libcef_dll/ctocpp/completion_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/completion_callback_ctocpp.cc
@@ -32,7 +32,7 @@ void CefCompletionCallbackCToCpp::OnComplete() {
 CefCompletionCallbackCToCpp::CefCompletionCallbackCToCpp() {
 }
 
-template<> cef_completion_callback_t* CefCToCpp cef_completion_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefCompletionCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -40,10 +40,10 @@ template<> cef_completion_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_COMPLETION_CALLBACK;
diff --git a/libcef_dll/ctocpp/completion_callback_ctocpp.h b/libcef_dll/ctocpp/completion_callback_ctocpp.h
index 0d29eea50..953accbe1 100644
--- a/libcef_dll/ctocpp/completion_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/completion_callback_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_callback.h"
 #include "include/capi/cef_callback_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefCompletionCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefCompletionCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc b/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc
index 45bbdebdd..5d75b55b0 100644
--- a/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc
@@ -161,7 +161,7 @@ void CefContextMenuHandlerCToCpp::OnContextMenuDismissed(
 CefContextMenuHandlerCToCpp::CefContextMenuHandlerCToCpp() {
 }
 
-template<> cef_context_menu_handler_t* CefCToCpp cef_context_menu_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefContextMenuHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -169,10 +169,10 @@ template<> cef_context_menu_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_CONTEXT_MENU_HANDLER;
diff --git a/libcef_dll/ctocpp/context_menu_handler_ctocpp.h b/libcef_dll/ctocpp/context_menu_handler_ctocpp.h
index a36f2bb29..0e15d938c 100644
--- a/libcef_dll/ctocpp/context_menu_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/context_menu_handler_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_context_menu_handler.h"
 #include "include/capi/cef_context_menu_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefContextMenuHandlerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefContextMenuHandlerCToCpp();
 
diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc
index 45620a14e..9765b0087 100644
--- a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc
+++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc
@@ -353,7 +353,7 @@ bool CefContextMenuParamsCToCpp::IsPepperMenu() {
 CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() {
 }
 
-template<> cef_context_menu_params_t* CefCToCpp cef_context_menu_params_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefContextMenuParams* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -361,10 +361,10 @@ template<> cef_context_menu_params_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_CONTEXT_MENU_PARAMS;
diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.h b/libcef_dll/ctocpp/context_menu_params_ctocpp.h
index a0e00a52b..1bdab01b9 100644
--- a/libcef_dll/ctocpp/context_menu_params_ctocpp.h
+++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.h
@@ -21,13 +21,13 @@
 #include 
 #include "include/cef_context_menu_handler.h"
 #include "include/capi/cef_context_menu_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefContextMenuParamsCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefContextMenuParamsCToCpp();
 
diff --git a/libcef_dll/ctocpp/cookie_manager_ctocpp.cc b/libcef_dll/ctocpp/cookie_manager_ctocpp.cc
index 9e6acbb2a..47eb6d4a2 100644
--- a/libcef_dll/ctocpp/cookie_manager_ctocpp.cc
+++ b/libcef_dll/ctocpp/cookie_manager_ctocpp.cc
@@ -218,7 +218,7 @@ bool CefCookieManagerCToCpp::FlushStore(
 CefCookieManagerCToCpp::CefCookieManagerCToCpp() {
 }
 
-template<> cef_cookie_manager_t* CefCToCpp cef_cookie_manager_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefCookieManager* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -226,9 +226,9 @@ template<> cef_cookie_manager_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_COOKIE_MANAGER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_COOKIE_MANAGER;
diff --git a/libcef_dll/ctocpp/cookie_manager_ctocpp.h b/libcef_dll/ctocpp/cookie_manager_ctocpp.h
index 4445be30b..7ea85182c 100644
--- a/libcef_dll/ctocpp/cookie_manager_ctocpp.h
+++ b/libcef_dll/ctocpp/cookie_manager_ctocpp.h
@@ -21,12 +21,12 @@
 #include 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefCookieManagerCToCpp
-    : public CefCToCpp {
  public:
   CefCookieManagerCToCpp();
diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc
index 064536aa0..069fed860 100644
--- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc
+++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc
@@ -46,7 +46,7 @@ bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count,
 CefCookieVisitorCToCpp::CefCookieVisitorCToCpp() {
 }
 
-template<> cef_cookie_visitor_t* CefCToCpp cef_cookie_visitor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefCookieVisitor* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -54,9 +54,9 @@ template<> cef_cookie_visitor_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_COOKIE_VISITOR;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_COOKIE_VISITOR;
diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h
index 8205f418b..d86eabc92 100644
--- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h
+++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefCookieVisitorCToCpp
-    : public CefCToCpp {
  public:
   CefCookieVisitorCToCpp();
diff --git a/libcef_dll/ctocpp/ctocpp.h b/libcef_dll/ctocpp/ctocpp_ref_counted.h
similarity index 78%
rename from libcef_dll/ctocpp/ctocpp.h
rename to libcef_dll/ctocpp/ctocpp_ref_counted.h
index 85ca5fc6d..e636c67d7 100644
--- a/libcef_dll/ctocpp/ctocpp.h
+++ b/libcef_dll/ctocpp/ctocpp_ref_counted.h
@@ -2,8 +2,8 @@
 // reserved. Use of this source code is governed by a BSD-style license that
 // can be found in the LICENSE file.
 
-#ifndef CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_
-#define CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_
+#ifndef CEF_LIBCEF_DLL_CTOCPP_CTOCPP_REF_COUNTED_H_
+#define CEF_LIBCEF_DLL_CTOCPP_CTOCPP_REF_COUNTED_H_
 #pragma once
 
 #include "include/base/cef_logging.h"
@@ -16,7 +16,7 @@
 // exists on the other side of the DLL boundary but will have methods called on
 // this side of the DLL boundary.
 template 
-class CefCToCpp : public BaseName {
+class CefCToCppRefCounted : public BaseName {
  public:
   // Create a new wrapper instance for a structure reference received from the
   // other side.
@@ -26,8 +26,8 @@ class CefCToCpp : public BaseName {
   // return back to the other side.
   static StructName* Unwrap(CefRefPtr c);
 
-  // CefBase methods increment/decrement reference counts on both this object
-  // and the underlying wrapped structure.
+  // CefBaseRefCounted methods increment/decrement reference counts on both this
+  // object and the underlying wrapped structure.
   void AddRef() const {
     UnderlyingAddRef();
     ref_count_.AddRef();
@@ -41,13 +41,13 @@ class CefCToCpp : public BaseName {
 #endif
 
  protected:
-  CefCToCpp() {
+  CefCToCppRefCounted() {
 #if DCHECK_IS_ON()
     base::AtomicRefCountInc(&DebugObjCt);
 #endif
   }
 
-  virtual ~CefCToCpp() {
+  virtual ~CefCToCppRefCounted() {
 #if DCHECK_IS_ON()
     base::AtomicRefCountDec(&DebugObjCt);
 #endif
@@ -73,20 +73,23 @@ class CefCToCpp : public BaseName {
 
   // Increment/decrement reference counts on only the underlying class.
   void UnderlyingAddRef() const {
-    cef_base_t* base = reinterpret_cast(GetStruct());
+    cef_base_ref_counted_t* base =
+        reinterpret_cast(GetStruct());
     if (base->add_ref)
       base->add_ref(base);
   }
 
   bool UnderlyingRelease() const {
-    cef_base_t* base = reinterpret_cast(GetStruct());
+    cef_base_ref_counted_t* base =
+        reinterpret_cast(GetStruct());
     if (!base->release)
       return false;
     return base->release(base) ? true : false;
   }
 
   bool UnderlyingHasOneRef() const {
-    cef_base_t* base = reinterpret_cast(GetStruct());
+    cef_base_ref_counted_t* base =
+        reinterpret_cast(GetStruct());
     if (!base->has_one_ref)
       return false;
     return base->has_one_ref(base) ? true : false;
@@ -96,11 +99,11 @@ class CefCToCpp : public BaseName {
 
   static CefWrapperType kWrapperType;
 
-  DISALLOW_COPY_AND_ASSIGN(CefCToCpp);
+  DISALLOW_COPY_AND_ASSIGN(CefCToCppRefCounted);
 };
 
 template 
-struct CefCToCpp::WrapperStruct {
+struct CefCToCppRefCounted::WrapperStruct {
   CefWrapperType type_;
   StructName* struct_;
   ClassName wrapper_;
@@ -108,11 +111,11 @@ struct CefCToCpp::WrapperStruct {
 
 template 
 CefRefPtr
-    CefCToCpp::Wrap(StructName* s) {
+    CefCToCppRefCounted::Wrap(StructName* s) {
   if (!s)
     return NULL;
 
-  // Wrap their structure with the CefCToCpp object.
+  // Wrap their structure with the CefCToCppRefCounted object.
   WrapperStruct* wrapperStruct = new WrapperStruct;
   wrapperStruct->type_ = kWrapperType;
   wrapperStruct->struct_ = s;
@@ -127,8 +130,8 @@ CefRefPtr
 }
 
 template 
-StructName*
-    CefCToCpp::Unwrap(CefRefPtr c) {
+StructName* CefCToCppRefCounted::Unwrap(
+    CefRefPtr c) {
   if (!c.get())
     return NULL;
 
@@ -147,7 +150,7 @@ StructName*
 }
 
 template 
-bool CefCToCpp::Release() const {
+bool CefCToCppRefCounted::Release() const {
   UnderlyingRelease();
   if (ref_count_.Release()) {
     WrapperStruct* wrapperStruct = GetWrapperStruct(this);
@@ -160,8 +163,8 @@ bool CefCToCpp::Release() const {
 }
 
 template 
-typename CefCToCpp::WrapperStruct*
-    CefCToCpp::GetWrapperStruct(
+typename CefCToCppRefCounted::WrapperStruct*
+    CefCToCppRefCounted::GetWrapperStruct(
         const BaseName* obj) {
   // Offset using the WrapperStruct size instead of individual member sizes to
   // avoid problems due to platform/compiler differences in structure padding.
@@ -170,4 +173,4 @@ typename CefCToCpp::WrapperStruct*
       (sizeof(WrapperStruct) - sizeof(ClassName)));
 }
 
-#endif  // CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_
+#endif  // CEF_LIBCEF_DLL_CTOCPP_CTOCPP_REF_COUNTED_H_
diff --git a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc
index 7a0421a18..74d45ef84 100644
--- a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc
@@ -33,7 +33,7 @@ void CefDeleteCookiesCallbackCToCpp::OnComplete(int num_deleted) {
 CefDeleteCookiesCallbackCToCpp::CefDeleteCookiesCallbackCToCpp() {
 }
 
-template<> cef_delete_cookies_callback_t* CefCToCpp cef_delete_cookies_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefDeleteCookiesCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -41,10 +41,10 @@ template<> cef_delete_cookies_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_DELETE_COOKIES_CALLBACK;
diff --git a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h
index 0f5e94f96..b585074e9 100644
--- a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefDeleteCookiesCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefDeleteCookiesCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/dialog_handler_ctocpp.cc b/libcef_dll/ctocpp/dialog_handler_ctocpp.cc
index c23998267..0f6e98f01 100644
--- a/libcef_dll/ctocpp/dialog_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/dialog_handler_ctocpp.cc
@@ -73,7 +73,7 @@ bool CefDialogHandlerCToCpp::OnFileDialog(CefRefPtr browser,
 CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() {
 }
 
-template<> cef_dialog_handler_t* CefCToCpp cef_dialog_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefDialogHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -81,9 +81,9 @@ template<> cef_dialog_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_DIALOG_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DIALOG_HANDLER;
diff --git a/libcef_dll/ctocpp/dialog_handler_ctocpp.h b/libcef_dll/ctocpp/dialog_handler_ctocpp.h
index 061d10e5c..736d986ac 100644
--- a/libcef_dll/ctocpp/dialog_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/dialog_handler_ctocpp.h
@@ -21,12 +21,12 @@
 #include 
 #include "include/cef_dialog_handler.h"
 #include "include/capi/cef_dialog_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefDialogHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefDialogHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/dictionary_value_ctocpp.cc b/libcef_dll/ctocpp/dictionary_value_ctocpp.cc
index d36fe3774..ed824673c 100644
--- a/libcef_dll/ctocpp/dictionary_value_ctocpp.cc
+++ b/libcef_dll/ctocpp/dictionary_value_ctocpp.cc
@@ -627,7 +627,7 @@ bool CefDictionaryValueCToCpp::SetList(const CefString& key,
 CefDictionaryValueCToCpp::CefDictionaryValueCToCpp() {
 }
 
-template<> cef_dictionary_value_t* CefCToCpp cef_dictionary_value_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefDictionaryValue* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -635,10 +635,10 @@ template<> cef_dictionary_value_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_DICTIONARY_VALUE;
diff --git a/libcef_dll/ctocpp/dictionary_value_ctocpp.h b/libcef_dll/ctocpp/dictionary_value_ctocpp.h
index 9e05a99c3..2a18865ea 100644
--- a/libcef_dll/ctocpp/dictionary_value_ctocpp.h
+++ b/libcef_dll/ctocpp/dictionary_value_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDictionaryValueCToCpp
-    : public CefCToCpp {
  public:
   CefDictionaryValueCToCpp();
diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.cc b/libcef_dll/ctocpp/display_handler_ctocpp.cc
index 402f9038c..564b38713 100644
--- a/libcef_dll/ctocpp/display_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/display_handler_ctocpp.cc
@@ -189,7 +189,7 @@ bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser,
 CefDisplayHandlerCToCpp::CefDisplayHandlerCToCpp() {
 }
 
-template<> cef_display_handler_t* CefCToCpp cef_display_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefDisplayHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -197,9 +197,10 @@ template<> cef_display_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_DISPLAY_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_DISPLAY_HANDLER;
diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.h b/libcef_dll/ctocpp/display_handler_ctocpp.h
index 347a272c2..4cf0ebd4f 100644
--- a/libcef_dll/ctocpp/display_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/display_handler_ctocpp.h
@@ -21,12 +21,12 @@
 #include 
 #include "include/cef_display_handler.h"
 #include "include/capi/cef_display_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefDisplayHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefDisplayHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.cc b/libcef_dll/ctocpp/domdocument_ctocpp.cc
index 06d2b4104..a3fca4c3f 100644
--- a/libcef_dll/ctocpp/domdocument_ctocpp.cc
+++ b/libcef_dll/ctocpp/domdocument_ctocpp.cc
@@ -241,17 +241,17 @@ CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) {
 CefDOMDocumentCToCpp::CefDOMDocumentCToCpp() {
 }
 
-template<> cef_domdocument_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_domdocument_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefDOMDocument* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_DOMDOCUMENT;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOMDOCUMENT;
diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.h b/libcef_dll/ctocpp/domdocument_ctocpp.h
index a4e0379f1..1b6597927 100644
--- a/libcef_dll/ctocpp/domdocument_ctocpp.h
+++ b/libcef_dll/ctocpp/domdocument_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_dom.h"
 #include "include/capi/cef_dom_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDOMDocumentCToCpp
-    : public CefCToCpp {
  public:
   CefDOMDocumentCToCpp();
diff --git a/libcef_dll/ctocpp/domnode_ctocpp.cc b/libcef_dll/ctocpp/domnode_ctocpp.cc
index 339691bab..548d1e4fe 100644
--- a/libcef_dll/ctocpp/domnode_ctocpp.cc
+++ b/libcef_dll/ctocpp/domnode_ctocpp.cc
@@ -449,16 +449,16 @@ CefRect CefDOMNodeCToCpp::GetElementBounds() {
 CefDOMNodeCToCpp::CefDOMNodeCToCpp() {
 }
 
-template<> cef_domnode_t* CefCToCpp cef_domnode_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefDOMNode* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOMNODE;
diff --git a/libcef_dll/ctocpp/domnode_ctocpp.h b/libcef_dll/ctocpp/domnode_ctocpp.h
index 0be0b087b..a6d751073 100644
--- a/libcef_dll/ctocpp/domnode_ctocpp.h
+++ b/libcef_dll/ctocpp/domnode_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_dom.h"
 #include "include/capi/cef_dom_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDOMNodeCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefDOMNodeCToCpp();
 
diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.cc b/libcef_dll/ctocpp/domvisitor_ctocpp.cc
index 5736bd120..08bef8a89 100644
--- a/libcef_dll/ctocpp/domvisitor_ctocpp.cc
+++ b/libcef_dll/ctocpp/domvisitor_ctocpp.cc
@@ -39,16 +39,17 @@ void CefDOMVisitorCToCpp::Visit(CefRefPtr document) {
 CefDOMVisitorCToCpp::CefDOMVisitorCToCpp() {
 }
 
-template<> cef_domvisitor_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefDOMVisitor* c) {
+template<> cef_domvisitor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefDOMVisitor* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_DOMVISITOR;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOMVISITOR;
diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.h b/libcef_dll/ctocpp/domvisitor_ctocpp.h
index c22a6dc26..2eca8aba6 100644
--- a/libcef_dll/ctocpp/domvisitor_ctocpp.h
+++ b/libcef_dll/ctocpp/domvisitor_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_dom.h"
 #include "include/capi/cef_dom_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefDOMVisitorCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefDOMVisitorCToCpp();
 
diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.cc b/libcef_dll/ctocpp/download_handler_ctocpp.cc
index 9c2c0366e..bf19f2535 100644
--- a/libcef_dll/ctocpp/download_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/download_handler_ctocpp.cc
@@ -88,7 +88,7 @@ void CefDownloadHandlerCToCpp::OnDownloadUpdated(CefRefPtr browser,
 CefDownloadHandlerCToCpp::CefDownloadHandlerCToCpp() {
 }
 
-template<> cef_download_handler_t* CefCToCpp cef_download_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefDownloadHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -96,10 +96,10 @@ template<> cef_download_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_DOWNLOAD_HANDLER;
diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.h b/libcef_dll/ctocpp/download_handler_ctocpp.h
index 4b67b75a1..d4bebeaa3 100644
--- a/libcef_dll/ctocpp/download_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/download_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_download_handler.h"
 #include "include/capi/cef_download_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefDownloadHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefDownloadHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/download_image_callback_ctocpp.cc b/libcef_dll/ctocpp/download_image_callback_ctocpp.cc
index b32638073..33e486b65 100644
--- a/libcef_dll/ctocpp/download_image_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/download_image_callback_ctocpp.cc
@@ -44,7 +44,7 @@ void CefDownloadImageCallbackCToCpp::OnDownloadImageFinished(
 CefDownloadImageCallbackCToCpp::CefDownloadImageCallbackCToCpp() {
 }
 
-template<> cef_download_image_callback_t* CefCToCpp cef_download_image_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefDownloadImageCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -52,10 +52,10 @@ template<> cef_download_image_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_DOWNLOAD_IMAGE_CALLBACK;
diff --git a/libcef_dll/ctocpp/download_image_callback_ctocpp.h b/libcef_dll/ctocpp/download_image_callback_ctocpp.h
index 7498c99c5..2a63ab698 100644
--- a/libcef_dll/ctocpp/download_image_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/download_image_callback_ctocpp.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefDownloadImageCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefDownloadImageCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/download_item_callback_ctocpp.cc b/libcef_dll/ctocpp/download_item_callback_ctocpp.cc
index b8d01bbf3..fa08ed51a 100644
--- a/libcef_dll/ctocpp/download_item_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/download_item_callback_ctocpp.cc
@@ -54,7 +54,7 @@ void CefDownloadItemCallbackCToCpp::Resume() {
 CefDownloadItemCallbackCToCpp::CefDownloadItemCallbackCToCpp() {
 }
 
-template<> cef_download_item_callback_t* CefCToCpp cef_download_item_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefDownloadItemCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -62,10 +62,10 @@ template<> cef_download_item_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_DOWNLOAD_ITEM_CALLBACK;
diff --git a/libcef_dll/ctocpp/download_item_callback_ctocpp.h b/libcef_dll/ctocpp/download_item_callback_ctocpp.h
index 7cb56cb88..494aca7ce 100644
--- a/libcef_dll/ctocpp/download_item_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/download_item_callback_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_download_handler.h"
 #include "include/capi/cef_download_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDownloadItemCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefDownloadItemCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/download_item_ctocpp.cc b/libcef_dll/ctocpp/download_item_ctocpp.cc
index dcdc344df..36d652e9a 100644
--- a/libcef_dll/ctocpp/download_item_ctocpp.cc
+++ b/libcef_dll/ctocpp/download_item_ctocpp.cc
@@ -271,7 +271,7 @@ CefString CefDownloadItemCToCpp::GetMimeType() {
 CefDownloadItemCToCpp::CefDownloadItemCToCpp() {
 }
 
-template<> cef_download_item_t* CefCToCpp cef_download_item_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefDownloadItem* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -279,9 +279,9 @@ template<> cef_download_item_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_DOWNLOAD_ITEM;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DOWNLOAD_ITEM;
diff --git a/libcef_dll/ctocpp/download_item_ctocpp.h b/libcef_dll/ctocpp/download_item_ctocpp.h
index 1e99d6c36..f0532796f 100644
--- a/libcef_dll/ctocpp/download_item_ctocpp.h
+++ b/libcef_dll/ctocpp/download_item_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_download_item.h"
 #include "include/capi/cef_download_item_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDownloadItemCToCpp
-    : public CefCToCpp {
  public:
   CefDownloadItemCToCpp();
diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.cc b/libcef_dll/ctocpp/drag_data_ctocpp.cc
index ab27df2eb..db1a2f71b 100644
--- a/libcef_dll/ctocpp/drag_data_ctocpp.cc
+++ b/libcef_dll/ctocpp/drag_data_ctocpp.cc
@@ -378,16 +378,16 @@ void CefDragDataCToCpp::AddFile(const CefString& path,
 CefDragDataCToCpp::CefDragDataCToCpp() {
 }
 
-template<> cef_drag_data_t* CefCToCpp cef_drag_data_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefDragData* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DRAG_DATA;
diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.h b/libcef_dll/ctocpp/drag_data_ctocpp.h
index 85ea3e585..5b202710d 100644
--- a/libcef_dll/ctocpp/drag_data_ctocpp.h
+++ b/libcef_dll/ctocpp/drag_data_ctocpp.h
@@ -21,12 +21,13 @@
 #include 
 #include "include/cef_drag_data.h"
 #include "include/capi/cef_drag_data_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDragDataCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefDragDataCToCpp();
 
diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.cc b/libcef_dll/ctocpp/drag_handler_ctocpp.cc
index 043ba61ff..0e73683d1 100644
--- a/libcef_dll/ctocpp/drag_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/drag_handler_ctocpp.cc
@@ -88,17 +88,17 @@ void CefDragHandlerCToCpp::OnDraggableRegionsChanged(
 CefDragHandlerCToCpp::CefDragHandlerCToCpp() {
 }
 
-template<> cef_drag_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_drag_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefDragHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_DRAG_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DRAG_HANDLER;
diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.h b/libcef_dll/ctocpp/drag_handler_ctocpp.h
index ffa5ae429..bdec3ed58 100644
--- a/libcef_dll/ctocpp/drag_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/drag_handler_ctocpp.h
@@ -21,12 +21,12 @@
 #include 
 #include "include/cef_drag_handler.h"
 #include "include/capi/cef_drag_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefDragHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefDragHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc
index ab251d308..e9b40439f 100644
--- a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc
@@ -39,7 +39,7 @@ void CefEndTracingCallbackCToCpp::OnEndTracingComplete(
 CefEndTracingCallbackCToCpp::CefEndTracingCallbackCToCpp() {
 }
 
-template<> cef_end_tracing_callback_t* CefCToCpp cef_end_tracing_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefEndTracingCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -47,10 +47,10 @@ template<> cef_end_tracing_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_END_TRACING_CALLBACK;
diff --git a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h
index f830ce1e9..d3a89b8bb 100644
--- a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_trace.h"
 #include "include/capi/cef_trace_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefEndTracingCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefEndTracingCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc
index e163f59e6..783fd9ed8 100644
--- a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc
@@ -63,7 +63,7 @@ void CefFileDialogCallbackCToCpp::Cancel() {
 CefFileDialogCallbackCToCpp::CefFileDialogCallbackCToCpp() {
 }
 
-template<> cef_file_dialog_callback_t* CefCToCpp cef_file_dialog_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefFileDialogCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -71,10 +71,10 @@ template<> cef_file_dialog_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_FILE_DIALOG_CALLBACK;
diff --git a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h
index a06187b1a..d7308336d 100644
--- a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h
@@ -21,13 +21,13 @@
 #include 
 #include "include/cef_dialog_handler.h"
 #include "include/capi/cef_dialog_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefFileDialogCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefFileDialogCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.cc b/libcef_dll/ctocpp/find_handler_ctocpp.cc
index 1b1cc9d89..d6fdf1058 100644
--- a/libcef_dll/ctocpp/find_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/find_handler_ctocpp.cc
@@ -46,17 +46,17 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser,
 CefFindHandlerCToCpp::CefFindHandlerCToCpp() {
 }
 
-template<> cef_find_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_find_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefFindHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_FIND_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FIND_HANDLER;
diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.h b/libcef_dll/ctocpp/find_handler_ctocpp.h
index 2e74f69ac..2216d97e4 100644
--- a/libcef_dll/ctocpp/find_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/find_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_find_handler.h"
 #include "include/capi/cef_find_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefFindHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefFindHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.cc b/libcef_dll/ctocpp/focus_handler_ctocpp.cc
index 555e76be7..fad717146 100644
--- a/libcef_dll/ctocpp/focus_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/focus_handler_ctocpp.cc
@@ -80,7 +80,7 @@ void CefFocusHandlerCToCpp::OnGotFocus(CefRefPtr browser) {
 CefFocusHandlerCToCpp::CefFocusHandlerCToCpp() {
 }
 
-template<> cef_focus_handler_t* CefCToCpp cef_focus_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefFocusHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -88,9 +88,9 @@ template<> cef_focus_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_FOCUS_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FOCUS_HANDLER;
diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.h b/libcef_dll/ctocpp/focus_handler_ctocpp.h
index 73519d9ad..3c34330d4 100644
--- a/libcef_dll/ctocpp/focus_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/focus_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_focus_handler.h"
 #include "include/capi/cef_focus_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefFocusHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefFocusHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/frame_ctocpp.cc b/libcef_dll/ctocpp/frame_ctocpp.cc
index ca5011f77..6ce68c456 100644
--- a/libcef_dll/ctocpp/frame_ctocpp.cc
+++ b/libcef_dll/ctocpp/frame_ctocpp.cc
@@ -373,16 +373,16 @@ void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) {
 CefFrameCToCpp::CefFrameCToCpp() {
 }
 
-template<> cef_frame_t* CefCToCpp cef_frame_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefFrame* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FRAME;
diff --git a/libcef_dll/ctocpp/frame_ctocpp.h b/libcef_dll/ctocpp/frame_ctocpp.h
index 799f831c5..0317ef104 100644
--- a/libcef_dll/ctocpp/frame_ctocpp.h
+++ b/libcef_dll/ctocpp/frame_ctocpp.h
@@ -24,12 +24,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefFrameCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefFrameCToCpp();
 
diff --git a/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc b/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc
index a9d398fa4..4aee9b8a9 100644
--- a/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc
@@ -33,7 +33,7 @@ void CefGeolocationCallbackCToCpp::Continue(bool allow) {
 CefGeolocationCallbackCToCpp::CefGeolocationCallbackCToCpp() {
 }
 
-template<> cef_geolocation_callback_t* CefCToCpp cef_geolocation_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefGeolocationCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -41,10 +41,10 @@ template<> cef_geolocation_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_GEOLOCATION_CALLBACK;
diff --git a/libcef_dll/ctocpp/geolocation_callback_ctocpp.h b/libcef_dll/ctocpp/geolocation_callback_ctocpp.h
index 15ffcee41..a5e666599 100644
--- a/libcef_dll/ctocpp/geolocation_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/geolocation_callback_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_geolocation_handler.h"
 #include "include/capi/cef_geolocation_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefGeolocationCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefGeolocationCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc b/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc
index 66300ea9e..16bba0ef7 100644
--- a/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc
@@ -75,7 +75,7 @@ void CefGeolocationHandlerCToCpp::OnCancelGeolocationPermission(
 CefGeolocationHandlerCToCpp::CefGeolocationHandlerCToCpp() {
 }
 
-template<> cef_geolocation_handler_t* CefCToCpp cef_geolocation_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefGeolocationHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -83,10 +83,10 @@ template<> cef_geolocation_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_GEOLOCATION_HANDLER;
diff --git a/libcef_dll/ctocpp/geolocation_handler_ctocpp.h b/libcef_dll/ctocpp/geolocation_handler_ctocpp.h
index 013c486ee..5cc2b9c72 100644
--- a/libcef_dll/ctocpp/geolocation_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/geolocation_handler_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_geolocation_handler.h"
 #include "include/capi/cef_geolocation_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefGeolocationHandlerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefGeolocationHandlerCToCpp();
 
diff --git a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc
index c676d1b0c..071d9d451 100644
--- a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc
@@ -34,7 +34,7 @@ void CefGetGeolocationCallbackCToCpp::OnLocationUpdate(
 CefGetGeolocationCallbackCToCpp::CefGetGeolocationCallbackCToCpp() {
 }
 
-template<> cef_get_geolocation_callback_t* CefCToCpp cef_get_geolocation_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefGetGeolocationCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -42,11 +42,11 @@ template<> cef_get_geolocation_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_GET_GEOLOCATION_CALLBACK;
diff --git a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h
index b9422a028..abb493863 100644
--- a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_geolocation.h"
 #include "include/capi/cef_geolocation_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefGetGeolocationCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefGetGeolocationCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/image_ctocpp.cc b/libcef_dll/ctocpp/image_ctocpp.cc
index 4b1450247..8d15a25ff 100644
--- a/libcef_dll/ctocpp/image_ctocpp.cc
+++ b/libcef_dll/ctocpp/image_ctocpp.cc
@@ -279,16 +279,16 @@ CefRefPtr CefImageCToCpp::GetAsJPEG(float scale_factor,
 CefImageCToCpp::CefImageCToCpp() {
 }
 
-template<> cef_image_t* CefCToCpp cef_image_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefImage* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_IMAGE;
diff --git a/libcef_dll/ctocpp/image_ctocpp.h b/libcef_dll/ctocpp/image_ctocpp.h
index 318f3aaf3..f0393f032 100644
--- a/libcef_dll/ctocpp/image_ctocpp.h
+++ b/libcef_dll/ctocpp/image_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_image.h"
 #include "include/capi/cef_image_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefImageCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefImageCToCpp();
 
diff --git a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc
index 6f0000b0d..7531ef095 100644
--- a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc
@@ -37,7 +37,7 @@ void CefJSDialogCallbackCToCpp::Continue(bool success,
 CefJSDialogCallbackCToCpp::CefJSDialogCallbackCToCpp() {
 }
 
-template<> cef_jsdialog_callback_t* CefCToCpp cef_jsdialog_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefJSDialogCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -45,10 +45,10 @@ template<> cef_jsdialog_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_JSDIALOG_CALLBACK;
diff --git a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h
index 41a61364c..0d05cddc5 100644
--- a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_jsdialog_handler.h"
 #include "include/capi/cef_jsdialog_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefJSDialogCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefJSDialogCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc
index 36c63b638..40664db08 100644
--- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc
@@ -128,7 +128,7 @@ void CefJSDialogHandlerCToCpp::OnDialogClosed(CefRefPtr browser) {
 CefJSDialogHandlerCToCpp::CefJSDialogHandlerCToCpp() {
 }
 
-template<> cef_jsdialog_handler_t* CefCToCpp cef_jsdialog_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefJSDialogHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -136,10 +136,10 @@ template<> cef_jsdialog_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_JSDIALOG_HANDLER;
diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h
index 0827a15de..60c48e67f 100644
--- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_jsdialog_handler.h"
 #include "include/capi/cef_jsdialog_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefJSDialogHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefJSDialogHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc
index 1f59d907e..5e2c5e238 100644
--- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc
@@ -81,7 +81,7 @@ bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser,
 CefKeyboardHandlerCToCpp::CefKeyboardHandlerCToCpp() {
 }
 
-template<> cef_keyboard_handler_t* CefCToCpp cef_keyboard_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefKeyboardHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -89,10 +89,10 @@ template<> cef_keyboard_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_KEYBOARD_HANDLER;
diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h
index 118a7027c..c4ddcd9cf 100644
--- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_keyboard_handler.h"
 #include "include/capi/cef_keyboard_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefKeyboardHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefKeyboardHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc
index e393c9cf5..ba820b60a 100644
--- a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc
@@ -143,7 +143,7 @@ void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) {
 CefLifeSpanHandlerCToCpp::CefLifeSpanHandlerCToCpp() {
 }
 
-template<> cef_life_span_handler_t* CefCToCpp cef_life_span_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefLifeSpanHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -151,10 +151,10 @@ template<> cef_life_span_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_LIFE_SPAN_HANDLER;
diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.h b/libcef_dll/ctocpp/life_span_handler_ctocpp.h
index c350474af..540e7b25b 100644
--- a/libcef_dll/ctocpp/life_span_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_life_span_handler_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefLifeSpanHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefLifeSpanHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/list_value_ctocpp.cc b/libcef_dll/ctocpp/list_value_ctocpp.cc
index 2c6b4fc69..9be76054e 100644
--- a/libcef_dll/ctocpp/list_value_ctocpp.cc
+++ b/libcef_dll/ctocpp/list_value_ctocpp.cc
@@ -495,16 +495,17 @@ bool CefListValueCToCpp::SetList(size_t index, CefRefPtr value) {
 CefListValueCToCpp::CefListValueCToCpp() {
 }
 
-template<> cef_list_value_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefListValue* c) {
+template<> cef_list_value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefListValue* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LIST_VALUE;
diff --git a/libcef_dll/ctocpp/list_value_ctocpp.h b/libcef_dll/ctocpp/list_value_ctocpp.h
index 30d3ca11d..c376ba9d8 100644
--- a/libcef_dll/ctocpp/list_value_ctocpp.h
+++ b/libcef_dll/ctocpp/list_value_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefListValueCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefListValueCToCpp();
 
diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.cc b/libcef_dll/ctocpp/load_handler_ctocpp.cc
index 1e5fe7f80..3b47e00d1 100644
--- a/libcef_dll/ctocpp/load_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/load_handler_ctocpp.cc
@@ -124,17 +124,17 @@ void CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser,
 CefLoadHandlerCToCpp::CefLoadHandlerCToCpp() {
 }
 
-template<> cef_load_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_load_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefLoadHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_LOAD_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LOAD_HANDLER;
diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.h b/libcef_dll/ctocpp/load_handler_ctocpp.h
index 9c86f1ae7..9cf0adcc9 100644
--- a/libcef_dll/ctocpp/load_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/load_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_load_handler.h"
 #include "include/capi/cef_load_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefLoadHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefLoadHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/menu_model_ctocpp.cc b/libcef_dll/ctocpp/menu_model_ctocpp.cc
index 52877e5b7..0c469babd 100644
--- a/libcef_dll/ctocpp/menu_model_ctocpp.cc
+++ b/libcef_dll/ctocpp/menu_model_ctocpp.cc
@@ -907,16 +907,17 @@ bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code,
 CefMenuModelCToCpp::CefMenuModelCToCpp() {
 }
 
-template<> cef_menu_model_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefMenuModel* c) {
+template<> cef_menu_model_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefMenuModel* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_MENU_MODEL;
diff --git a/libcef_dll/ctocpp/menu_model_ctocpp.h b/libcef_dll/ctocpp/menu_model_ctocpp.h
index d4493591f..5f43bf19e 100644
--- a/libcef_dll/ctocpp/menu_model_ctocpp.h
+++ b/libcef_dll/ctocpp/menu_model_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_menu_model.h"
 #include "include/capi/cef_menu_model_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefMenuModelCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefMenuModelCToCpp();
 
diff --git a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc
index c296a1e9b..96eadabab 100644
--- a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.cc
@@ -101,7 +101,7 @@ bool CefMenuModelDelegateCToCpp::FormatLabel(CefRefPtr menu_model,
 CefMenuModelDelegateCToCpp::CefMenuModelDelegateCToCpp() {
 }
 
-template<> cef_menu_model_delegate_t* CefCToCpp cef_menu_model_delegate_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefMenuModelDelegate* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -109,10 +109,10 @@ template<> cef_menu_model_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_MENU_MODEL_DELEGATE;
diff --git a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h
index 30869095c..e8feba065 100644
--- a/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/menu_model_delegate_ctocpp.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_menu_model_delegate_capi.h"
 #include "include/cef_menu_model.h"
 #include "include/capi/cef_menu_model_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefMenuModelDelegateCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefMenuModelDelegateCToCpp();
 
diff --git a/libcef_dll/ctocpp/navigation_entry_ctocpp.cc b/libcef_dll/ctocpp/navigation_entry_ctocpp.cc
index f3ca68592..5bd74ae04 100644
--- a/libcef_dll/ctocpp/navigation_entry_ctocpp.cc
+++ b/libcef_dll/ctocpp/navigation_entry_ctocpp.cc
@@ -171,7 +171,7 @@ CefRefPtr CefNavigationEntryCToCpp::GetSSLStatus() {
 CefNavigationEntryCToCpp::CefNavigationEntryCToCpp() {
 }
 
-template<> cef_navigation_entry_t* CefCToCpp cef_navigation_entry_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefNavigationEntry* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -179,10 +179,10 @@ template<> cef_navigation_entry_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_NAVIGATION_ENTRY;
diff --git a/libcef_dll/ctocpp/navigation_entry_ctocpp.h b/libcef_dll/ctocpp/navigation_entry_ctocpp.h
index f091d6cee..e360e50c3 100644
--- a/libcef_dll/ctocpp/navigation_entry_ctocpp.h
+++ b/libcef_dll/ctocpp/navigation_entry_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_navigation_entry.h"
 #include "include/capi/cef_navigation_entry_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefNavigationEntryCToCpp
-    : public CefCToCpp {
  public:
   CefNavigationEntryCToCpp();
diff --git a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc
index 051b74f5d..1c853e69f 100644
--- a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc
+++ b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc
@@ -46,7 +46,7 @@ bool CefNavigationEntryVisitorCToCpp::Visit(CefRefPtr entry,
 CefNavigationEntryVisitorCToCpp::CefNavigationEntryVisitorCToCpp() {
 }
 
-template<> cef_navigation_entry_visitor_t* CefCToCpp cef_navigation_entry_visitor_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefNavigationEntryVisitor* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -54,11 +54,11 @@ template<> cef_navigation_entry_visitor_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_NAVIGATION_ENTRY_VISITOR;
diff --git a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h
index 6bf1b735b..56c6ef2f4 100644
--- a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h
+++ b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefNavigationEntryVisitorCToCpp
-    : public CefCToCpp {
  public:
   CefNavigationEntryVisitorCToCpp();
diff --git a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc
index e3df7e2dd..2a29cc796 100644
--- a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.cc
@@ -40,7 +40,7 @@ void CefPdfPrintCallbackCToCpp::OnPdfPrintFinished(const CefString& path,
 CefPdfPrintCallbackCToCpp::CefPdfPrintCallbackCToCpp() {
 }
 
-template<> cef_pdf_print_callback_t* CefCToCpp cef_pdf_print_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefPdfPrintCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -48,10 +48,10 @@ template<> cef_pdf_print_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_PDF_PRINT_CALLBACK;
diff --git a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h
index fc3defe4d..961474b3c 100644
--- a/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/pdf_print_callback_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefPdfPrintCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefPdfPrintCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/post_data_ctocpp.cc b/libcef_dll/ctocpp/post_data_ctocpp.cc
index 6bf94d52e..35b0aef7b 100644
--- a/libcef_dll/ctocpp/post_data_ctocpp.cc
+++ b/libcef_dll/ctocpp/post_data_ctocpp.cc
@@ -168,16 +168,16 @@ void CefPostDataCToCpp::RemoveElements() {
 CefPostDataCToCpp::CefPostDataCToCpp() {
 }
 
-template<> cef_post_data_t* CefCToCpp cef_post_data_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefPostData* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_POST_DATA;
diff --git a/libcef_dll/ctocpp/post_data_ctocpp.h b/libcef_dll/ctocpp/post_data_ctocpp.h
index 5a72fe5e1..820b53871 100644
--- a/libcef_dll/ctocpp/post_data_ctocpp.h
+++ b/libcef_dll/ctocpp/post_data_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_request.h"
 #include "include/capi/cef_request_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPostDataCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefPostDataCToCpp();
 
diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/libcef_dll/ctocpp/post_data_element_ctocpp.cc
index 52d98200f..7ad7a1eba 100644
--- a/libcef_dll/ctocpp/post_data_element_ctocpp.cc
+++ b/libcef_dll/ctocpp/post_data_element_ctocpp.cc
@@ -159,7 +159,7 @@ size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) {
 CefPostDataElementCToCpp::CefPostDataElementCToCpp() {
 }
 
-template<> cef_post_data_element_t* CefCToCpp cef_post_data_element_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefPostDataElement* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -167,10 +167,10 @@ template<> cef_post_data_element_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_POST_DATA_ELEMENT;
diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.h b/libcef_dll/ctocpp/post_data_element_ctocpp.h
index e3cb9477d..019bc2b51 100644
--- a/libcef_dll/ctocpp/post_data_element_ctocpp.h
+++ b/libcef_dll/ctocpp/post_data_element_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request.h"
 #include "include/capi/cef_request_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPostDataElementCToCpp
-    : public CefCToCpp {
  public:
   CefPostDataElementCToCpp();
diff --git a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc
index 5ffe70efb..ed9e40f17 100644
--- a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc
@@ -51,7 +51,7 @@ void CefPrintDialogCallbackCToCpp::Cancel() {
 CefPrintDialogCallbackCToCpp::CefPrintDialogCallbackCToCpp() {
 }
 
-template<> cef_print_dialog_callback_t* CefCToCpp cef_print_dialog_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefPrintDialogCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -59,10 +59,10 @@ template<> cef_print_dialog_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_PRINT_DIALOG_CALLBACK;
diff --git a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h
index 6c7f9156b..db4e74d47 100644
--- a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_print_handler.h"
 #include "include/capi/cef_print_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPrintDialogCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefPrintDialogCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.cc b/libcef_dll/ctocpp/print_handler_ctocpp.cc
index 1ad5bb5b3..301255fab 100644
--- a/libcef_dll/ctocpp/print_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/print_handler_ctocpp.cc
@@ -140,7 +140,7 @@ CefSize CefPrintHandlerCToCpp::GetPdfPaperSize(int device_units_per_inch) {
 CefPrintHandlerCToCpp::CefPrintHandlerCToCpp() {
 }
 
-template<> cef_print_handler_t* CefCToCpp cef_print_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefPrintHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -148,9 +148,9 @@ template<> cef_print_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_PRINT_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PRINT_HANDLER;
diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.h b/libcef_dll/ctocpp/print_handler_ctocpp.h
index f9dce8547..e063ff08c 100644
--- a/libcef_dll/ctocpp/print_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/print_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_print_handler.h"
 #include "include/capi/cef_print_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefPrintHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefPrintHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/print_job_callback_ctocpp.cc b/libcef_dll/ctocpp/print_job_callback_ctocpp.cc
index 3c46f9aa4..74d0dc291 100644
--- a/libcef_dll/ctocpp/print_job_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/print_job_callback_ctocpp.cc
@@ -32,7 +32,7 @@ void CefPrintJobCallbackCToCpp::Continue() {
 CefPrintJobCallbackCToCpp::CefPrintJobCallbackCToCpp() {
 }
 
-template<> cef_print_job_callback_t* CefCToCpp cef_print_job_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefPrintJobCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -40,10 +40,10 @@ template<> cef_print_job_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_PRINT_JOB_CALLBACK;
diff --git a/libcef_dll/ctocpp/print_job_callback_ctocpp.h b/libcef_dll/ctocpp/print_job_callback_ctocpp.h
index 1dc54ab54..129a7e989 100644
--- a/libcef_dll/ctocpp/print_job_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/print_job_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_print_handler.h"
 #include "include/capi/cef_print_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPrintJobCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefPrintJobCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/print_settings_ctocpp.cc b/libcef_dll/ctocpp/print_settings_ctocpp.cc
index 2d6f6ad27..7d80f72c0 100644
--- a/libcef_dll/ctocpp/print_settings_ctocpp.cc
+++ b/libcef_dll/ctocpp/print_settings_ctocpp.cc
@@ -388,7 +388,7 @@ CefPrintSettings::DuplexMode CefPrintSettingsCToCpp::GetDuplexMode() {
 CefPrintSettingsCToCpp::CefPrintSettingsCToCpp() {
 }
 
-template<> cef_print_settings_t* CefCToCpp cef_print_settings_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefPrintSettings* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -396,9 +396,9 @@ template<> cef_print_settings_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_PRINT_SETTINGS;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PRINT_SETTINGS;
diff --git a/libcef_dll/ctocpp/print_settings_ctocpp.h b/libcef_dll/ctocpp/print_settings_ctocpp.h
index fd26921e6..b07988fa9 100644
--- a/libcef_dll/ctocpp/print_settings_ctocpp.h
+++ b/libcef_dll/ctocpp/print_settings_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_print_settings.h"
 #include "include/capi/cef_print_settings_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPrintSettingsCToCpp
-    : public CefCToCpp {
  public:
   CefPrintSettingsCToCpp();
diff --git a/libcef_dll/ctocpp/process_message_ctocpp.cc b/libcef_dll/ctocpp/process_message_ctocpp.cc
index 2f7b81d11..acf98c59b 100644
--- a/libcef_dll/ctocpp/process_message_ctocpp.cc
+++ b/libcef_dll/ctocpp/process_message_ctocpp.cc
@@ -113,7 +113,7 @@ CefRefPtr CefProcessMessageCToCpp::GetArgumentList() {
 CefProcessMessageCToCpp::CefProcessMessageCToCpp() {
 }
 
-template<> cef_process_message_t* CefCToCpp cef_process_message_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefProcessMessage* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -121,9 +121,10 @@ template<> cef_process_message_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_PROCESS_MESSAGE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_PROCESS_MESSAGE;
diff --git a/libcef_dll/ctocpp/process_message_ctocpp.h b/libcef_dll/ctocpp/process_message_ctocpp.h
index d977a75cc..a3b209a45 100644
--- a/libcef_dll/ctocpp/process_message_ctocpp.h
+++ b/libcef_dll/ctocpp/process_message_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_process_message.h"
 #include "include/capi/cef_process_message_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefProcessMessageCToCpp
-    : public CefCToCpp {
  public:
   CefProcessMessageCToCpp();
diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.cc b/libcef_dll/ctocpp/read_handler_ctocpp.cc
index 205d1d9e2..2a3d781bd 100644
--- a/libcef_dll/ctocpp/read_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/read_handler_ctocpp.cc
@@ -101,17 +101,17 @@ bool CefReadHandlerCToCpp::MayBlock() {
 CefReadHandlerCToCpp::CefReadHandlerCToCpp() {
 }
 
-template<> cef_read_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_read_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefReadHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_READ_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_READ_HANDLER;
diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.h b/libcef_dll/ctocpp/read_handler_ctocpp.h
index 55475f2b5..6f5159e22 100644
--- a/libcef_dll/ctocpp/read_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/read_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefReadHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefReadHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc
index ce6d32c39..65c7db096 100644
--- a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.cc
@@ -37,7 +37,7 @@ void CefRegisterCdmCallbackCToCpp::OnCdmRegistrationComplete(
 CefRegisterCdmCallbackCToCpp::CefRegisterCdmCallbackCToCpp() {
 }
 
-template<> cef_register_cdm_callback_t* CefCToCpp cef_register_cdm_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRegisterCdmCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -45,10 +45,10 @@ template<> cef_register_cdm_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_REGISTER_CDM_CALLBACK;
diff --git a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h
index 0aa1b359b..d7c0e2549 100644
--- a/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/register_cdm_callback_ctocpp.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefRegisterCdmCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefRegisterCdmCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.cc b/libcef_dll/ctocpp/render_handler_ctocpp.cc
index 6b26552c9..2bcd17d99 100644
--- a/libcef_dll/ctocpp/render_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/render_handler_ctocpp.cc
@@ -328,7 +328,7 @@ void CefRenderHandlerCToCpp::OnImeCompositionRangeChanged(
 CefRenderHandlerCToCpp::CefRenderHandlerCToCpp() {
 }
 
-template<> cef_render_handler_t* CefCToCpp cef_render_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefRenderHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -336,9 +336,9 @@ template<> cef_render_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_RENDER_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RENDER_HANDLER;
diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.h b/libcef_dll/ctocpp/render_handler_ctocpp.h
index 5720df96b..b49310251 100644
--- a/libcef_dll/ctocpp/render_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/render_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_render_handler.h"
 #include "include/capi/cef_render_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefRenderHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefRenderHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/render_process_handler_ctocpp.cc b/libcef_dll/ctocpp/render_process_handler_ctocpp.cc
index c56a52f8f..78ea66135 100644
--- a/libcef_dll/ctocpp/render_process_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/render_process_handler_ctocpp.cc
@@ -293,7 +293,7 @@ bool CefRenderProcessHandlerCToCpp::OnProcessMessageReceived(
 CefRenderProcessHandlerCToCpp::CefRenderProcessHandlerCToCpp() {
 }
 
-template<> cef_render_process_handler_t* CefCToCpp cef_render_process_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRenderProcessHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -301,10 +301,10 @@ template<> cef_render_process_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_RENDER_PROCESS_HANDLER;
diff --git a/libcef_dll/ctocpp/render_process_handler_ctocpp.h b/libcef_dll/ctocpp/render_process_handler_ctocpp.h
index 848349757..a4274e97f 100644
--- a/libcef_dll/ctocpp/render_process_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/render_process_handler_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_render_process_handler.h"
 #include "include/capi/cef_render_process_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefRenderProcessHandlerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefRenderProcessHandlerCToCpp();
 
diff --git a/libcef_dll/ctocpp/request_callback_ctocpp.cc b/libcef_dll/ctocpp/request_callback_ctocpp.cc
index 674592bf8..f287fd61a 100644
--- a/libcef_dll/ctocpp/request_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/request_callback_ctocpp.cc
@@ -44,7 +44,7 @@ void CefRequestCallbackCToCpp::Cancel() {
 CefRequestCallbackCToCpp::CefRequestCallbackCToCpp() {
 }
 
-template<> cef_request_callback_t* CefCToCpp cef_request_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRequestCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -52,10 +52,10 @@ template<> cef_request_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_REQUEST_CALLBACK;
diff --git a/libcef_dll/ctocpp/request_callback_ctocpp.h b/libcef_dll/ctocpp/request_callback_ctocpp.h
index 5f87fdd9a..c49f1cbf3 100644
--- a/libcef_dll/ctocpp/request_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/request_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request_handler.h"
 #include "include/capi/cef_request_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRequestCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefRequestCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/request_context_ctocpp.cc b/libcef_dll/ctocpp/request_context_ctocpp.cc
index 9ae0da4cd..11783a502 100644
--- a/libcef_dll/ctocpp/request_context_ctocpp.cc
+++ b/libcef_dll/ctocpp/request_context_ctocpp.cc
@@ -421,7 +421,7 @@ cef_errorcode_t CefRequestContextCToCpp::ResolveHostCached(
 CefRequestContextCToCpp::CefRequestContextCToCpp() {
 }
 
-template<> cef_request_context_t* CefCToCpp cef_request_context_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRequestContext* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -429,9 +429,10 @@ template<> cef_request_context_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_REQUEST_CONTEXT;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_REQUEST_CONTEXT;
diff --git a/libcef_dll/ctocpp/request_context_ctocpp.h b/libcef_dll/ctocpp/request_context_ctocpp.h
index 7fc49d559..03eb35dbd 100644
--- a/libcef_dll/ctocpp/request_context_ctocpp.h
+++ b/libcef_dll/ctocpp/request_context_ctocpp.h
@@ -23,12 +23,12 @@
 #include "include/capi/cef_request_context_capi.h"
 #include "include/cef_scheme.h"
 #include "include/capi/cef_scheme_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRequestContextCToCpp
-    : public CefCToCpp {
  public:
   CefRequestContextCToCpp();
diff --git a/libcef_dll/ctocpp/request_context_handler_ctocpp.cc b/libcef_dll/ctocpp/request_context_handler_ctocpp.cc
index 783433d16..e253567d8 100644
--- a/libcef_dll/ctocpp/request_context_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/request_context_handler_ctocpp.cc
@@ -74,7 +74,7 @@ bool CefRequestContextHandlerCToCpp::OnBeforePluginLoad(
 CefRequestContextHandlerCToCpp::CefRequestContextHandlerCToCpp() {
 }
 
-template<> cef_request_context_handler_t* CefCToCpp cef_request_context_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRequestContextHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -82,10 +82,10 @@ template<> cef_request_context_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_REQUEST_CONTEXT_HANDLER;
diff --git a/libcef_dll/ctocpp/request_context_handler_ctocpp.h b/libcef_dll/ctocpp/request_context_handler_ctocpp.h
index 2a92d64e4..82094aba9 100644
--- a/libcef_dll/ctocpp/request_context_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/request_context_handler_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_request_context_handler.h"
 #include "include/capi/cef_request_context_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefRequestContextHandlerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefRequestContextHandlerCToCpp();
 
diff --git a/libcef_dll/ctocpp/request_ctocpp.cc b/libcef_dll/ctocpp/request_ctocpp.cc
index f3c6f1bd9..646ee8c94 100644
--- a/libcef_dll/ctocpp/request_ctocpp.cc
+++ b/libcef_dll/ctocpp/request_ctocpp.cc
@@ -380,16 +380,16 @@ uint64 CefRequestCToCpp::GetIdentifier() {
 CefRequestCToCpp::CefRequestCToCpp() {
 }
 
-template<> cef_request_t* CefCToCpp cef_request_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefRequest* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_REQUEST;
diff --git a/libcef_dll/ctocpp/request_ctocpp.h b/libcef_dll/ctocpp/request_ctocpp.h
index 832ebd8b9..6f55e95fd 100644
--- a/libcef_dll/ctocpp/request_ctocpp.h
+++ b/libcef_dll/ctocpp/request_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request.h"
 #include "include/capi/cef_request_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRequestCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefRequestCToCpp();
 
diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.cc b/libcef_dll/ctocpp/request_handler_ctocpp.cc
index d924b8cbe..b55fe5b84 100644
--- a/libcef_dll/ctocpp/request_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/request_handler_ctocpp.cc
@@ -572,7 +572,7 @@ void CefRequestHandlerCToCpp::OnRenderProcessTerminated(
 CefRequestHandlerCToCpp::CefRequestHandlerCToCpp() {
 }
 
-template<> cef_request_handler_t* CefCToCpp cef_request_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRequestHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -580,9 +580,10 @@ template<> cef_request_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_REQUEST_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_REQUEST_HANDLER;
diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.h b/libcef_dll/ctocpp/request_handler_ctocpp.h
index 199d6f4f0..0dfe69115 100644
--- a/libcef_dll/ctocpp/request_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/request_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request_handler.h"
 #include "include/capi/cef_request_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefRequestHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefRequestHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/resolve_callback_ctocpp.cc b/libcef_dll/ctocpp/resolve_callback_ctocpp.cc
index dee2cc19c..ac3d136e6 100644
--- a/libcef_dll/ctocpp/resolve_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/resolve_callback_ctocpp.cc
@@ -48,7 +48,7 @@ void CefResolveCallbackCToCpp::OnResolveCompleted(cef_errorcode_t result,
 CefResolveCallbackCToCpp::CefResolveCallbackCToCpp() {
 }
 
-template<> cef_resolve_callback_t* CefCToCpp cef_resolve_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefResolveCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -56,10 +56,10 @@ template<> cef_resolve_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_RESOLVE_CALLBACK;
diff --git a/libcef_dll/ctocpp/resolve_callback_ctocpp.h b/libcef_dll/ctocpp/resolve_callback_ctocpp.h
index 12d3a996c..b7a48dcba 100644
--- a/libcef_dll/ctocpp/resolve_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/resolve_callback_ctocpp.h
@@ -23,12 +23,12 @@
 #include "include/capi/cef_request_context_capi.h"
 #include "include/cef_scheme.h"
 #include "include/capi/cef_scheme_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefResolveCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefResolveCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/resource_bundle_ctocpp.cc b/libcef_dll/ctocpp/resource_bundle_ctocpp.cc
index ec8fcf413..7823e08d7 100644
--- a/libcef_dll/ctocpp/resource_bundle_ctocpp.cc
+++ b/libcef_dll/ctocpp/resource_bundle_ctocpp.cc
@@ -88,7 +88,7 @@ bool CefResourceBundleCToCpp::GetDataResourceForScale(int resource_id,
 CefResourceBundleCToCpp::CefResourceBundleCToCpp() {
 }
 
-template<> cef_resource_bundle_t* CefCToCpp cef_resource_bundle_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefResourceBundle* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -96,9 +96,10 @@ template<> cef_resource_bundle_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_RESOURCE_BUNDLE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_RESOURCE_BUNDLE;
diff --git a/libcef_dll/ctocpp/resource_bundle_ctocpp.h b/libcef_dll/ctocpp/resource_bundle_ctocpp.h
index f4acfed95..2778e07a2 100644
--- a/libcef_dll/ctocpp/resource_bundle_ctocpp.h
+++ b/libcef_dll/ctocpp/resource_bundle_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_resource_bundle.h"
 #include "include/capi/cef_resource_bundle_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefResourceBundleCToCpp
-    : public CefCToCpp {
  public:
   CefResourceBundleCToCpp();
diff --git a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc
index a4c1d7402..1baae8565 100644
--- a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc
@@ -75,7 +75,7 @@ bool CefResourceBundleHandlerCToCpp::GetDataResourceForScale(int resource_id,
 CefResourceBundleHandlerCToCpp::CefResourceBundleHandlerCToCpp() {
 }
 
-template<> cef_resource_bundle_handler_t* CefCToCpp cef_resource_bundle_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefResourceBundleHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -83,10 +83,10 @@ template<> cef_resource_bundle_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_RESOURCE_BUNDLE_HANDLER;
diff --git a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h
index b52503ecb..0703f89fc 100644
--- a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_resource_bundle_handler.h"
 #include "include/capi/cef_resource_bundle_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefResourceBundleHandlerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefResourceBundleHandlerCToCpp();
 
diff --git a/libcef_dll/ctocpp/resource_handler_ctocpp.cc b/libcef_dll/ctocpp/resource_handler_ctocpp.cc
index 5d548625e..ba1209bfc 100644
--- a/libcef_dll/ctocpp/resource_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/resource_handler_ctocpp.cc
@@ -140,7 +140,7 @@ void CefResourceHandlerCToCpp::Cancel() {
 CefResourceHandlerCToCpp::CefResourceHandlerCToCpp() {
 }
 
-template<> cef_resource_handler_t* CefCToCpp cef_resource_handler_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefResourceHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -148,10 +148,10 @@ template<> cef_resource_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_RESOURCE_HANDLER;
diff --git a/libcef_dll/ctocpp/resource_handler_ctocpp.h b/libcef_dll/ctocpp/resource_handler_ctocpp.h
index ade338edf..34686eee7 100644
--- a/libcef_dll/ctocpp/resource_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/resource_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_resource_handler.h"
 #include "include/capi/cef_resource_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefResourceHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefResourceHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/response_ctocpp.cc b/libcef_dll/ctocpp/response_ctocpp.cc
index f0654a05a..20a3d905f 100644
--- a/libcef_dll/ctocpp/response_ctocpp.cc
+++ b/libcef_dll/ctocpp/response_ctocpp.cc
@@ -236,16 +236,16 @@ void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) {
 CefResponseCToCpp::CefResponseCToCpp() {
 }
 
-template<> cef_response_t* CefCToCpp cef_response_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefResponse* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_RESPONSE;
diff --git a/libcef_dll/ctocpp/response_ctocpp.h b/libcef_dll/ctocpp/response_ctocpp.h
index b123417f1..bf041e723 100644
--- a/libcef_dll/ctocpp/response_ctocpp.h
+++ b/libcef_dll/ctocpp/response_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_response.h"
 #include "include/capi/cef_response_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefResponseCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefResponseCToCpp();
 
diff --git a/libcef_dll/ctocpp/response_filter_ctocpp.cc b/libcef_dll/ctocpp/response_filter_ctocpp.cc
index eeba668e7..2f90784ca 100644
--- a/libcef_dll/ctocpp/response_filter_ctocpp.cc
+++ b/libcef_dll/ctocpp/response_filter_ctocpp.cc
@@ -63,7 +63,7 @@ CefResponseFilter::FilterStatus CefResponseFilterCToCpp::Filter(void* data_in,
 CefResponseFilterCToCpp::CefResponseFilterCToCpp() {
 }
 
-template<> cef_response_filter_t* CefCToCpp cef_response_filter_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefResponseFilter* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -71,9 +71,10 @@ template<> cef_response_filter_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_RESPONSE_FILTER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_RESPONSE_FILTER;
diff --git a/libcef_dll/ctocpp/response_filter_ctocpp.h b/libcef_dll/ctocpp/response_filter_ctocpp.h
index 0225c28d0..3cd86f663 100644
--- a/libcef_dll/ctocpp/response_filter_ctocpp.h
+++ b/libcef_dll/ctocpp/response_filter_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_response_filter.h"
 #include "include/capi/cef_response_filter_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefResponseFilterCToCpp
-    : public CefCToCpp {
  public:
   CefResponseFilterCToCpp();
diff --git a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc
index 30656a591..eb9556d6d 100644
--- a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.cc
@@ -46,7 +46,7 @@ void CefRunContextMenuCallbackCToCpp::Cancel() {
 CefRunContextMenuCallbackCToCpp::CefRunContextMenuCallbackCToCpp() {
 }
 
-template<> cef_run_context_menu_callback_t* CefCToCpp cef_run_context_menu_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRunContextMenuCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -54,11 +54,11 @@ template<> cef_run_context_menu_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt =
     0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_RUN_CONTEXT_MENU_CALLBACK;
diff --git a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h
index 76a3ff1c2..933fea821 100644
--- a/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_context_menu_handler.h"
 #include "include/capi/cef_context_menu_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefRunContextMenuCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefRunContextMenuCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc
index 2a40d7f51..8de11f315 100644
--- a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc
@@ -52,7 +52,7 @@ void CefRunFileDialogCallbackCToCpp::OnFileDialogDismissed(
 CefRunFileDialogCallbackCToCpp::CefRunFileDialogCallbackCToCpp() {
 }
 
-template<> cef_run_file_dialog_callback_t* CefCToCpp cef_run_file_dialog_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefRunFileDialogCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -60,10 +60,10 @@ template<> cef_run_file_dialog_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_RUN_FILE_DIALOG_CALLBACK;
diff --git a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h
index 636d231e0..eebd19442 100644
--- a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h
@@ -23,13 +23,13 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/cef_client.h"
 #include "include/capi/cef_client_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefRunFileDialogCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefRunFileDialogCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc
index 4f59bdc6f..a25954fe3 100644
--- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc
+++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc
@@ -55,7 +55,7 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create(
 CefSchemeHandlerFactoryCToCpp::CefSchemeHandlerFactoryCToCpp() {
 }
 
-template<> cef_scheme_handler_factory_t* CefCToCpp cef_scheme_handler_factory_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefSchemeHandlerFactory* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -63,10 +63,10 @@ template<> cef_scheme_handler_factory_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_SCHEME_HANDLER_FACTORY;
diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h
index d981035c0..01b0d1b4c 100644
--- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h
+++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_scheme.h"
 #include "include/capi/cef_scheme_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefSchemeHandlerFactoryCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefSchemeHandlerFactoryCToCpp();
 
diff --git a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc
index f51ba0ff5..73c66f332 100644
--- a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.cc
@@ -38,7 +38,7 @@ CefSelectClientCertificateCallbackCToCpp::CefSelectClientCertificateCallbackCToC
     ) {
 }
 
-template<> cef_select_client_certificate_callback_t* CefCToCpp cef_select_client_certificate_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefSelectClientCertificateCallback* c) {
@@ -47,12 +47,12 @@ template<> cef_select_client_certificate_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_SELECT_CLIENT_CERTIFICATE_CALLBACK;
diff --git a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h
index 82c50bb8f..02cae4237 100644
--- a/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/select_client_certificate_callback_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_request_handler.h"
 #include "include/capi/cef_request_handler_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefSelectClientCertificateCallbackCToCpp
-    : public CefCToCpp {
  public:
diff --git a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc
index 02e53491c..fdfb97722 100644
--- a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc
@@ -33,7 +33,7 @@ void CefSetCookieCallbackCToCpp::OnComplete(bool success) {
 CefSetCookieCallbackCToCpp::CefSetCookieCallbackCToCpp() {
 }
 
-template<> cef_set_cookie_callback_t* CefCToCpp cef_set_cookie_callback_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefSetCookieCallback* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -41,10 +41,10 @@ template<> cef_set_cookie_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_SET_COOKIE_CALLBACK;
diff --git a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h
index e536cb313..3bcb48737 100644
--- a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h
@@ -20,13 +20,13 @@
 
 #include "include/cef_cookie.h"
 #include "include/capi/cef_cookie_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefSetCookieCallbackCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefSetCookieCallbackCToCpp();
 
diff --git a/libcef_dll/ctocpp/sslinfo_ctocpp.cc b/libcef_dll/ctocpp/sslinfo_ctocpp.cc
index 539585fc5..9f0fbef84 100644
--- a/libcef_dll/ctocpp/sslinfo_ctocpp.cc
+++ b/libcef_dll/ctocpp/sslinfo_ctocpp.cc
@@ -50,16 +50,16 @@ CefRefPtr CefSSLInfoCToCpp::GetX509Certificate() {
 CefSSLInfoCToCpp::CefSSLInfoCToCpp() {
 }
 
-template<> cef_sslinfo_t* CefCToCpp cef_sslinfo_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefSSLInfo* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SSLINFO;
diff --git a/libcef_dll/ctocpp/sslinfo_ctocpp.h b/libcef_dll/ctocpp/sslinfo_ctocpp.h
index c961bf2ab..c494eb320 100644
--- a/libcef_dll/ctocpp/sslinfo_ctocpp.h
+++ b/libcef_dll/ctocpp/sslinfo_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_ssl_info.h"
 #include "include/capi/cef_ssl_info_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefSSLInfoCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefSSLInfoCToCpp();
 
diff --git a/libcef_dll/ctocpp/sslstatus_ctocpp.cc b/libcef_dll/ctocpp/sslstatus_ctocpp.cc
index 62acdd191..c0fe9b924 100644
--- a/libcef_dll/ctocpp/sslstatus_ctocpp.cc
+++ b/libcef_dll/ctocpp/sslstatus_ctocpp.cc
@@ -92,16 +92,17 @@ CefRefPtr CefSSLStatusCToCpp::GetX509Certificate() {
 CefSSLStatusCToCpp::CefSSLStatusCToCpp() {
 }
 
-template<> cef_sslstatus_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefSSLStatus* c) {
+template<> cef_sslstatus_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefSSLStatus* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SSLSTATUS;
diff --git a/libcef_dll/ctocpp/sslstatus_ctocpp.h b/libcef_dll/ctocpp/sslstatus_ctocpp.h
index f5f7e3e08..3d3904909 100644
--- a/libcef_dll/ctocpp/sslstatus_ctocpp.h
+++ b/libcef_dll/ctocpp/sslstatus_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_ssl_status.h"
 #include "include/capi/cef_ssl_status_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefSSLStatusCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefSSLStatusCToCpp();
 
diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/libcef_dll/ctocpp/stream_reader_ctocpp.cc
index d99d3c16c..8e82738f1 100644
--- a/libcef_dll/ctocpp/stream_reader_ctocpp.cc
+++ b/libcef_dll/ctocpp/stream_reader_ctocpp.cc
@@ -157,7 +157,7 @@ bool CefStreamReaderCToCpp::MayBlock() {
 CefStreamReaderCToCpp::CefStreamReaderCToCpp() {
 }
 
-template<> cef_stream_reader_t* CefCToCpp cef_stream_reader_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefStreamReader* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -165,9 +165,9 @@ template<> cef_stream_reader_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_STREAM_READER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_STREAM_READER;
diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.h b/libcef_dll/ctocpp/stream_reader_ctocpp.h
index fab165bcf..4dbcd12f3 100644
--- a/libcef_dll/ctocpp/stream_reader_ctocpp.h
+++ b/libcef_dll/ctocpp/stream_reader_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefStreamReaderCToCpp
-    : public CefCToCpp {
  public:
   CefStreamReaderCToCpp();
diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/libcef_dll/ctocpp/stream_writer_ctocpp.cc
index 48cf497ea..b4c6fe123 100644
--- a/libcef_dll/ctocpp/stream_writer_ctocpp.cc
+++ b/libcef_dll/ctocpp/stream_writer_ctocpp.cc
@@ -139,7 +139,7 @@ bool CefStreamWriterCToCpp::MayBlock() {
 CefStreamWriterCToCpp::CefStreamWriterCToCpp() {
 }
 
-template<> cef_stream_writer_t* CefCToCpp cef_stream_writer_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefStreamWriter* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -147,9 +147,9 @@ template<> cef_stream_writer_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_STREAM_WRITER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_STREAM_WRITER;
diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.h b/libcef_dll/ctocpp/stream_writer_ctocpp.h
index 3d406030d..3f7476d86 100644
--- a/libcef_dll/ctocpp/stream_writer_ctocpp.h
+++ b/libcef_dll/ctocpp/stream_writer_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefStreamWriterCToCpp
-    : public CefCToCpp {
  public:
   CefStreamWriterCToCpp();
diff --git a/libcef_dll/ctocpp/string_visitor_ctocpp.cc b/libcef_dll/ctocpp/string_visitor_ctocpp.cc
index 072fcb286..18e2cab95 100644
--- a/libcef_dll/ctocpp/string_visitor_ctocpp.cc
+++ b/libcef_dll/ctocpp/string_visitor_ctocpp.cc
@@ -35,7 +35,7 @@ void CefStringVisitorCToCpp::Visit(const CefString& string) {
 CefStringVisitorCToCpp::CefStringVisitorCToCpp() {
 }
 
-template<> cef_string_visitor_t* CefCToCpp cef_string_visitor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefStringVisitor* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -43,9 +43,9 @@ template<> cef_string_visitor_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_STRING_VISITOR;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_STRING_VISITOR;
diff --git a/libcef_dll/ctocpp/string_visitor_ctocpp.h b/libcef_dll/ctocpp/string_visitor_ctocpp.h
index f038eee3f..b8fd4c569 100644
--- a/libcef_dll/ctocpp/string_visitor_ctocpp.h
+++ b/libcef_dll/ctocpp/string_visitor_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_string_visitor.h"
 #include "include/capi/cef_string_visitor_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefStringVisitorCToCpp
-    : public CefCToCpp {
  public:
   CefStringVisitorCToCpp();
diff --git a/libcef_dll/ctocpp/task_ctocpp.cc b/libcef_dll/ctocpp/task_ctocpp.cc
index 76914a225..e447dd5b5 100644
--- a/libcef_dll/ctocpp/task_ctocpp.cc
+++ b/libcef_dll/ctocpp/task_ctocpp.cc
@@ -32,16 +32,16 @@ void CefTaskCToCpp::Execute() {
 CefTaskCToCpp::CefTaskCToCpp() {
 }
 
-template<> cef_task_t* CefCToCpp cef_task_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefTask* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TASK;
diff --git a/libcef_dll/ctocpp/task_ctocpp.h b/libcef_dll/ctocpp/task_ctocpp.h
index 17b61ecf4..c3cb9b339 100644
--- a/libcef_dll/ctocpp/task_ctocpp.h
+++ b/libcef_dll/ctocpp/task_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_task.h"
 #include "include/capi/cef_task_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefTaskCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefTaskCToCpp();
 
diff --git a/libcef_dll/ctocpp/task_runner_ctocpp.cc b/libcef_dll/ctocpp/task_runner_ctocpp.cc
index 99086ed5f..8537c2225 100644
--- a/libcef_dll/ctocpp/task_runner_ctocpp.cc
+++ b/libcef_dll/ctocpp/task_runner_ctocpp.cc
@@ -137,16 +137,17 @@ bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr task,
 CefTaskRunnerCToCpp::CefTaskRunnerCToCpp() {
 }
 
-template<> cef_task_runner_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefTaskRunner* c) {
+template<> cef_task_runner_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefTaskRunner* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_TASK_RUNNER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TASK_RUNNER;
diff --git a/libcef_dll/ctocpp/task_runner_ctocpp.h b/libcef_dll/ctocpp/task_runner_ctocpp.h
index 1187eb7af..a3631f8db 100644
--- a/libcef_dll/ctocpp/task_runner_ctocpp.h
+++ b/libcef_dll/ctocpp/task_runner_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_task.h"
 #include "include/capi/cef_task_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTaskRunnerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefTaskRunnerCToCpp();
 
diff --git a/libcef_dll/ctocpp/test/translator_test_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ctocpp.cc
index 3702eda6f..f4444f299 100644
--- a/libcef_dll/ctocpp/test/translator_test_ctocpp.cc
+++ b/libcef_dll/ctocpp/test/translator_test_ctocpp.cc
@@ -1396,7 +1396,7 @@ bool CefTranslatorTestCToCpp::SetRawPtrClientList(
 CefTranslatorTestCToCpp::CefTranslatorTestCToCpp() {
 }
 
-template<> cef_translator_test_t* CefCToCpp cef_translator_test_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefTranslatorTest* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -1404,9 +1404,10 @@ template<> cef_translator_test_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_TRANSLATOR_TEST;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_TRANSLATOR_TEST;
diff --git a/libcef_dll/ctocpp/test/translator_test_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ctocpp.h
index cc2fe198b..07afe803a 100644
--- a/libcef_dll/ctocpp/test/translator_test_ctocpp.h
+++ b/libcef_dll/ctocpp/test/translator_test_ctocpp.h
@@ -22,12 +22,12 @@
 #include 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTranslatorTestCToCpp
-    : public CefCToCpp {
  public:
   CefTranslatorTestCToCpp();
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc
index 5aac818bd..9ab2284b9 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.cc
@@ -51,7 +51,7 @@ CefTranslatorTestRefPtrClientChildCToCpp::CefTranslatorTestRefPtrClientChildCToC
     ) {
 }
 
-template<> cef_translator_test_ref_ptr_client_child_t* CefCToCpp cef_translator_test_ref_ptr_client_child_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefTranslatorTestRefPtrClientChild* c) {
@@ -60,12 +60,12 @@ template<> cef_translator_test_ref_ptr_client_child_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_CLIENT_CHILD;
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h
index 0dd9e5cb1..ed10750f9 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_child_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefTranslatorTestRefPtrClientChildCToCpp
-    : public CefCToCpp {
  public:
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc
index e1a7ca770..7b1cb40b7 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.cc
@@ -36,7 +36,7 @@ int CefTranslatorTestRefPtrClientCToCpp::GetValue() {
 CefTranslatorTestRefPtrClientCToCpp::CefTranslatorTestRefPtrClientCToCpp() {
 }
 
-template<> cef_translator_test_ref_ptr_client_t* CefCToCpp cef_translator_test_ref_ptr_client_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefTranslatorTestRefPtrClient* c) {
@@ -50,12 +50,12 @@ template<> cef_translator_test_ref_ptr_client_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_CLIENT;
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h
index 83ffc852d..6222c5c3d 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_client_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefTranslatorTestRefPtrClientCToCpp
-    : public CefCToCpp {
  public:
   CefTranslatorTestRefPtrClientCToCpp();
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc
index 9bcab59d1..4445e2faa 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.cc
@@ -125,7 +125,7 @@ CefTranslatorTestRefPtrLibraryChildChildCToCpp::CefTranslatorTestRefPtrLibraryCh
     ) {
 }
 
-template<> cef_translator_test_ref_ptr_library_child_child_t* CefCToCpp cef_translator_test_ref_ptr_library_child_child_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefTranslatorTestRefPtrLibraryChildChild* c) {
@@ -134,12 +134,12 @@ template<> cef_translator_test_ref_ptr_library_child_child_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD_CHILD;
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h
index eefaf1232..affefbf2b 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_child_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTranslatorTestRefPtrLibraryChildChildCToCpp
-    : public CefCToCpp {
  public:
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc
index c52751c55..4917e0278 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.cc
@@ -94,7 +94,7 @@ CefTranslatorTestRefPtrLibraryChildCToCpp::CefTranslatorTestRefPtrLibraryChildCT
     ) {
 }
 
-template<> cef_translator_test_ref_ptr_library_child_t* CefCToCpp cef_translator_test_ref_ptr_library_child_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefTranslatorTestRefPtrLibraryChild* c) {
@@ -108,12 +108,12 @@ template<> cef_translator_test_ref_ptr_library_child_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_LIBRARY_CHILD;
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h
index 3d2d8d977..f8149f837 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_child_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTranslatorTestRefPtrLibraryChildCToCpp
-    : public CefCToCpp {
  public:
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc
index c39b0504c..f8887a2ce 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.cc
@@ -65,7 +65,7 @@ void CefTranslatorTestRefPtrLibraryCToCpp::SetValue(int value) {
 CefTranslatorTestRefPtrLibraryCToCpp::CefTranslatorTestRefPtrLibraryCToCpp() {
 }
 
-template<> cef_translator_test_ref_ptr_library_t* CefCToCpp cef_translator_test_ref_ptr_library_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefTranslatorTestRefPtrLibrary* c) {
@@ -84,12 +84,12 @@ template<> cef_translator_test_ref_ptr_library_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_TRANSLATOR_TEST_REF_PTR_LIBRARY;
diff --git a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h
index fe11d6e3b..b14544194 100644
--- a/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h
+++ b/libcef_dll/ctocpp/test/translator_test_ref_ptr_library_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/test/cef_translator_test.h"
 #include "include/capi/test/cef_translator_test_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTranslatorTestRefPtrLibraryCToCpp
-    : public CefCToCpp {
  public:
diff --git a/libcef_dll/ctocpp/thread_ctocpp.cc b/libcef_dll/ctocpp/thread_ctocpp.cc
index 5f0cbbf4e..b657003bc 100644
--- a/libcef_dll/ctocpp/thread_ctocpp.cc
+++ b/libcef_dll/ctocpp/thread_ctocpp.cc
@@ -97,16 +97,16 @@ bool CefThreadCToCpp::IsRunning() {
 CefThreadCToCpp::CefThreadCToCpp() {
 }
 
-template<> cef_thread_t* CefCToCpp cef_thread_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefThread* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_THREAD;
diff --git a/libcef_dll/ctocpp/thread_ctocpp.h b/libcef_dll/ctocpp/thread_ctocpp.h
index 393c3c3fd..8bfbdb4ea 100644
--- a/libcef_dll/ctocpp/thread_ctocpp.h
+++ b/libcef_dll/ctocpp/thread_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_thread.h"
 #include "include/capi/cef_thread_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefThreadCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefThreadCToCpp();
 
diff --git a/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc b/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc
index a0b1c499d..29bf425b2 100644
--- a/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc
+++ b/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc
@@ -141,7 +141,7 @@ bool CefURLRequestClientCToCpp::GetAuthCredentials(bool isProxy,
 CefURLRequestClientCToCpp::CefURLRequestClientCToCpp() {
 }
 
-template<> cef_urlrequest_client_t* CefCToCpp cef_urlrequest_client_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefURLRequestClient* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -149,10 +149,10 @@ template<> cef_urlrequest_client_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_URLREQUEST_CLIENT;
diff --git a/libcef_dll/ctocpp/urlrequest_client_ctocpp.h b/libcef_dll/ctocpp/urlrequest_client_ctocpp.h
index 1017d02c2..c8f5452e7 100644
--- a/libcef_dll/ctocpp/urlrequest_client_ctocpp.h
+++ b/libcef_dll/ctocpp/urlrequest_client_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_urlrequest.h"
 #include "include/capi/cef_urlrequest_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefURLRequestClientCToCpp
-    : public CefCToCpp {
  public:
   CefURLRequestClientCToCpp();
diff --git a/libcef_dll/ctocpp/urlrequest_ctocpp.cc b/libcef_dll/ctocpp/urlrequest_ctocpp.cc
index 1902daad1..a32e56476 100644
--- a/libcef_dll/ctocpp/urlrequest_ctocpp.cc
+++ b/libcef_dll/ctocpp/urlrequest_ctocpp.cc
@@ -134,16 +134,17 @@ void CefURLRequestCToCpp::Cancel() {
 CefURLRequestCToCpp::CefURLRequestCToCpp() {
 }
 
-template<> cef_urlrequest_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefURLRequest* c) {
+template<> cef_urlrequest_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefURLRequest* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_URLREQUEST;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_URLREQUEST;
diff --git a/libcef_dll/ctocpp/urlrequest_ctocpp.h b/libcef_dll/ctocpp/urlrequest_ctocpp.h
index af6040011..88df2438a 100644
--- a/libcef_dll/ctocpp/urlrequest_ctocpp.h
+++ b/libcef_dll/ctocpp/urlrequest_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_urlrequest.h"
 #include "include/capi/cef_urlrequest_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefURLRequestCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefURLRequestCToCpp();
 
diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.cc b/libcef_dll/ctocpp/v8accessor_ctocpp.cc
index 5d777c777..d38867432 100644
--- a/libcef_dll/ctocpp/v8accessor_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8accessor_ctocpp.cc
@@ -99,16 +99,17 @@ bool CefV8AccessorCToCpp::Set(const CefString& name,
 CefV8AccessorCToCpp::CefV8AccessorCToCpp() {
 }
 
-template<> cef_v8accessor_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefV8Accessor* c) {
+template<> cef_v8accessor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefV8Accessor* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8ACCESSOR;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8ACCESSOR;
diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.h b/libcef_dll/ctocpp/v8accessor_ctocpp.h
index 665605b39..63e70ca5b 100644
--- a/libcef_dll/ctocpp/v8accessor_ctocpp.h
+++ b/libcef_dll/ctocpp/v8accessor_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8AccessorCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefV8AccessorCToCpp();
 
diff --git a/libcef_dll/ctocpp/v8context_ctocpp.cc b/libcef_dll/ctocpp/v8context_ctocpp.cc
index 225ba8e9e..fa2f463d6 100644
--- a/libcef_dll/ctocpp/v8context_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8context_ctocpp.cc
@@ -232,16 +232,17 @@ bool CefV8ContextCToCpp::Eval(const CefString& code,
 CefV8ContextCToCpp::CefV8ContextCToCpp() {
 }
 
-template<> cef_v8context_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefV8Context* c) {
+template<> cef_v8context_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefV8Context* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8CONTEXT;
diff --git a/libcef_dll/ctocpp/v8context_ctocpp.h b/libcef_dll/ctocpp/v8context_ctocpp.h
index fbf6479c3..9bd218f6a 100644
--- a/libcef_dll/ctocpp/v8context_ctocpp.h
+++ b/libcef_dll/ctocpp/v8context_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8ContextCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefV8ContextCToCpp();
 
diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.cc b/libcef_dll/ctocpp/v8exception_ctocpp.cc
index d77f0a436..3c4dee1ec 100644
--- a/libcef_dll/ctocpp/v8exception_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8exception_ctocpp.cc
@@ -139,17 +139,17 @@ int CefV8ExceptionCToCpp::GetEndColumn() {
 CefV8ExceptionCToCpp::CefV8ExceptionCToCpp() {
 }
 
-template<> cef_v8exception_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_v8exception_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefV8Exception* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8EXCEPTION;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8EXCEPTION;
diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.h b/libcef_dll/ctocpp/v8exception_ctocpp.h
index 31b3d9bf9..ed2cbec2f 100644
--- a/libcef_dll/ctocpp/v8exception_ctocpp.h
+++ b/libcef_dll/ctocpp/v8exception_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8ExceptionCToCpp
-    : public CefCToCpp {
  public:
   CefV8ExceptionCToCpp();
diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.cc b/libcef_dll/ctocpp/v8handler_ctocpp.cc
index 765d83844..1d14e730f 100644
--- a/libcef_dll/ctocpp/v8handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8handler_ctocpp.cc
@@ -83,16 +83,17 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name,
 CefV8HandlerCToCpp::CefV8HandlerCToCpp() {
 }
 
-template<> cef_v8handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefV8Handler* c) {
+template<> cef_v8handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefV8Handler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8HANDLER;
diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.h b/libcef_dll/ctocpp/v8handler_ctocpp.h
index 96463e3fa..2d320ef5b 100644
--- a/libcef_dll/ctocpp/v8handler_ctocpp.h
+++ b/libcef_dll/ctocpp/v8handler_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8HandlerCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefV8HandlerCToCpp();
 
diff --git a/libcef_dll/ctocpp/v8interceptor_ctocpp.cc b/libcef_dll/ctocpp/v8interceptor_ctocpp.cc
index c75292745..49216779a 100644
--- a/libcef_dll/ctocpp/v8interceptor_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8interceptor_ctocpp.cc
@@ -174,7 +174,7 @@ bool CefV8InterceptorCToCpp::Set(int index, const CefRefPtr object,
 CefV8InterceptorCToCpp::CefV8InterceptorCToCpp() {
 }
 
-template<> cef_v8interceptor_t* CefCToCpp cef_v8interceptor_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefV8Interceptor* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -182,9 +182,9 @@ template<> cef_v8interceptor_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8INTERCEPTOR;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8INTERCEPTOR;
diff --git a/libcef_dll/ctocpp/v8interceptor_ctocpp.h b/libcef_dll/ctocpp/v8interceptor_ctocpp.h
index 204076f53..7e5dbfc1f 100644
--- a/libcef_dll/ctocpp/v8interceptor_ctocpp.h
+++ b/libcef_dll/ctocpp/v8interceptor_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefV8InterceptorCToCpp
-    : public CefCToCpp {
  public:
   CefV8InterceptorCToCpp();
diff --git a/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc b/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc
index 560dea184..0ec6232e2 100644
--- a/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc
@@ -140,7 +140,7 @@ bool CefV8StackFrameCToCpp::IsConstructor() {
 CefV8StackFrameCToCpp::CefV8StackFrameCToCpp() {
 }
 
-template<> cef_v8stack_frame_t* CefCToCpp cef_v8stack_frame_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefV8StackFrame* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -148,9 +148,9 @@ template<> cef_v8stack_frame_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8STACK_FRAME;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8STACK_FRAME;
diff --git a/libcef_dll/ctocpp/v8stack_frame_ctocpp.h b/libcef_dll/ctocpp/v8stack_frame_ctocpp.h
index 90e647b1e..2cfad29e7 100644
--- a/libcef_dll/ctocpp/v8stack_frame_ctocpp.h
+++ b/libcef_dll/ctocpp/v8stack_frame_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8StackFrameCToCpp
-    : public CefCToCpp {
  public:
   CefV8StackFrameCToCpp();
diff --git a/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc b/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc
index e49278336..251cbdc82 100644
--- a/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc
@@ -79,7 +79,7 @@ CefRefPtr CefV8StackTraceCToCpp::GetFrame(int index) {
 CefV8StackTraceCToCpp::CefV8StackTraceCToCpp() {
 }
 
-template<> cef_v8stack_trace_t* CefCToCpp cef_v8stack_trace_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefV8StackTrace* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -87,9 +87,9 @@ template<> cef_v8stack_trace_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8STACK_TRACE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8STACK_TRACE;
diff --git a/libcef_dll/ctocpp/v8stack_trace_ctocpp.h b/libcef_dll/ctocpp/v8stack_trace_ctocpp.h
index 93ac0a694..ee1e5c326 100644
--- a/libcef_dll/ctocpp/v8stack_trace_ctocpp.h
+++ b/libcef_dll/ctocpp/v8stack_trace_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8StackTraceCToCpp
-    : public CefCToCpp {
  public:
   CefV8StackTraceCToCpp();
diff --git a/libcef_dll/ctocpp/v8value_ctocpp.cc b/libcef_dll/ctocpp/v8value_ctocpp.cc
index ee44c91e2..019bc151b 100644
--- a/libcef_dll/ctocpp/v8value_ctocpp.cc
+++ b/libcef_dll/ctocpp/v8value_ctocpp.cc
@@ -10,7 +10,7 @@
 // for more information.
 //
 
-#include "libcef_dll/cpptoc/base_cpptoc.h"
+#include "libcef_dll/cpptoc/base_ref_counted_cpptoc.h"
 #include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
 #include "libcef_dll/cpptoc/v8handler_cpptoc.h"
 #include "libcef_dll/cpptoc/v8interceptor_cpptoc.h"
@@ -729,7 +729,7 @@ bool CefV8ValueCToCpp::GetKeys(std::vector& keys) {
   return _retval?true:false;
 }
 
-bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) {
+bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) {
   cef_v8value_t* _struct = GetStruct();
   if (CEF_MEMBER_MISSING(_struct, set_user_data))
     return false;
@@ -740,13 +740,13 @@ bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) {
 
   // Execute
   int _retval = _struct->set_user_data(_struct,
-      CefBaseCppToC::Wrap(user_data));
+      CefBaseRefCountedCppToC::Wrap(user_data));
 
   // Return type: bool
   return _retval?true:false;
 }
 
-CefRefPtr CefV8ValueCToCpp::GetUserData() {
+CefRefPtr CefV8ValueCToCpp::GetUserData() {
   cef_v8value_t* _struct = GetStruct();
   if (CEF_MEMBER_MISSING(_struct, get_user_data))
     return NULL;
@@ -754,10 +754,10 @@ CefRefPtr CefV8ValueCToCpp::GetUserData() {
   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
 
   // Execute
-  cef_base_t* _retval = _struct->get_user_data(_struct);
+  cef_base_ref_counted_t* _retval = _struct->get_user_data(_struct);
 
   // Return type: refptr_diff
-  return CefBaseCppToC::Unwrap(_retval);
+  return CefBaseRefCountedCppToC::Unwrap(_retval);
 }
 
 int CefV8ValueCToCpp::GetExternallyAllocatedMemory() {
@@ -919,16 +919,16 @@ CefRefPtr CefV8ValueCToCpp::ExecuteFunctionWithContext(
 CefV8ValueCToCpp::CefV8ValueCToCpp() {
 }
 
-template<> cef_v8value_t* CefCToCpp cef_v8value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefV8Value* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_V8VALUE;
diff --git a/libcef_dll/ctocpp/v8value_ctocpp.h b/libcef_dll/ctocpp/v8value_ctocpp.h
index 26c18fafd..7518e6619 100644
--- a/libcef_dll/ctocpp/v8value_ctocpp.h
+++ b/libcef_dll/ctocpp/v8value_ctocpp.h
@@ -21,12 +21,12 @@
 #include 
 #include "include/cef_v8.h"
 #include "include/capi/cef_v8_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefV8ValueCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefV8ValueCToCpp();
 
@@ -68,8 +68,8 @@ class CefV8ValueCToCpp
   bool SetValue(const CefString& key, AccessControl settings,
       PropertyAttribute attribute) OVERRIDE;
   bool GetKeys(std::vector& keys) OVERRIDE;
-  bool SetUserData(CefRefPtr user_data) OVERRIDE;
-  CefRefPtr GetUserData() OVERRIDE;
+  bool SetUserData(CefRefPtr user_data) OVERRIDE;
+  CefRefPtr GetUserData() OVERRIDE;
   int GetExternallyAllocatedMemory() OVERRIDE;
   int AdjustExternallyAllocatedMemory(int change_in_bytes) OVERRIDE;
   int GetArrayLength() OVERRIDE;
diff --git a/libcef_dll/ctocpp/value_ctocpp.cc b/libcef_dll/ctocpp/value_ctocpp.cc
index fd5de9bd2..fcc56ee38 100644
--- a/libcef_dll/ctocpp/value_ctocpp.cc
+++ b/libcef_dll/ctocpp/value_ctocpp.cc
@@ -383,16 +383,16 @@ bool CefValueCToCpp::SetList(CefRefPtr value) {
 CefValueCToCpp::CefValueCToCpp() {
 }
 
-template<> cef_value_t* CefCToCpp cef_value_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefValue* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_VALUE;
diff --git a/libcef_dll/ctocpp/value_ctocpp.h b/libcef_dll/ctocpp/value_ctocpp.h
index dc9c4e8d4..24b6e3a3e 100644
--- a/libcef_dll/ctocpp/value_ctocpp.h
+++ b/libcef_dll/ctocpp/value_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_values.h"
 #include "include/capi/cef_values_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefValueCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefValueCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/box_layout_ctocpp.cc b/libcef_dll/ctocpp/views/box_layout_ctocpp.cc
index 1d4d83e47..152dee2c8 100644
--- a/libcef_dll/ctocpp/views/box_layout_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/box_layout_ctocpp.cc
@@ -100,16 +100,17 @@ bool CefBoxLayoutCToCpp::IsValid() {
 CefBoxLayoutCToCpp::CefBoxLayoutCToCpp() {
 }
 
-template<> cef_box_layout_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefBoxLayout* c) {
+template<> cef_box_layout_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefBoxLayout* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BOX_LAYOUT;
diff --git a/libcef_dll/ctocpp/views/box_layout_ctocpp.h b/libcef_dll/ctocpp/views/box_layout_ctocpp.h
index 9fd417360..4db8bce5e 100644
--- a/libcef_dll/ctocpp/views/box_layout_ctocpp.h
+++ b/libcef_dll/ctocpp/views/box_layout_ctocpp.h
@@ -22,12 +22,13 @@
 #include "include/capi/views/cef_box_layout_capi.h"
 #include "include/views/cef_view.h"
 #include "include/capi/views/cef_view_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBoxLayoutCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefBoxLayoutCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/browser_view_ctocpp.cc b/libcef_dll/ctocpp/views/browser_view_ctocpp.cc
index 58f67c18c..5ec9d047f 100644
--- a/libcef_dll/ctocpp/views/browser_view_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/browser_view_ctocpp.cc
@@ -739,17 +739,17 @@ bool CefBrowserViewCToCpp::ConvertPointFromView(CefRefPtr view,
 CefBrowserViewCToCpp::CefBrowserViewCToCpp() {
 }
 
-template<> cef_browser_view_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_browser_view_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefBrowserView* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_BROWSER_VIEW;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BROWSER_VIEW;
diff --git a/libcef_dll/ctocpp/views/browser_view_ctocpp.h b/libcef_dll/ctocpp/views/browser_view_ctocpp.h
index a9a8090c3..e72f54ce6 100644
--- a/libcef_dll/ctocpp/views/browser_view_ctocpp.h
+++ b/libcef_dll/ctocpp/views/browser_view_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/views/cef_browser_view.h"
 #include "include/capi/views/cef_browser_view_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefBrowserViewCToCpp
-    : public CefCToCpp {
  public:
   CefBrowserViewCToCpp();
diff --git a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc
index 7fa17fe8e..61ba96c64 100644
--- a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.cc
@@ -266,7 +266,7 @@ void CefBrowserViewDelegateCToCpp::OnChildViewChanged(CefRefPtr view,
 CefBrowserViewDelegateCToCpp::CefBrowserViewDelegateCToCpp() {
 }
 
-template<> cef_browser_view_delegate_t* CefCToCpp cef_browser_view_delegate_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefBrowserViewDelegate* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -274,10 +274,10 @@ template<> cef_browser_view_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_BROWSER_VIEW_DELEGATE;
diff --git a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h
index e50208fe3..267a940ab 100644
--- a/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/views/browser_view_delegate_ctocpp.h
@@ -24,13 +24,13 @@
 #include "include/capi/cef_browser_capi.h"
 #include "include/views/cef_browser_view.h"
 #include "include/capi/views/cef_browser_view_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefBrowserViewDelegateCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefBrowserViewDelegateCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/button_ctocpp.cc b/libcef_dll/ctocpp/views/button_ctocpp.cc
index 83f7e3928..e87e80631 100644
--- a/libcef_dll/ctocpp/views/button_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/button_ctocpp.cc
@@ -756,7 +756,7 @@ bool CefButtonCToCpp::ConvertPointFromView(CefRefPtr view,
 CefButtonCToCpp::CefButtonCToCpp() {
 }
 
-template<> cef_button_t* CefCToCpp cef_button_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefButton* c) {
   if (type == WT_LABEL_BUTTON) {
     return reinterpret_cast(CefLabelButtonCToCpp::Unwrap(
@@ -771,9 +771,9 @@ template<> cef_button_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_BUTTON;
diff --git a/libcef_dll/ctocpp/views/button_ctocpp.h b/libcef_dll/ctocpp/views/button_ctocpp.h
index 8dda3f5dd..5f76b62b1 100644
--- a/libcef_dll/ctocpp/views/button_ctocpp.h
+++ b/libcef_dll/ctocpp/views/button_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_button_capi.h"
 #include "include/views/cef_label_button.h"
 #include "include/capi/views/cef_label_button_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefButtonCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefButtonCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc
index 2018d1307..3c2da5179 100644
--- a/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/button_delegate_ctocpp.cc
@@ -177,7 +177,7 @@ void CefButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr view,
 CefButtonDelegateCToCpp::CefButtonDelegateCToCpp() {
 }
 
-template<> cef_button_delegate_t* CefCToCpp cef_button_delegate_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefButtonDelegate* c) {
   if (type == WT_MENU_BUTTON_DELEGATE) {
@@ -190,9 +190,10 @@ template<> cef_button_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_BUTTON_DELEGATE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_BUTTON_DELEGATE;
diff --git a/libcef_dll/ctocpp/views/button_delegate_ctocpp.h b/libcef_dll/ctocpp/views/button_delegate_ctocpp.h
index 9e26e00a9..cc1d22f18 100644
--- a/libcef_dll/ctocpp/views/button_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/views/button_delegate_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_button_delegate_capi.h"
 #include "include/views/cef_button.h"
 #include "include/capi/views/cef_button_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefButtonDelegateCToCpp
-    : public CefCToCpp {
  public:
   CefButtonDelegateCToCpp();
diff --git a/libcef_dll/ctocpp/views/display_ctocpp.cc b/libcef_dll/ctocpp/views/display_ctocpp.cc
index f71cc29b8..30aaf90d8 100644
--- a/libcef_dll/ctocpp/views/display_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/display_ctocpp.cc
@@ -200,16 +200,16 @@ int CefDisplayCToCpp::GetRotation() {
 CefDisplayCToCpp::CefDisplayCToCpp() {
 }
 
-template<> cef_display_t* CefCToCpp cef_display_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefDisplay* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_DISPLAY;
diff --git a/libcef_dll/ctocpp/views/display_ctocpp.h b/libcef_dll/ctocpp/views/display_ctocpp.h
index aa6ff471d..693875308 100644
--- a/libcef_dll/ctocpp/views/display_ctocpp.h
+++ b/libcef_dll/ctocpp/views/display_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/views/cef_display.h"
 #include "include/capi/views/cef_display_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefDisplayCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefDisplayCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc b/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc
index c333a11b5..29ae9c46f 100644
--- a/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/fill_layout_ctocpp.cc
@@ -64,16 +64,17 @@ bool CefFillLayoutCToCpp::IsValid() {
 CefFillLayoutCToCpp::CefFillLayoutCToCpp() {
 }
 
-template<> cef_fill_layout_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefFillLayout* c) {
+template<> cef_fill_layout_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefFillLayout* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_FILL_LAYOUT;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_FILL_LAYOUT;
diff --git a/libcef_dll/ctocpp/views/fill_layout_ctocpp.h b/libcef_dll/ctocpp/views/fill_layout_ctocpp.h
index b4afa7b13..a4dc1d979 100644
--- a/libcef_dll/ctocpp/views/fill_layout_ctocpp.h
+++ b/libcef_dll/ctocpp/views/fill_layout_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_fill_layout.h"
 #include "include/capi/views/cef_fill_layout_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefFillLayoutCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefFillLayoutCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/label_button_ctocpp.cc b/libcef_dll/ctocpp/views/label_button_ctocpp.cc
index e059618a3..9545b4791 100644
--- a/libcef_dll/ctocpp/views/label_button_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/label_button_ctocpp.cc
@@ -941,8 +941,8 @@ bool CefLabelButtonCToCpp::ConvertPointFromView(CefRefPtr view,
 CefLabelButtonCToCpp::CefLabelButtonCToCpp() {
 }
 
-template<> cef_label_button_t* CefCToCpp::UnwrapDerived(CefWrapperType type,
+template<> cef_label_button_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefLabelButton* c) {
   if (type == WT_MENU_BUTTON) {
     return reinterpret_cast(CefMenuButtonCToCpp::Unwrap(
@@ -953,9 +953,9 @@ template<> cef_label_button_t* CefCToCpp base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_LABEL_BUTTON;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LABEL_BUTTON;
diff --git a/libcef_dll/ctocpp/views/label_button_ctocpp.h b/libcef_dll/ctocpp/views/label_button_ctocpp.h
index 5f248ec38..ea87cad18 100644
--- a/libcef_dll/ctocpp/views/label_button_ctocpp.h
+++ b/libcef_dll/ctocpp/views/label_button_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_label_button_capi.h"
 #include "include/views/cef_menu_button.h"
 #include "include/capi/views/cef_menu_button_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefLabelButtonCToCpp
-    : public CefCToCpp {
  public:
   CefLabelButtonCToCpp();
diff --git a/libcef_dll/ctocpp/views/layout_ctocpp.cc b/libcef_dll/ctocpp/views/layout_ctocpp.cc
index cd88f9c6b..0cba620d6 100644
--- a/libcef_dll/ctocpp/views/layout_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/layout_ctocpp.cc
@@ -65,7 +65,7 @@ bool CefLayoutCToCpp::IsValid() {
 CefLayoutCToCpp::CefLayoutCToCpp() {
 }
 
-template<> cef_layout_t* CefCToCpp cef_layout_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefLayout* c) {
   if (type == WT_BOX_LAYOUT) {
     return reinterpret_cast(CefBoxLayoutCToCpp::Unwrap(
@@ -80,9 +80,9 @@ template<> cef_layout_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_LAYOUT;
diff --git a/libcef_dll/ctocpp/views/layout_ctocpp.h b/libcef_dll/ctocpp/views/layout_ctocpp.h
index 41bdc6af7..ed873d595 100644
--- a/libcef_dll/ctocpp/views/layout_ctocpp.h
+++ b/libcef_dll/ctocpp/views/layout_ctocpp.h
@@ -24,12 +24,12 @@
 #include "include/capi/views/cef_box_layout_capi.h"
 #include "include/views/cef_fill_layout.h"
 #include "include/capi/views/cef_fill_layout_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefLayoutCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefLayoutCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/menu_button_ctocpp.cc b/libcef_dll/ctocpp/views/menu_button_ctocpp.cc
index ed4e90a44..cb38cc88a 100644
--- a/libcef_dll/ctocpp/views/menu_button_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/menu_button_ctocpp.cc
@@ -975,16 +975,17 @@ bool CefMenuButtonCToCpp::ConvertPointFromView(CefRefPtr view,
 CefMenuButtonCToCpp::CefMenuButtonCToCpp() {
 }
 
-template<> cef_menu_button_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefMenuButton* c) {
+template<> cef_menu_button_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefMenuButton* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_MENU_BUTTON;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_MENU_BUTTON;
diff --git a/libcef_dll/ctocpp/views/menu_button_ctocpp.h b/libcef_dll/ctocpp/views/menu_button_ctocpp.h
index 56a928232..9da96f426 100644
--- a/libcef_dll/ctocpp/views/menu_button_ctocpp.h
+++ b/libcef_dll/ctocpp/views/menu_button_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_menu_button.h"
 #include "include/capi/views/cef_menu_button_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefMenuButtonCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefMenuButtonCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc
index 69cdeb69a..fe8abbf6f 100644
--- a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.cc
@@ -197,7 +197,7 @@ void CefMenuButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr view,
 CefMenuButtonDelegateCToCpp::CefMenuButtonDelegateCToCpp() {
 }
 
-template<> cef_menu_button_delegate_t* CefCToCpp cef_menu_button_delegate_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefMenuButtonDelegate* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -205,10 +205,10 @@ template<> cef_menu_button_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_MENU_BUTTON_DELEGATE;
diff --git a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h
index e44b12ffd..d79daf155 100644
--- a/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h
@@ -22,13 +22,13 @@
 #include "include/capi/views/cef_menu_button_delegate_capi.h"
 #include "include/views/cef_menu_button.h"
 #include "include/capi/views/cef_menu_button_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefMenuButtonDelegateCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefMenuButtonDelegateCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/panel_ctocpp.cc b/libcef_dll/ctocpp/views/panel_ctocpp.cc
index 184db9084..1e1385715 100644
--- a/libcef_dll/ctocpp/views/panel_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/panel_ctocpp.cc
@@ -889,7 +889,7 @@ bool CefPanelCToCpp::ConvertPointFromView(CefRefPtr view,
 CefPanelCToCpp::CefPanelCToCpp() {
 }
 
-template<> cef_panel_t* CefCToCpp cef_panel_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefPanel* c) {
   if (type == WT_WINDOW) {
     return reinterpret_cast(CefWindowCToCpp::Unwrap(
@@ -900,9 +900,9 @@ template<> cef_panel_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PANEL;
diff --git a/libcef_dll/ctocpp/views/panel_ctocpp.h b/libcef_dll/ctocpp/views/panel_ctocpp.h
index cd963a9fd..25c7b44ee 100644
--- a/libcef_dll/ctocpp/views/panel_ctocpp.h
+++ b/libcef_dll/ctocpp/views/panel_ctocpp.h
@@ -28,12 +28,12 @@
 #include "include/capi/views/cef_layout_capi.h"
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefPanelCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefPanelCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc
index e0d0b34a9..f4f0c7a8a 100644
--- a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.cc
@@ -159,7 +159,7 @@ void CefPanelDelegateCToCpp::OnChildViewChanged(CefRefPtr view,
 CefPanelDelegateCToCpp::CefPanelDelegateCToCpp() {
 }
 
-template<> cef_panel_delegate_t* CefCToCpp cef_panel_delegate_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefPanelDelegate* c) {
   if (type == WT_WINDOW_DELEGATE) {
@@ -172,9 +172,9 @@ template<> cef_panel_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_PANEL_DELEGATE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_PANEL_DELEGATE;
diff --git a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h
index 2f9140cd3..d6916cdba 100644
--- a/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/views/panel_delegate_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/views/cef_panel_delegate.h"
 #include "include/capi/views/cef_panel_delegate_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefPanelDelegateCToCpp
-    : public CefCToCpp {
  public:
   CefPanelDelegateCToCpp();
diff --git a/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc b/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc
index 47971205c..18a7484c0 100644
--- a/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/scroll_view_ctocpp.cc
@@ -798,16 +798,17 @@ bool CefScrollViewCToCpp::ConvertPointFromView(CefRefPtr view,
 CefScrollViewCToCpp::CefScrollViewCToCpp() {
 }
 
-template<> cef_scroll_view_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefScrollView* c) {
+template<> cef_scroll_view_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefScrollView* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_SCROLL_VIEW;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_SCROLL_VIEW;
diff --git a/libcef_dll/ctocpp/views/scroll_view_ctocpp.h b/libcef_dll/ctocpp/views/scroll_view_ctocpp.h
index 6e02c465a..48080c41d 100644
--- a/libcef_dll/ctocpp/views/scroll_view_ctocpp.h
+++ b/libcef_dll/ctocpp/views/scroll_view_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_scroll_view.h"
 #include "include/capi/views/cef_scroll_view_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefScrollViewCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefScrollViewCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/textfield_ctocpp.cc b/libcef_dll/ctocpp/views/textfield_ctocpp.cc
index 72e289690..b88b8445b 100644
--- a/libcef_dll/ctocpp/views/textfield_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/textfield_ctocpp.cc
@@ -1134,16 +1134,17 @@ bool CefTextfieldCToCpp::ConvertPointFromView(CefRefPtr view,
 CefTextfieldCToCpp::CefTextfieldCToCpp() {
 }
 
-template<> cef_textfield_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefTextfield* c) {
+template<> cef_textfield_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefTextfield* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_TEXTFIELD;
diff --git a/libcef_dll/ctocpp/views/textfield_ctocpp.h b/libcef_dll/ctocpp/views/textfield_ctocpp.h
index 112fbf528..4fb95b65d 100644
--- a/libcef_dll/ctocpp/views/textfield_ctocpp.h
+++ b/libcef_dll/ctocpp/views/textfield_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/views/cef_textfield.h"
 #include "include/capi/views/cef_textfield_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefTextfieldCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefTextfieldCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc
index a87a84771..1836c7879 100644
--- a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.cc
@@ -199,7 +199,7 @@ void CefTextfieldDelegateCToCpp::OnChildViewChanged(CefRefPtr view,
 CefTextfieldDelegateCToCpp::CefTextfieldDelegateCToCpp() {
 }
 
-template<> cef_textfield_delegate_t* CefCToCpp cef_textfield_delegate_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefTextfieldDelegate* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -207,10 +207,10 @@ template<> cef_textfield_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_TEXTFIELD_DELEGATE;
diff --git a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h
index 957ab226d..83da8fdb5 100644
--- a/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/views/textfield_delegate_ctocpp.h
@@ -22,13 +22,13 @@
 #include "include/capi/views/cef_textfield_delegate_capi.h"
 #include "include/views/cef_textfield.h"
 #include "include/capi/views/cef_textfield_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefTextfieldDelegateCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefTextfieldDelegateCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/view_ctocpp.cc b/libcef_dll/ctocpp/views/view_ctocpp.cc
index 96e858c37..ca2c72c66 100644
--- a/libcef_dll/ctocpp/views/view_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/view_ctocpp.cc
@@ -682,7 +682,7 @@ bool CefViewCToCpp::ConvertPointFromView(CefRefPtr view,
 CefViewCToCpp::CefViewCToCpp() {
 }
 
-template<> cef_view_t* CefCToCpp cef_view_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefView* c) {
   if (type == WT_BROWSER_VIEW) {
     return reinterpret_cast(CefBrowserViewCToCpp::Unwrap(
@@ -721,9 +721,9 @@ template<> cef_view_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_VIEW;
diff --git a/libcef_dll/ctocpp/views/view_ctocpp.h b/libcef_dll/ctocpp/views/view_ctocpp.h
index 702fb0a24..8dc568629 100644
--- a/libcef_dll/ctocpp/views/view_ctocpp.h
+++ b/libcef_dll/ctocpp/views/view_ctocpp.h
@@ -32,12 +32,12 @@
 #include "include/capi/views/cef_textfield_capi.h"
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefViewCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefViewCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc
index 925ebdbae..6cfde7b4b 100644
--- a/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/view_delegate_ctocpp.cc
@@ -158,7 +158,7 @@ void CefViewDelegateCToCpp::OnChildViewChanged(CefRefPtr view,
 CefViewDelegateCToCpp::CefViewDelegateCToCpp() {
 }
 
-template<> cef_view_delegate_t* CefCToCpp cef_view_delegate_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefViewDelegate* c) {
   if (type == WT_BROWSER_VIEW_DELEGATE) {
@@ -196,9 +196,9 @@ template<> cef_view_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_VIEW_DELEGATE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_VIEW_DELEGATE;
diff --git a/libcef_dll/ctocpp/views/view_delegate_ctocpp.h b/libcef_dll/ctocpp/views/view_delegate_ctocpp.h
index 77ca28afe..27840d96d 100644
--- a/libcef_dll/ctocpp/views/view_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/views/view_delegate_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_view_delegate_capi.h"
 #include "include/views/cef_view.h"
 #include "include/capi/views/cef_view_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefViewDelegateCToCpp
-    : public CefCToCpp {
  public:
   CefViewDelegateCToCpp();
diff --git a/libcef_dll/ctocpp/views/window_ctocpp.cc b/libcef_dll/ctocpp/views/window_ctocpp.cc
index d303dfa85..40505fcb0 100644
--- a/libcef_dll/ctocpp/views/window_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/window_ctocpp.cc
@@ -1351,16 +1351,16 @@ bool CefWindowCToCpp::ConvertPointFromView(CefRefPtr view,
 CefWindowCToCpp::CefWindowCToCpp() {
 }
 
-template<> cef_window_t* CefCToCpp cef_window_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type, CefWindow* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WINDOW;
diff --git a/libcef_dll/ctocpp/views/window_ctocpp.h b/libcef_dll/ctocpp/views/window_ctocpp.h
index 2cc4e22c8..6e7593cd5 100644
--- a/libcef_dll/ctocpp/views/window_ctocpp.h
+++ b/libcef_dll/ctocpp/views/window_ctocpp.h
@@ -21,12 +21,12 @@
 #include 
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefWindowCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefWindowCToCpp();
 
diff --git a/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc b/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc
index 3642c96a3..93da33c62 100644
--- a/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc
+++ b/libcef_dll/ctocpp/views/window_delegate_ctocpp.cc
@@ -293,7 +293,7 @@ void CefWindowDelegateCToCpp::OnChildViewChanged(CefRefPtr view,
 CefWindowDelegateCToCpp::CefWindowDelegateCToCpp() {
 }
 
-template<> cef_window_delegate_t* CefCToCpp cef_window_delegate_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefWindowDelegate* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -301,9 +301,10 @@ template<> cef_window_delegate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_WINDOW_DELEGATE;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_WINDOW_DELEGATE;
diff --git a/libcef_dll/ctocpp/views/window_delegate_ctocpp.h b/libcef_dll/ctocpp/views/window_delegate_ctocpp.h
index 35e73bcd1..81a3be8df 100644
--- a/libcef_dll/ctocpp/views/window_delegate_ctocpp.h
+++ b/libcef_dll/ctocpp/views/window_delegate_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/views/cef_window_delegate_capi.h"
 #include "include/views/cef_window.h"
 #include "include/capi/views/cef_window_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefWindowDelegateCToCpp
-    : public CefCToCpp {
  public:
   CefWindowDelegateCToCpp();
diff --git a/libcef_dll/ctocpp/waitable_event_ctocpp.cc b/libcef_dll/ctocpp/waitable_event_ctocpp.cc
index 9e8bf9b5d..5677e99e2 100644
--- a/libcef_dll/ctocpp/waitable_event_ctocpp.cc
+++ b/libcef_dll/ctocpp/waitable_event_ctocpp.cc
@@ -99,7 +99,7 @@ bool CefWaitableEventCToCpp::TimedWait(int64 max_ms) {
 CefWaitableEventCToCpp::CefWaitableEventCToCpp() {
 }
 
-template<> cef_waitable_event_t* CefCToCpp cef_waitable_event_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefWaitableEvent* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -107,9 +107,9 @@ template<> cef_waitable_event_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_WAITABLE_EVENT;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WAITABLE_EVENT;
diff --git a/libcef_dll/ctocpp/waitable_event_ctocpp.h b/libcef_dll/ctocpp/waitable_event_ctocpp.h
index c515e0e99..72c6d72db 100644
--- a/libcef_dll/ctocpp/waitable_event_ctocpp.h
+++ b/libcef_dll/ctocpp/waitable_event_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_waitable_event.h"
 #include "include/capi/cef_waitable_event_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefWaitableEventCToCpp
-    : public CefCToCpp {
  public:
   CefWaitableEventCToCpp();
diff --git a/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc
index db9776829..4b63637c9 100644
--- a/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc
+++ b/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc
@@ -85,7 +85,7 @@ CefString CefWebPluginInfoCToCpp::GetDescription() {
 CefWebPluginInfoCToCpp::CefWebPluginInfoCToCpp() {
 }
 
-template<> cef_web_plugin_info_t* CefCToCpp cef_web_plugin_info_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefWebPluginInfo* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -93,9 +93,10 @@ template<> cef_web_plugin_info_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_WEB_PLUGIN_INFO;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType =
+    WT_WEB_PLUGIN_INFO;
diff --git a/libcef_dll/ctocpp/web_plugin_info_ctocpp.h b/libcef_dll/ctocpp/web_plugin_info_ctocpp.h
index 8fc914757..d971085bb 100644
--- a/libcef_dll/ctocpp/web_plugin_info_ctocpp.h
+++ b/libcef_dll/ctocpp/web_plugin_info_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefWebPluginInfoCToCpp
-    : public CefCToCpp {
  public:
   CefWebPluginInfoCToCpp();
diff --git a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc
index dcda4d0cb..ee10be2ec 100644
--- a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc
+++ b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc
@@ -45,7 +45,7 @@ bool CefWebPluginInfoVisitorCToCpp::Visit(CefRefPtr info,
 CefWebPluginInfoVisitorCToCpp::CefWebPluginInfoVisitorCToCpp() {
 }
 
-template<> cef_web_plugin_info_visitor_t* CefCToCpp cef_web_plugin_info_visitor_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefWebPluginInfoVisitor* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -53,10 +53,10 @@ template<> cef_web_plugin_info_visitor_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_WEB_PLUGIN_INFO_VISITOR;
diff --git a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h
index 54cdc69da..83155447f 100644
--- a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h
+++ b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h
@@ -22,13 +22,13 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefWebPluginInfoVisitorCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefWebPluginInfoVisitorCToCpp();
 
diff --git a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc
index abe97a742..72f285b2b 100644
--- a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc
+++ b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc
@@ -40,7 +40,7 @@ void CefWebPluginUnstableCallbackCToCpp::IsUnstable(const CefString& path,
 CefWebPluginUnstableCallbackCToCpp::CefWebPluginUnstableCallbackCToCpp() {
 }
 
-template<> cef_web_plugin_unstable_callback_t* CefCToCpp cef_web_plugin_unstable_callback_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefWebPluginUnstableCallback* c) {
@@ -49,12 +49,12 @@ template<> cef_web_plugin_unstable_callback_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_WEB_PLUGIN_UNSTABLE_CALLBACK;
diff --git a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h
index 0bb3c540d..9addbcd30 100644
--- a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h
+++ b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h
@@ -22,12 +22,12 @@
 #include "include/capi/cef_web_plugin_capi.h"
 #include "include/cef_browser.h"
 #include "include/capi/cef_browser_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefWebPluginUnstableCallbackCToCpp
-    : public CefCToCpp {
  public:
   CefWebPluginUnstableCallbackCToCpp();
diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.cc b/libcef_dll/ctocpp/write_handler_ctocpp.cc
index da70ee1b3..3669acfc8 100644
--- a/libcef_dll/ctocpp/write_handler_ctocpp.cc
+++ b/libcef_dll/ctocpp/write_handler_ctocpp.cc
@@ -101,7 +101,7 @@ bool CefWriteHandlerCToCpp::MayBlock() {
 CefWriteHandlerCToCpp::CefWriteHandlerCToCpp() {
 }
 
-template<> cef_write_handler_t* CefCToCpp cef_write_handler_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
     CefWriteHandler* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -109,9 +109,9 @@ template<> cef_write_handler_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp::kWrapperType = WT_WRITE_HANDLER;
+template<> CefWrapperType CefCToCppRefCounted::kWrapperType = WT_WRITE_HANDLER;
diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.h b/libcef_dll/ctocpp/write_handler_ctocpp.h
index 6be135498..8b2db0653 100644
--- a/libcef_dll/ctocpp/write_handler_ctocpp.h
+++ b/libcef_dll/ctocpp/write_handler_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_stream.h"
 #include "include/capi/cef_stream_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed DLL-side only.
 class CefWriteHandlerCToCpp
-    : public CefCToCpp {
  public:
   CefWriteHandlerCToCpp();
diff --git a/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc b/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc
index 344279e60..0aab09547 100644
--- a/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc
+++ b/libcef_dll/ctocpp/x509cert_principal_ctocpp.cc
@@ -206,7 +206,7 @@ void CefX509CertPrincipalCToCpp::GetDomainComponents(
 CefX509CertPrincipalCToCpp::CefX509CertPrincipalCToCpp() {
 }
 
-template<> cef_x509cert_principal_t* CefCToCpp cef_x509cert_principal_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefX509CertPrincipal* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -214,10 +214,10 @@ template<> cef_x509cert_principal_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_X509CERT_PRINCIPAL;
diff --git a/libcef_dll/ctocpp/x509cert_principal_ctocpp.h b/libcef_dll/ctocpp/x509cert_principal_ctocpp.h
index d7369cf58..4fd5c72e7 100644
--- a/libcef_dll/ctocpp/x509cert_principal_ctocpp.h
+++ b/libcef_dll/ctocpp/x509cert_principal_ctocpp.h
@@ -21,13 +21,13 @@
 #include 
 #include "include/cef_x509_certificate.h"
 #include "include/capi/cef_x509_certificate_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefX509CertPrincipalCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefX509CertPrincipalCToCpp();
 
diff --git a/libcef_dll/ctocpp/x509certificate_ctocpp.cc b/libcef_dll/ctocpp/x509certificate_ctocpp.cc
index 010c2b22e..950007041 100644
--- a/libcef_dll/ctocpp/x509certificate_ctocpp.cc
+++ b/libcef_dll/ctocpp/x509certificate_ctocpp.cc
@@ -216,7 +216,7 @@ void CefX509CertificateCToCpp::GetPEMEncodedIssuerChain(
 CefX509CertificateCToCpp::CefX509CertificateCToCpp() {
 }
 
-template<> cef_x509certificate_t* CefCToCpp cef_x509certificate_t* CefCToCppRefCounted::UnwrapDerived(
     CefWrapperType type, CefX509Certificate* c) {
   NOTREACHED() << "Unexpected class type: " << type;
@@ -224,10 +224,10 @@ template<> cef_x509certificate_t* CefCToCpp base::AtomicRefCount CefCToCpp base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType =
     WT_X509CERTIFICATE;
diff --git a/libcef_dll/ctocpp/x509certificate_ctocpp.h b/libcef_dll/ctocpp/x509certificate_ctocpp.h
index e2756825c..8a7925a47 100644
--- a/libcef_dll/ctocpp/x509certificate_ctocpp.h
+++ b/libcef_dll/ctocpp/x509certificate_ctocpp.h
@@ -20,12 +20,12 @@
 
 #include "include/cef_x509_certificate.h"
 #include "include/capi/cef_x509_certificate_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefX509CertificateCToCpp
-    : public CefCToCpp {
  public:
   CefX509CertificateCToCpp();
diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/libcef_dll/ctocpp/xml_reader_ctocpp.cc
index 705bd4451..b38bbc368 100644
--- a/libcef_dll/ctocpp/xml_reader_ctocpp.cc
+++ b/libcef_dll/ctocpp/xml_reader_ctocpp.cc
@@ -528,16 +528,17 @@ bool CefXmlReaderCToCpp::MoveToCarryingElement() {
 CefXmlReaderCToCpp::CefXmlReaderCToCpp() {
 }
 
-template<> cef_xml_reader_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefXmlReader* c) {
+template<> cef_xml_reader_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefXmlReader* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_XML_READER;
diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.h b/libcef_dll/ctocpp/xml_reader_ctocpp.h
index 900033202..54fa11904 100644
--- a/libcef_dll/ctocpp/xml_reader_ctocpp.h
+++ b/libcef_dll/ctocpp/xml_reader_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_xml_reader.h"
 #include "include/capi/cef_xml_reader_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefXmlReaderCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefXmlReaderCToCpp();
 
diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/libcef_dll/ctocpp/zip_reader_ctocpp.cc
index 708db7ac3..efc3cf3a1 100644
--- a/libcef_dll/ctocpp/zip_reader_ctocpp.cc
+++ b/libcef_dll/ctocpp/zip_reader_ctocpp.cc
@@ -230,16 +230,17 @@ bool CefZipReaderCToCpp::Eof() {
 CefZipReaderCToCpp::CefZipReaderCToCpp() {
 }
 
-template<> cef_zip_reader_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefZipReader* c) {
+template<> cef_zip_reader_t* CefCToCppRefCounted::UnwrapDerived(CefWrapperType type,
+    CefZipReader* c) {
   NOTREACHED() << "Unexpected class type: " << type;
   return NULL;
 }
 
 #if DCHECK_IS_ON()
-template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0;
+template<> base::AtomicRefCount CefCToCppRefCounted::DebugObjCt = 0;
 #endif
 
-template<> CefWrapperType CefCToCpp CefWrapperType CefCToCppRefCounted::kWrapperType = WT_ZIP_READER;
diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.h b/libcef_dll/ctocpp/zip_reader_ctocpp.h
index 2d6c67335..42ddcd8e0 100644
--- a/libcef_dll/ctocpp/zip_reader_ctocpp.h
+++ b/libcef_dll/ctocpp/zip_reader_ctocpp.h
@@ -20,12 +20,13 @@
 
 #include "include/cef_zip_reader.h"
 #include "include/capi/cef_zip_reader_capi.h"
-#include "libcef_dll/ctocpp/ctocpp.h"
+#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
 
 // Wrap a C structure with a C++ class.
 // This class may be instantiated and accessed wrapper-side only.
 class CefZipReaderCToCpp
-    : public CefCToCpp {
+    : public CefCToCppRefCounted {
  public:
   CefZipReaderCToCpp();
 
diff --git a/libcef_dll/wrapper/cef_byte_read_handler.cc b/libcef_dll/wrapper/cef_byte_read_handler.cc
index 3d29feebf..f8878a145 100644
--- a/libcef_dll/wrapper/cef_byte_read_handler.cc
+++ b/libcef_dll/wrapper/cef_byte_read_handler.cc
@@ -9,7 +9,7 @@
 #include 
 
 CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, size_t size,
-                                       CefRefPtr source)
+                                       CefRefPtr source)
   : bytes_(bytes), size_(size), offset_(0), source_(source) {
 }
 
diff --git a/libcef_dll/wrapper_types.h b/libcef_dll/wrapper_types.h
index 7c0273932..c9a464f15 100644
--- a/libcef_dll/wrapper_types.h
+++ b/libcef_dll/wrapper_types.h
@@ -15,7 +15,8 @@
 #pragma once
 
 enum CefWrapperType {
-  WT_BASE = 1,
+  WT_BASE_REF_COUNTED = 1,
+  WT_BASE_SCOPED,
   WT_APP,
   WT_AUTH_CALLBACK,
   WT_BEFORE_DOWNLOAD_CALLBACK,
diff --git a/tests/ceftests/v8_unittest.cc b/tests/ceftests/v8_unittest.cc
index a8d10988f..1e0916137 100644
--- a/tests/ceftests/v8_unittest.cc
+++ b/tests/ceftests/v8_unittest.cc
@@ -571,7 +571,7 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
   void RunObjectUserDataTest() {
     CefRefPtr context = GetContext();
 
-    class UserData : public CefBase {
+    class UserData : public CefBaseRefCounted {
      public:
       explicit UserData(int value) : value_(value) {}
       int value_;
@@ -586,7 +586,7 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
 
     EXPECT_TRUE(value->SetUserData(new UserData(10)));
 
-    CefRefPtr user_data = value->GetUserData();
+    CefRefPtr user_data = value->GetUserData();
     EXPECT_TRUE(user_data.get());
     UserData* user_data_impl = static_cast(user_data.get());
     EXPECT_EQ(10, user_data_impl->value_);
diff --git a/tests/shared/browser/client_app_browser.h b/tests/shared/browser/client_app_browser.h
index 855dcd7d1..a64ee4ae0 100644
--- a/tests/shared/browser/client_app_browser.h
+++ b/tests/shared/browser/client_app_browser.h
@@ -19,7 +19,7 @@ class ClientAppBrowser : public ClientApp,
   // Interface for browser delegates. All Delegates must be returned via
   // CreateDelegates. Do not perform work in the Delegate
   // constructor. See CefBrowserProcessHandler for documentation.
-  class Delegate : public virtual CefBase {
+  class Delegate : public virtual CefBaseRefCounted {
    public:
     virtual void OnBeforeCommandLineProcessing(
         CefRefPtr app,
diff --git a/tests/shared/renderer/client_app_renderer.h b/tests/shared/renderer/client_app_renderer.h
index 15000920a..3edef9498 100644
--- a/tests/shared/renderer/client_app_renderer.h
+++ b/tests/shared/renderer/client_app_renderer.h
@@ -19,7 +19,7 @@ class ClientAppRenderer : public ClientApp,
   // Interface for renderer delegates. All Delegates must be returned via
   // CreateDelegates. Do not perform work in the Delegate
   // constructor. See CefRenderProcessHandler for documentation.
-  class Delegate : public virtual CefBase {
+  class Delegate : public virtual CefBaseRefCounted {
    public:
     virtual void OnRenderThreadCreated(CefRefPtr app,
                                        CefRefPtr extra_info) {}
diff --git a/tools/cef_parser.py b/tools/cef_parser.py
index 0fbfc1f81..bb1a44957 100644
--- a/tools/cef_parser.py
+++ b/tools/cef_parser.py
@@ -98,7 +98,7 @@ def is_base_class(clsname):
     """ Returns true if |clsname| is a known base (root) class in the object
         hierarchy.
     """
-    return clsname == 'CefBase' or clsname == 'CefBaseScoped'
+    return clsname == 'CefBaseRefCounted' or clsname == 'CefBaseScoped'
 
 def get_capi_file_name(cppname):
     """ Convert a C++ header file name to a C API header file name. """
@@ -715,7 +715,7 @@ class obj_header:
 
     def get_defined_structs(self):
         """ Return a list of already defined structure names. """
-        return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_t', 'cef_base_scoped_t']
+        return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_ref_counted_t', 'cef_base_scoped_t']
 
     def get_capi_translations(self):
         """ Return a dictionary that maps C++ terminology to C API terminology.
diff --git a/tools/make_cpptoc_header.py b/tools/make_cpptoc_header.py
index 1ca8a6d7d..a8c58e119 100644
--- a/tools/make_cpptoc_header.py
+++ b/tools/make_cpptoc_header.py
@@ -54,11 +54,11 @@ def make_cpptoc_header(header, clsname):
     base_class_name = header.get_base_class_name(clsname)
     base_scoped = True if base_class_name == 'CefBaseScoped' else False
     if base_scoped:
-      template_file = 'cpptoc_scoped.h'
-      template_class = 'CefCppToCScoped'
+        template_file = 'cpptoc_scoped.h'
+        template_class = 'CefCppToCScoped'
     else:
-      template_file = 'cpptoc.h'
-      template_class = 'CefCppToC'
+        template_file = 'cpptoc_ref_counted.h'
+        template_class = 'CefCppToCRefCounted'
 
     result += '#include "libcef_dll/cpptoc/' + template_file + '"'
     result += '\n\n// Wrap a C++ class with a C structure.\n'
diff --git a/tools/make_cpptoc_impl.py b/tools/make_cpptoc_impl.py
index 3c42c4d95..a0497d0ba 100644
--- a/tools/make_cpptoc_impl.py
+++ b/tools/make_cpptoc_impl.py
@@ -571,7 +571,7 @@ def make_cpptoc_class_impl(header, clsname, impl):
     if base_scoped:
         template_class = 'CefCppToCScoped'
     else:
-        template_class = 'CefCppToC'
+        template_class = 'CefCppToCRefCounted'
 
     # generate virtual functions
     virtualimpl = make_cpptoc_virtual_function_impl(header, cls, existing, prefixname, defined_names)
diff --git a/tools/make_ctocpp_header.py b/tools/make_ctocpp_header.py
index 07922ce64..64b4e8e7d 100644
--- a/tools/make_ctocpp_header.py
+++ b/tools/make_ctocpp_header.py
@@ -95,11 +95,11 @@ def make_ctocpp_header(header, clsname):
     base_class_name = header.get_base_class_name(clsname)
     base_scoped = True if base_class_name == 'CefBaseScoped' else False
     if base_scoped:
-      template_file = 'ctocpp_scoped.h'
-      template_class = 'CefCToCppScoped'
+        template_file = 'ctocpp_scoped.h'
+        template_class = 'CefCToCppScoped'
     else:
-      template_file = 'ctocpp.h'
-      template_class = 'CefCToCpp'
+        template_file = 'ctocpp_ref_counted.h'
+        template_class = 'CefCToCppRefCounted'
 
     result += '#include "libcef_dll/ctocpp/' + template_file + '"'
     result += '\n\n// Wrap a C structure with a C++ class.\n'
diff --git a/tools/make_ctocpp_impl.py b/tools/make_ctocpp_impl.py
index 050ca400c..f6d13db63 100644
--- a/tools/make_ctocpp_impl.py
+++ b/tools/make_ctocpp_impl.py
@@ -576,7 +576,7 @@ def make_ctocpp_class_impl(header, clsname, impl):
     if base_scoped:
         template_class = 'CefCToCppScoped'
     else:
-        template_class = 'CefCToCpp'
+        template_class = 'CefCToCppRefCounted'
 
     # generate virtual functions
     virtualimpl = make_ctocpp_virtual_function_impl(header, cls, existing)
diff --git a/tools/make_wrapper_types_header.py b/tools/make_wrapper_types_header.py
index 39a751e6f..48535ce5f 100644
--- a/tools/make_wrapper_types_header.py
+++ b/tools/make_wrapper_types_header.py
@@ -11,7 +11,8 @@ def make_wrapper_types_header(header):
               '#define CEF_LIBCEF_DLL_WRAPPER_TYPES_H_\n' + \
               '#pragma once\n\n' + \
               'enum CefWrapperType {\n' + \
-              '  WT_BASE = 1,\n'
+              '  WT_BASE_REF_COUNTED = 1,\n' + \
+              '  WT_BASE_SCOPED,\n'
 
     clsnames = sorted(header.get_class_names())
     for clsname in clsnames: