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

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

Issue 2544683002: [MD settings] i18n source stream filtering (Closed)
Patch Set: review nits Created 4 years 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
« no previous file with comments | « content/browser/webui/url_data_source_impl.cc ('k') | content/browser/webui/web_ui_data_source_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_data_source_impl.h
diff --git a/content/browser/webui/web_ui_data_source_impl.h b/content/browser/webui/web_ui_data_source_impl.h
index b76b5fca08ad3efe9d601719b371197f737b7179..b92363e5ca75338987e2eea13a06242db7d3fe12 100644
--- a/content/browser/webui/web_ui_data_source_impl.h
+++ b/content/browser/webui/web_ui_data_source_impl.h
@@ -50,6 +50,10 @@ class CONTENT_EXPORT WebUIDataSourceImpl
void OverrideContentSecurityPolicyChildSrc(const std::string& data) override;
void DisableDenyXFrameOptions() override;
void DisableI18nAndUseGzipForAllPaths() override;
+ const ui::TemplateReplacements* GetReplacements() const override;
+
+ // Add the locale to the load time data defaults. May be called repeatedly.
+ void EnsureLoadTimeDataDefaultsAdded();
// When DisableI18nAndUseGzipForAllPaths is enabled, exclude the given |path|.
void ExcludePathFromGzip(const std::string& path);
@@ -93,10 +97,13 @@ class CONTENT_EXPORT WebUIDataSourceImpl
std::string json_path_;
std::map<std::string, int> path_to_idr_map_;
std::unordered_set<std::string> excluded_paths_;
+ // The replacements are initiallized in the main thread and then used in the
+ // IO thread. The map is safe to read from multiple threads as long as no
+ // futher changes are made to it after initialization.
+ ui::TemplateReplacements replacements_;
// The |replacements_| is intended to replace |localized_strings_|.
- // TODO(dschuyler): phase out |localized_strings_| in Q1 2016. (Or rename
+ // TODO(dschuyler): phase out |localized_strings_| in Q1 2017. (Or rename
// to |load_time_flags_| if the usage is reduced to storing flags only).
- ui::TemplateReplacements replacements_;
base::DictionaryValue localized_strings_;
WebUIDataSource::HandleRequestCallback filter_callback_;
bool add_csp_;
« no previous file with comments | « content/browser/webui/url_data_source_impl.cc ('k') | content/browser/webui/web_ui_data_source_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698