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

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

Issue 2149323003: Change the way that gzipped resources are loaded from resources.pak (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: found more Created 4 years, 5 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/web_ui_data_source_impl.cc
diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc
index 2c091282f99918187a41a59babd6507155453749..6bf283e36b032c245e4c95561e294bf49723d49c 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -74,6 +74,9 @@ class WebUIDataSourceImpl::InternalDataSource : public URLDataSource {
bool ShouldDenyXFrameOptions() const override {
return parent_->deny_xframe_options_;
}
+ bool IsGzipped(const std::string& path) const override {
+ return parent_->use_gzip_for_all_paths_ && path != parent_->json_path_;
smaier 2016/07/15 14:44:47 Why do we care if we match the json_path_ of the p
Dan Beam 2016/07/15 16:44:40 because things like string.js aren't gzipped
+ }
private:
WebUIDataSourceImpl* parent_;
@@ -88,7 +91,8 @@ WebUIDataSourceImpl::WebUIDataSourceImpl(const std::string& source_name)
frame_src_set_(false),
deny_xframe_options_(true),
add_load_time_data_defaults_(true),
- replace_existing_source_(true) {}
+ replace_existing_source_(true),
+ use_gzip_for_all_paths_(false) {}
WebUIDataSourceImpl::~WebUIDataSourceImpl() {
}
@@ -179,6 +183,10 @@ void WebUIDataSourceImpl::DisableDenyXFrameOptions() {
deny_xframe_options_ = false;
}
+void WebUIDataSourceImpl::UseGzipForAllPaths() {
+ use_gzip_for_all_paths_ = true;
+}
+
std::string WebUIDataSourceImpl::GetSource() const {
return source_name_;
}

Powered by Google App Engine
This is Rietveld 408576698