diff --git a/cef_paths2.gypi b/cef_paths2.gypi index 432d882c..23b91059 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 bdb8a626..01aeec16 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 14aec672..32e30eaa 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 b12ff364..681ef4da 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 5cb198c8..9e1362f6 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 5bda19ed..ddb3a35b 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 10c290d1..8f6e28d3 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 1680da28..9feddf59 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 a5d78a88..f3dc1794 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 7670d80d..b063548e 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 b9126d7e..6ba8dca5 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 65ca6371..76818d3d 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 6697a230..6dc3fd0f 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 9370b99d..b3857a80 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 38bc4d92..12ff657b 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 acefa01f..9ed53f6a 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 2e84df8f..e1fcfd8c 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 1a5f199b..35fbb31a 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 a20ec701..d489353f 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 c0e72393..c559acda 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 65b6d1de..ead9ab8e 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 15df9427..3325d10c 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 65a3d1d9..ee2651c2 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 ecafe771..5eec9f42 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 ee974ad6..24acb0c9 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 e2901f8e..1e1ee708 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 811c03fb..77885da0 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 c2d34ba4..5c79aaa8 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 16fdf243..d7035b08 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 6e208b83..549ce6d3 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 7b44d0e2..75f064f4 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 2df904af..428d76a9 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 5f698f0c..0a010be1 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 8b575f4e..fab85b5e 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 48c0cdbc..7912ff18 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 30a15a2c..c235957e 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 3383939d..9732431f 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 5c940eb9..97e292fc 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 ddd4358e..32b9c005 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 c7e7cf97..7cc6e982 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 199b300b..87b01f04 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 d8219c36..62d0c449 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 a294c070..3722fb1a 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 43a69a6a..59395566 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 a4215109..698598d5 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 3c68e23b..8bfb50d8 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 509ee694..89921931 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 094a6d53..04d86714 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 36a6c519..54feece2 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 e75ab987..5d19875d 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 b2328c51..98656de9 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 1215cddd..6a766268 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 c5a13b0d..c753eb40 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 5b79e83d..02a5063d 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 c4dc0a73..a659b8da 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 8772b69f..cd3c7b44 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 a7d42725..077a4323 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 fedce294..c3dc6d99 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 1333fb2c..f0afb3fa 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 73e48883..98189507 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 a71c6155..bb398e89 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 1716fb39..14d3fd51 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 6853cd9c..44c4b47b 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 43e239fa..1c6b0585 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 77b59bac..eeeb642b 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 4bce72ff..07ea4c54 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 cc5cb91c..5aca29b3 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 86d249ad..ca511fdc 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 8a7b5b75..c152cf06 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 2d4d8abb..3b4ed161 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 9045d09a..e65503fb 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 e5efebd2..5be51e94 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 81a67eba..9421c7c0 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 96241cf4..5e581b6e 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 2bad463b..7619b8ed 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 b4cb33cb..28f056d8 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 93cd5de7..3ca98fb5 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 3f064610..6147cc79 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 65933b75..f653a074 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 4f58af48..b32c248e 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 988ef6bd..b0ea797f 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 8f8094b4..29b85e84 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 3e26f975..aee01366 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 410cf5fe..a9cac0a1 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 1d91c42a..27352fa2 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 1ea172f1..bcf680d6 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 69c08779..32005a43 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 dda52834..b2a722ce 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 170a2375..71f69ab6 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 fecaa7f7..4596430c 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 0346aa4a..cd4c4d0e 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 6967e3e8..b1acc4d7 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 1494a844..99696ed8 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 beb95fb7..b2606a8d 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 84ebae18..aa23ffcb 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 6dc3a4c5..9c86a338 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 cac16244..50519c4f 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 709d36b3..0fe2a0ba 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 1e27bd68..a6b6a18a 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 0f857b07..9c253535 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 98ab391b..ecf6fc59 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 a4626aa0..8d48f41d 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 8892d5f7..3f6d8fd4 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 6996d9ed..26864e88 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 69334397..c44a3dfa 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 3b064ffe..3fda8998 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 afc46da7..932ef9f5 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 19913c75..abe7196d 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 6fcb4e23..cd7356ef 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 55e66777..58c978ea 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 5861d85b..d4b1ac0c 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 73217188..db075cab 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 614a607d..3a5f3950 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 3d0633c2..81b0b916 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 54937147..36a97ba3 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 0ecaa752..ea3b2d96 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 a0e78c49..dfe652d2 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 5b977c6e..fa7f6278 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 5b58b634..23bc821e 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 f33090a4..2ec4feb8 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 86fa40ef..6bbd1e27 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 4a4e9950..070ca681 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 731be7b9..3eea5413 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 f036ab5e..c784ce1b 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 86be8bac..ab5244e3 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 5d8788e9..80640087 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 7874699f..25ce7455 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 9c5d4288..be27652b 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 d9da0602..e3a84561 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 d820a275..5f1fcf4e 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 b6f321e0..d694ec51 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 70fd176c..1bfc7bb1 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 559cdd81..bf593d0a 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 8828c656..d9b559b6 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 2a6fcfe6..23510ddc 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 7ad10bda..5de0960f 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 55ad08c7..ddd03c18 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 ee383cc8..08baefc9 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 cf6f8b8c..a165ef85 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 825e5881..32c4d6d8 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 433ebaaf..b9f7746e 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 0963510d..cd786f5d 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 4be84397..19430858 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 2ba37a24..aab0f644 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 8e6445df..f61b038c 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 2c67988b..00000000
--- 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 00000000..8a528b34
--- /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 8be2681b..c3b845ec 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 7562b04f..7ae2d330 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 a4a845d7..9ecc06df 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 b0f67046..97ff7ad6 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 136a0e78..89c868dc 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 2b1c069f..5d508170 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 1b1a94b6..4be10844 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 28e5a428..17c1a871 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 cd3ce293..09fd6437 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 2b49bb59..62d0bce3 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 458d897b..81261b97 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 458562fc..ca1c8a8b 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 6d9285f7..b0cb5458 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 1c203f9a..c0b9670c 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 b01a7895..5eb7b045 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 ecd4c843..4b529af0 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 ca8fdfee..42e3d772 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 a525ba79..becee993 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 18ae3f78..1c1802c7 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 062ec87f..41fcaadf 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 7116b06a..1c899fca 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 371ab6b4..65db9d77 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 17a41fa5..75f0b0f7 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 e392b053..17eeda6a 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 393950b9..02f7233e 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 e7c540c4..5c4f0ed7 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 4dea7ca2..17fdebc7 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 fc747448..a9d775dd 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 5bf26b24..41adf81e 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 15f243ea..540fa8e5 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 e0295028..6b5fbc1a 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 8d1ca062..943099f7 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 939d6b9c..f50500b5 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 8b14dc3e..835e9370 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 3e7bd74f..b939f493 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 1baa2a05..9d8618d5 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 c03a2e1b..f999d773 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 644ceb8b..943e4110 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 693161f8..4b65bdee 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 841dcb72..2eaf515b 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 8a2e4e11..a5e6c2c6 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 09fce198..fb803c4d 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 58f6c272..520ed6f5 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 feb11cdc..646fcde7 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 66f7c29b..9af10db5 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 b7c3a85a..85dc48c5 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 b7cd0f0c..6a5c2739 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 32b17fb0..1b588242 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 e54439fd..e4b8ce5e 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 23dbbb1e..75d3a5bb 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 5b9cd582..83acbea1 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 ffad1755..381b88b9 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 c5641e74..a2104370 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 459c1e79..fd9f3adf 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 0b7d5947..3704d3ac 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 c55227b6..b2931b56 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 d634aee5..89254778 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 e254032d..78173e43 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 d0e4776c..4322e813 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 c6803b2f..56702f2d 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 b07da128..c8f6168d 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 8c4db4b6..9d89e680 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 af674b17..d559d2a8 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 622e343e..978735c6 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 e3e406da..0a8cd199 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 37b2ec9d..9c14de5d 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 38b06b73..ef869c5a 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 673f6696..0598b7b9 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 38091fac..66a5ac4b 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 e5ec2551..bb1a0d05 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 e8143e8f..594e0049 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 b89f9ec9..f7d816c3 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 f27c4df1..7871f47a 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 36747949..5ae872ba 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 a07874b9..3cff8cbd 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 a64863c5..22e14299 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 beb91a8e..7a0cba55 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 85da445a..845d7fd6 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 3daed21b..11f875cb 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 95cc7d88..33ad7876 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 36b9eef1..35fa3b71 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 b726b86e..c2473a2a 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 39afa5e9..80b1a26c 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 58fca735..c45758a2 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 00dc79d7..18865dd8 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 35d4b717..5e1aa20c 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 0a2dd4a9..9cadc6e1 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 99aa71ac..f022b818 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 418e0e67..3ca65ad2 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 cee596ad..212d6531 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 50163fd2..ec8dd605 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 199194db..e288dace 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 f0f2ccfc..9d54c47d 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 8a1d5e1c..6a96785c 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 3da22358..4ae264e1 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 a934176c..1ced479b 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 1bb6fe9b..a4a2dd70 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 27b17f01..97a0a09a 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 4ab16a7f..0af30a49 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 06f7c9e8..2f518617 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 c31a760f..63869885 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 c0d6f86b..71a830d1 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 9032b319..02ec23ed 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 9b1f78f1..b1eb6f2b 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 b6cd90a0..75b32ae0 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 277d29d9..80931bda 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 51dfbb76..7eab31a3 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 6d2f1a00..a84ae1ec 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 bc5f8de5..97369561 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 6ff64d77..cad1820c 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 93918e24..4ffcf74d 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 5b27ec4d..1fe8e4e3 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 5e9dc134..788b79c8 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 36076ccf..63dcdb09 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 8a70abd3..3c62d30f 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 8cb692c1..ec133b0a 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 9fa95aab..bad14ecb 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 40aa3741..aa78ac70 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 dd6ac0b2..ab48ecf3 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 4e5621cc..660aa06c 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 4d90831c..d0ced02d 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 1ee0b879..308afff1 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 bf1c750c..9c111a59 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 58f85290..7e797ab7 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 b8d1dbc8..9f53f811 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 3961ebb3..5115ac27 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 6c028c8d..f5654c2a 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 3d0f2bef..38f060a6 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 a7091563..5a700d3d 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 4d551ce1..9951f9df 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 59aeac04..a8625bb7 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 4617ba9d..92939822 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 fec421b2..31fc05d1 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 8f484f22..9ed9356c 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 9565dad2..e4a42ee7 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 650b7be1..bccc7559 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 65d122c9..8eb7b281 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 350709b9..9f4dbcfe 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 607992f0..4a3cd1e6 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 7ceb9a1d..d357f6b5 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 24695352..9141baee 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 225d326f..af47f3f2 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 fd8b6da9..d88f2ed8 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 909cfd85..c86ea120 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 7d046720..b239a78b 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 ece400b5..4c309f2a 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 923abd35..b76c3443 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 0576d799..92ab9998 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 2079452c..62e583de 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 0b7ce0db..98ddba1b 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 ec5345aa..dae2ccb3 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 ea494dba..488342ae 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 5c9f853f..028dd136 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 fdeb2864..01480f89 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 1d15b9f0..4bdbc524 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 6ec43261..e090332d 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 dd8a4b1f..71711898 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 77585322..d15dbece 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 a449b430..9aa85c19 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 8611b9fb..0ee203ea 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 9d5f5c0d..d0f65756 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 a67ad67e..3600f668 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 89a82884..a46a30e1 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 558021dd..e966b06b 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 c341b7da..1f6f4c09 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 2698bcf1..68e748e8 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 9c36a40b..510e2724 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 96d6a39f..6982bf1b 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 c8c14aeb..906b6204 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 548d45fe..a86357ab 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 ebddb29d..ed1e1cb3 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 4aff1f50..c226081c 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 688ae461..33e3cab9 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 893e3406..62274e04 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 c41d9335..e3a7e347 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 a6135a26..3bc39d24 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 b78664d7..5ab89ba9 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 d64f43ed..0b9122b3 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 384cacb9..9949caed 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 7293b8b7..38064333 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 31cd2e78..7fd5617a 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 5b79c7f8..d7a46523 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 5a97de81..b840dca4 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 e2e86a15..2dd8de22 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 d58197fd..053ac034 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 fffcdbb8..c7c88276 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 b3b7fb77..a7aef090 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 c9efddba..1092fe5c 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 8c4c4c1f..ccc9dd6e 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 82451d28..28d96223 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 143029c1..f2fbcbca 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 c01c9e21..7ec0f27d 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 cf101fb0..a9dc2fef 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 fbaaabf7..b8d89bd2 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 2fb54980..946de744 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 deadc191..379294ea 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 fe5048a1..9a01b470 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 d24e417e..2e65b608 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 57185aaf..0704da72 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 fd2c2a8b..aaf01e3a 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 416b7706..1de9e784 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 0d7c37b9..21cf0e08 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 1118d76f..0afb58c3 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 0b661bfe..f7a14b40 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 fd6e9dfa..15799a91 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 68ae8955..a94e01a3 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 6ddac972..3ce36500 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 8e038057..5ddb2f25 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 9a545a9e..add0ecf8 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 4813204e..760a08eb 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 65398cdd..6faa6a1a 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 8eb609ea..08aa865a 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 00456881..60c25c6a 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 617fa7f8..24b62d9d 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 a82b1988..d3a0ca2e 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 1d98c6cb..1ec3283f 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 a9b3838a..bb8347af 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 22b4fed0..1a9247f4 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 609f56e8..d45ea6aa 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 0ee13ff6..b71d8cc0 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 ebdaf881..33932047 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 37ce9277..a0d63590 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 6edff1d7..0bf45226 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 59beae3f..c730b0d5 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 fb5c8373..562dacf1 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 675b10e6..68979dd4 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 09814811..64a126b2 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 805e766f..89c942f9 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 a83a483d..69c55eaa 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 c69b0499..b7fde430 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 f3210931..6fcf8893 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 8a3bdc83..c08f1dc9 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 37c92c17..ca36f9f7 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 db97fd30..74c7ca9f 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 5b555dd5..38011f15 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 dbfd1ef2..83e2fdfe 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 207d12bd..3af127f6 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 37481e96..5f1679d1 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 edd5239a..f37db11e 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 8a993592..d5197371 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 9b5cf32a..94719685 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 9c1d15fc..26dad803 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 41062916..2016dd56 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 615b27e1..020f1807 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 d71cda7e..d0891731 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 8561fa28..bf8cc769 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 a29e7865..08ad2373 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 23d209e3..270f3beb 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 a6280db0..68bb56b3 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 87a1f642..b5bdcc89 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 b068beaf..a586206f 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 dc142904..16405fd4 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 50a72428..76f9b04d 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 9ba0f916..a640e24c 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 8a13b615..b119cb86 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 972bcf78..c6ae74e6 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 19252921..6e01bd3c 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 43c4e2e5..0e840f0d 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 2f6975e5..287dfa2f 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 1a99f23e..1b8810f9 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 f50533ca..69ce967d 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 31e7bfcf..00000000
--- 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 07051c3c..00000000
--- 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 00000000..90b8377b
--- /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 00000000..fce82f05
--- /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 2ee3a70c..40d94e56 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 ac4ca295..ebf19c82 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 d9a6265e..3e71d658 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 47241af6..652be1cd 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 72f82baf..34468971 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 78b42abe..2a419bf2 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 06070a3a..7fbc2563 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 eb3d3c90..be2e52c7 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 7c2413bf..667d5113 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 45402715..60441143 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 9432e4e6..1b5830cc 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 60e74814..8f79e986 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 de185269..892d6e7a 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 7919f75a..fc61ac6e 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 1140ccc1..1724d8b6 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 e61c51e1..116b2ec6 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 5a92fa06..17364f55 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 3d649f66..cb0bb6d9 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 0d29eea5..953accbe 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 45bbdebd..5d75b55b 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 a36f2bb2..0e15d938 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 45620a14..9765b008 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 a0e00a52..1bdab01b 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 9e6acbb2..47eb6d4a 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 4445be30..7ea85182 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 064536aa..069fed86 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 8205f418..d86eabc9 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 85ca5fc6..e636c67d 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 7a0421a1..74d45ef8 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 0f5e94f9..b585074e 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 c2399826..0f6e98f0 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 061d10e5..736d986a 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 d36fe377..ed824673 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 9e05a99c..2a18865e 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 402f9038..564b3871 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 347a272c..4cf0ebd4 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 06d2b410..a3fca4c3 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 a4e0379f..1b659792 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 339691ba..548d1e4f 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 0be0b087..a6d75107 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 5736bd12..08bef8a8 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 c22a6dc2..2eca8aba 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 9c2c0366..bf19f253 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 4b67b75a..d4bebeaa 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 b3263807..33e486b6 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 7498c99c..2a63ab69 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 b8d01bbf..fa08ed51 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 7cb56cb8..494aca7c 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 dcdc344d..36d652e9 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 1e99d6c3..f0532796 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 ab27df2e..db1a2f71 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 85ea3e58..5b202710 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 043ba61f..0e73683d 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 ffa5ae42..bdec3ed5 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 ab251d30..e9b40439 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 f830ce1e..d3a89b8b 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 e163f59e..783fd9ed 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 a06187b1..d7308336 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 1b1cc9d8..d6fdf105 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 2e74f69a..2216d97e 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 555e76be..fad71714 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 73519d9a..3c34330d 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 ca5011f7..6ce68c45 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 799f831c..0317ef10 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 a9d398fa..4aee9b8a 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 15ffcee4..a5e66659 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 66300ea9..16bba0ef 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 013c486e..5cc2b9c7 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 c676d1b0..071d9d45 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 b9422a02..abb49386 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 4b145024..8d15a25f 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 318f3aaf..f0393f03 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 6f0000b0..7531ef09 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 41a61364..0d05cddc 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 36c63b63..40664db0 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 0827a15d..60c48e67 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 1f59d907..5e2c5e23 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 118a7027..c4ddcd9c 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 e393c9cf..ba820b60 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 c350474a..540e7b25 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 2c6b4fc6..9be76054 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 30d3ca11..c376ba9d 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 1e5fe7f8..3b47e00d 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 9c86f1ae..9cf0adcc 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 52877e5b..0c469bab 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 d4493591..5f43bf19 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 c296a1e9..96eadaba 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 30869095..e8feba06 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 f3ca6859..5bd74ae0 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 f091d6ce..e360e50c 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 051b74f5..1c853e69 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 6bf1b735..56c6ef2f 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 e3df7e2d..2a29cc79 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 fc3defe4..961474b3 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 6bf94d52..35b0aef7 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 5a72fe5e..820b5387 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 52d98200..7ad7a1eb 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 e3cb9477..019bc2b5 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 5ffe70ef..ed9e40f1 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 6c7f9156..db4e74d4 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 1ad5bb5b..301255fa 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 f9dce854..e063ff08 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 3c46f9aa..74d0dc29 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 1dc54ab5..129a7e98 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 2d6f6ad2..7d80f72c 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 fd26921e..b07988fa 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 2f7b81d1..acf98c59 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 d977a75c..a3b209a4 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 205d1d9e..2a3d781b 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 55475f2b..6f5159e2 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 ce6d32c3..65c7db09 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 0aa1b359..d7c0e254 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 6b26552c..2bcd17d9 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 5720df96..b4931025 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 c56a52f8..78ea6613 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 84834975..a4274e97 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 674592bf..f287fd61 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 5f87fdd9..c49f1cbf 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 9ae0da4c..11783a50 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 7fc49d55..03eb35db 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 783433d1..e253567d 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 2a92d64e..82094aba 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 f3c6f1bd..646ee8c9 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 832ebd8b..6f55e95f 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 d924b8cb..b55fe5b8 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 199d6f4f..0dfe6911 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 dee2cc19..ac3d136e 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 12d3a996..b7a48dcb 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 ec8fcf41..7823e08d 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 f4acfed9..2778e07a 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 a4c1d740..1baae856 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 b52503ec..0703f89f 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 5d548625..ba1209bf 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 ade338ed..34686eee 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 f0654a05..20a3d905 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 b123417f..bf041e72 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 eeba668e..2f90784c 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 0225c28d..3cd86f66 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 30656a59..eb9556d6 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 76a3ff1c..933fea82 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 2a40d7f5..8de11f31 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 636d231e..eebd1944 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 4f59bdc6..a25954fe 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 d981035c..01b0d1b4 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 f51ba0ff..73c66f33 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 82c50bb8..02cae423 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 02e53491..fdfb9772 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 e536cb31..3bcb4873 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 539585fc..9f0fbef8 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 c961bf2a..c494eb32 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 62acdd19..c0fe9b92 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 f5f7e3e0..3d390490 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 d99d3c16..8e82738f 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 fab165bc..4dbcd12f 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 48cf497e..b4c6fe12 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 3d406030..3f7476d8 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 072fcb28..18e2cab9 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 f038eee3..b8fd4c56 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 76914a22..e447dd5b 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 17b61ecf..c3cb9b33 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 99086ed5..8537c222 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 1187eb7a..a3631f8d 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 3702eda6..f4444f29 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 cc2fe198..07afe803 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 5aac818b..9ab2284b 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 0dd9e5cb..ed10750f 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 e1a7ca77..7b1cb40b 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 83ffc852..6222c5c3 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 9bcab59d..4445e2fa 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 eefaf123..affefbf2 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 c52751c5..4917e027 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 3d2d8d97..f8149f83 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 c39b0504..f8887a2c 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 fe11d6e3..b1454419 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 5f0cbbf4..b657003b 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 393c3c3f..8bfbdb4e 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 a0b1c499..29bf425b 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 1017d02c..c8f5452e 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 1902daad..a32e5647 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 af604001..88df2438 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 5d777c77..d3886743 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 665605b3..63e70ca5 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 225ba8e9..fa2f463d 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 fbf6479c..9bd218f6 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 d77f0a43..3c4dee1e 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 31b3d9bf..ed2cbec2 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 765d8384..1d14e730 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 96463e3f..2d320ef5 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 c7529274..49216779 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 204076f5..7e5dbfc1 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 560dea18..0ec6232e 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 90e647b1..2cfad29e 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 e4927833..251cbdc8 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 93ac0a69..ee1e5c32 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 ee44c91e..019bc151 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 26c18faf..7518e661 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 fd5de9bd..fcc56ee3 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 dc9c4e8d..24b6e3a3 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 1d4d83e4..152dee2c 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 9fd41736..4db8bce5 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 58f67c18..5ec9d047 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 a9a8090c..e72f54ce 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 7fa17fe8..61ba96c6 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 e50208fe..267a940a 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 83f7e392..e87e8063 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 8dda3f5d..5f76b62b 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 2018d130..3c2da517 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 9e26e00a..cc1d22f1 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 f71cc29b..30aaf90d 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 aa6ff471..69387530 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 c333a11b..29ae9c46 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 b4afa7b1..a4dc1d97 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 e059618a..9545b479 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 5f248ec3..ea87cad1 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 cd88f9c6..0cba620d 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 41bdc6af..ed873d59 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 ed4e90a4..cb38cc88 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 56a92823..9da96f42 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 69cdeb69..fe8abbf6 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 e44b12ff..d79daf15 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 184db908..1e138571 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 cd963a9f..25c7b44e 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 e0d0b34a..f4f0c7a8 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 2f9140cd..d6916cdb 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 47971205..18a7484c 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 6e02c465..48080c41 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 72e28969..b88b8445 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 112fbf52..4fb95b65 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 a87a8477..1836c787 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 957ab226..83da8fdb 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 96e858c3..ca2c72c6 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 702fb0a2..8dc56862 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 925ebdba..6cfde7b4 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 77ca28af..27840d96 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 d303dfa8..40505fcb 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 2cc4e22c..6e7593cd 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 3642c96a..93da33c6 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 35e73bcd..81a3be8d 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 9e8bf9b5..5677e99e 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 c515e0e9..72c6d72d 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 db977682..4b63637c 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 8fc91475..d971085b 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 dcda4d0c..ee10be2e 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 54cdc69d..83155447 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 abe97a74..72f285b2 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 0bb3c540..9addbcd3 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 da70ee1b..3669acfc 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 6be13549..8b2db065 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 344279e6..0aab0954 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 d7369cf5..4fd5c72e 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 010c2b22..95000704 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 e2756825..8a7925a4 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 705bd445..b38bbc36 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 90003320..54fa1190 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 708db7ac..efc3cf3a 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 2d6c6733..42ddcd8e 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 3d29feeb..f8878a14 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 7c027393..c9a464f1 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 a8d10988..1e091613 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 855dcd7d..a64ee4ae 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 15000920..3edef949 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 0fbfc1f8..bb1a4495 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 1ca8a6d7..a8c58e11 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 3c42c4d9..a0497d0b 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 07922ce6..64b4e8e7 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 050ca400..f6d13db6 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 39a751e6..48535ce5 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: