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..b99281bebc60f465750bbe91c24828b247767c93 100644 |
--- a/content/browser/webui/web_ui_data_source_impl.cc |
+++ b/content/browser/webui/web_ui_data_source_impl.cc |
@@ -74,6 +74,11 @@ class WebUIDataSourceImpl::InternalDataSource : public URLDataSource { |
bool ShouldDenyXFrameOptions() const override { |
return parent_->deny_xframe_options_; |
} |
+ bool IsGzipped(const std::string& path) const override { |
+ if (!parent_->json_path_.empty() && path == parent_->json_path_) |
+ return false; |
+ return parent_->use_gzip_for_all_paths_; |
+ } |
private: |
WebUIDataSourceImpl* parent_; |
@@ -88,7 +93,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 +185,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_; |
} |