if think you don’t need to use all that filters and checks, you can just use site_url and replace
if ( !defined('WP_CONTENT_URL') )
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
with
if ( !defined('WP_CONTENT_URL') )
define( 'WP_CONTENT_URL', site_url( 'wp-content') );