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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2863683003: PlzNavigate: Fix wrong "Cache-Control" header. (Closed)
Patch Set: Add TODO Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 // Reload should reflect the current data saver setting. 221 // Reload should reflect the current data saver setting.
222 if (IsReloadLoadType(MasterDocumentLoader()->LoadType())) 222 if (IsReloadLoadType(MasterDocumentLoader()->LoadType()))
223 request.ClearHTTPHeaderField("Save-Data"); 223 request.ClearHTTPHeaderField("Save-Data");
224 224
225 if (GetFrame()->GetSettings() && 225 if (GetFrame()->GetSettings() &&
226 GetFrame()->GetSettings()->GetDataSaverEnabled()) 226 GetFrame()->GetSettings()->GetDataSaverEnabled())
227 request.SetHTTPHeaderField("Save-Data", "on"); 227 request.SetHTTPHeaderField("Save-Data", "on");
228 } 228 }
229 229
230 // TODO(toyoshim, arthursonzogni): PlzNavigate doesn't use this function to set
231 // the ResourceRequest's cache policy. The cache policy determination needs to
232 // be factored out from FrameFetchContext and moved to the FrameLoader for
233 // instance.
230 WebCachePolicy FrameFetchContext::ResourceRequestCachePolicy( 234 WebCachePolicy FrameFetchContext::ResourceRequestCachePolicy(
231 const ResourceRequest& request, 235 const ResourceRequest& request,
232 Resource::Type type, 236 Resource::Type type,
233 FetchParameters::DeferOption defer) const { 237 FetchParameters::DeferOption defer) const {
234 DCHECK(GetFrame()); 238 DCHECK(GetFrame());
235 if (type == Resource::kMainResource) { 239 if (type == Resource::kMainResource) {
236 const WebCachePolicy cache_policy = DetermineWebCachePolicy( 240 const WebCachePolicy cache_policy = DetermineWebCachePolicy(
237 request.HttpMethod() == "POST" ? RequestMethod::kIsPost 241 request.HttpMethod() == "POST" ? RequestMethod::kIsPost
238 : RequestMethod::kIsNotPost, 242 : RequestMethod::kIsNotPost,
239 request.IsConditional() ? RequestType::kIsConditional 243 request.IsConditional() ? RequestType::kIsConditional
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 std::unique_ptr<WebURLLoader> FrameFetchContext::CreateURLLoader() { 774 std::unique_ptr<WebURLLoader> FrameFetchContext::CreateURLLoader() {
771 return Platform::Current()->CreateURLLoader(); 775 return Platform::Current()->CreateURLLoader();
772 } 776 }
773 777
774 DEFINE_TRACE(FrameFetchContext) { 778 DEFINE_TRACE(FrameFetchContext) {
775 visitor->Trace(document_loader_); 779 visitor->Trace(document_loader_);
776 BaseFetchContext::Trace(visitor); 780 BaseFetchContext::Trace(visitor);
777 } 781 }
778 782
779 } // namespace blink 783 } // namespace blink
OLDNEW
« no previous file with comments | « content/browser/loader/reload_cache_control_browsertest.cc ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698