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

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_data_source.cc

Issue 7714007: Apply content-security-policy directive to chrome://workers page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_data_source.h ('k') | chrome/browser/ui/webui/workers_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chrome_web_ui_data_source.cc
===================================================================
--- chrome/browser/ui/webui/chrome_web_ui_data_source.cc (revision 97885)
+++ chrome/browser/ui/webui/chrome_web_ui_data_source.cc (working copy)
@@ -14,8 +14,15 @@
ChromeWebUIDataSource::ChromeWebUIDataSource(const std::string& source_name)
: DataSource(source_name, MessageLoop::current()),
- default_resource_(-1) {}
+ default_resource_(-1) {
+}
+ChromeWebUIDataSource::ChromeWebUIDataSource(const std::string& source_name,
+ MessageLoop* loop)
+ : DataSource(source_name, loop),
+ default_resource_(-1) {
+}
+
ChromeWebUIDataSource::~ChromeWebUIDataSource() {
}
@@ -33,6 +40,9 @@
if (EndsWith(path, ".js", false))
return "application/javascript";
+ if (EndsWith(path, ".json", false))
+ return "application/json";
+
if (EndsWith(path, ".pdf", false))
return "application/pdf";
@@ -42,7 +52,7 @@
void ChromeWebUIDataSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
- if (path == json_path_) {
+ if (!json_path_.empty() && path == json_path_) {
Evan Stade 2011/08/24 20:47:23 I think it would be perhaps clearer to instead do
Tom Sepez 2011/08/24 20:52:36 Not quite. json_path_ can be empty if the particu
SendLocalizedStringsAsJSON(request_id);
} else {
int resource_id = default_resource_;
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_data_source.h ('k') | chrome/browser/ui/webui/workers_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698