Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: content/browser/webui/url_data_manager_backend.cc

Issue 2255833003: DO NOT COMMIT: hack hack hacking on preloading md-settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: to show dave Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/webui/url_data_manager_backend.cc
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc
index 404e834ca0d7542a3723e37baa9e0370a4958f98..7779f5190c0f6cec441652e82db58735acce148a 100644
--- a/content/browser/webui/url_data_manager_backend.cc
+++ b/content/browser/webui/url_data_manager_backend.cc
@@ -185,6 +185,10 @@ class URLRequestChromeJob : public net::URLRequestJob {
access_control_allow_origin_ = value;
}
+ void set_preload_headers(const std::vector<std::string>& preload_headers) {
+ preload_headers_ = preload_headers;
+ }
+
// Returns true when job was generated from an incognito profile.
bool is_incognito() const {
return is_incognito_;
@@ -247,6 +251,8 @@ class URLRequestChromeJob : public net::URLRequestJob {
// True when job is generated from an incognito profile.
const bool is_incognito_;
+ std::vector<std::string> preload_headers_;
+
// The backend is owned by net::URLRequestContext and always outlives us.
URLDataManagerBackend* backend_;
@@ -355,6 +361,10 @@ void URLRequestChromeJob::GetResponseInfo(net::HttpResponseInfo* info) {
access_control_allow_origin_);
info->headers->AddHeader("Vary: Origin");
}
+
+ for (const std::string& preload_header : preload_headers_) {
+ info->headers->AddHeader(preload_header);
+ }
}
void URLRequestChromeJob::MimeTypeAvailable(const std::string& mime_type) {
@@ -635,6 +645,7 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request,
source->source()->ShouldDenyXFrameOptions());
job->set_send_content_type_header(
source->source()->ShouldServeMimeTypeAsContentTypeHeader());
+ job->set_preload_headers(source->source()->GetPreloadHeaders());
std::string origin = GetOriginHeaderValue(request);
if (!origin.empty()) {
« no previous file with comments | « content/browser/webui/shared_resources_data_source.cc ('k') | content/browser/webui/web_ui_data_source_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698