chrome/browser/ui/webui/chrome_url_data_manager_backend.cc
// Determine the least-privileged content security policy header, if any,
// that is compatible with a given WebUI URL, and append it to the existing
// response headers.
Determine the least-privileged content security policy header, if any,
that is compatible with a given WebUI URL, and append it to the existing
response headers.
Determine the least - privileged content security policy header if any that is compatible with a given WebUI URL and append it to the existing response headers .
void AddContentSecurityPolicyHeader(
    const GURL& url, net::HttpResponseHeaders* headers) {
  ChromeURLContentSecurityPolicyExceptionSet* exceptions =
      g_chrome_url_content_security_policy_exception_set.Pointer();
  if (exceptions->find(url.host()) == exceptions->end()) {
    std::string base = kChromeURLContentSecurityPolicyHeaderBase;
    ChromeURLObjectSrcExceptionMap* object_map =
        g_chrome_url_object_src_exception_map.Pointer();
    ChromeURLObjectSrcExceptionMap::iterator object_iter =
        object_map->find(url.host());
    base.append(object_iter == object_map->end() ?
                "object-src 'none';" : object_iter->second);
    ChromeURLFrameSrcExceptionMap* frame_map =
        g_chrome_url_frame_src_exception_map.Pointer();
    ChromeURLFrameSrcExceptionMap::iterator frame_iter =
        frame_map->find(url.host());
    base.append(frame_iter == frame_map->end() ?
                "frame-src 'none';" : frame_iter->second);
    headers->AddHeader(base);
  }
}
void AddContentSecurityPolicyHeader ( const GURL & url , net :: HttpResponseHeaders * headers ) { ChromeURLContentSecurityPolicyExceptionSet * exceptions = g_chrome_url_content_security_policy_exception_set . Pointer ( ) ; if ( exceptions -> find ( url . host ( ) ) == exceptions -> end ( ) ) { std :: string base = kChromeURLContentSecurityPolicyHeaderBase ; ChromeURLObjectSrcExceptionMap * object_map = g_chrome_url_object_src_exception_map . Pointer ( ) ; ChromeURLObjectSrcExceptionMap :: iterator object_iter = object_map -> find ( url . host ( ) ) ; base . append ( object_iter == object_map -> end ( ) ? " " : object_iter -> second ) ; ChromeURLFrameSrcExceptionMap * frame_map = g_chrome_url_frame_src_exception_map . Pointer ( ) ; ChromeURLFrameSrcExceptionMap :: iterator frame_iter = frame_map -> find ( url . host ( ) ) ; base . append ( frame_iter == frame_map -> end ( ) ? " " : frame_iter -> second ) ; headers -> AddHeader ( base ) ; } }
Determine the least-privileged content security policy header, if any,
that is compatible with a given WebUI URL, and append it to the existing
response headers.
Determine the least - privileged content security policy header if any that is compatible with a given WebUI URL and append it to the existing response headers .