| 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 f62ade45501f5228f9d59ce9ffd1a18ec3106e64..a5364fbf2b2810e36be883d8a3bb4c7fc156ca31 100644
|
| --- a/content/browser/webui/web_ui_data_source_impl.cc
|
| +++ b/content/browser/webui/web_ui_data_source_impl.cc
|
| @@ -10,6 +10,7 @@
|
| #include <string>
|
|
|
| #include "base/bind.h"
|
| +#include "base/logging.h"
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted_memory.h"
|
| #include "base/strings/string_util.h"
|
| @@ -74,9 +75,8 @@ class WebUIDataSourceImpl::InternalDataSource : public URLDataSource {
|
| 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_;
|
| + return parent_->use_gzip_for_all_paths_ &&
|
| + parent_->excluded_paths_.find(path) == parent_->excluded_paths_.end();
|
| }
|
|
|
| private:
|
| @@ -147,7 +147,11 @@ void WebUIDataSourceImpl::AddInteger(const std::string& name, int32_t value) {
|
| }
|
|
|
| void WebUIDataSourceImpl::SetJsonPath(const std::string& path) {
|
| + DCHECK(json_path_.empty());
|
| + DCHECK(!path.empty());
|
| +
|
| json_path_ = path;
|
| + ExcludePathFromGzip(json_path_);
|
| }
|
|
|
| void WebUIDataSourceImpl::AddResourcePath(const std::string &path,
|
| @@ -168,6 +172,10 @@ void WebUIDataSourceImpl::DisableReplaceExistingSource() {
|
| replace_existing_source_ = false;
|
| }
|
|
|
| +void WebUIDataSourceImpl::ExcludePathFromGzip(const std::string& path) {
|
| + excluded_paths_.insert(path);
|
| +}
|
| +
|
| void WebUIDataSourceImpl::DisableContentSecurityPolicy() {
|
| add_csp_ = false;
|
| }
|
|
|