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

Unified Diff: chrome/browser/ui/webui/options/options_ui.cc

Issue 2774263002: Specify AllowCaching = false for dynamically-generated contents (Closed)
Patch Set: typo Created 3 years, 9 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: chrome/browser/ui/webui/options/options_ui.cc
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index 9ad6fbba6fc8cb59ef620c1af3e5ffc2f7bce361..f82ca20dbdb951c95a32ba1c3131ce782885d150 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -200,6 +200,7 @@ class OptionsUIHTMLSource : public content::URLDataSource {
const std::string& path,
const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
const content::URLDataSource::GotDataCallback& callback) override;
+ bool AllowCaching() const override;
std::string GetMimeType(const std::string&) const override;
bool ShouldDenyXFrameOptions() const override;
@@ -270,6 +271,12 @@ void OptionsUIHTMLSource::StartDataRequest(
callback.Run(response_bytes.get());
}
+bool OptionsUIHTMLSource::AllowCaching() const {
+ // Should not be cached to reflect dynamically-generated contents that depends
+ // on the current locale.
+ return false;
+}
+
std::string OptionsUIHTMLSource::GetMimeType(const std::string& path) const {
if (base::EndsWith(path, ".js", base::CompareCase::INSENSITIVE_ASCII))
return "application/javascript";
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_icon_source.cc ('k') | content/browser/webui/shared_resources_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698