Index: content/browser/webui/shared_resources_data_source.cc |
diff --git a/content/browser/webui/shared_resources_data_source.cc b/content/browser/webui/shared_resources_data_source.cc |
index 03721b0c5e1d1d024c234d0ea0cc90f7f2c5a47a..c6bb694868e7d23722ef268e97c9732ac691982b 100644 |
--- a/content/browser/webui/shared_resources_data_source.cc |
+++ b/content/browser/webui/shared_resources_data_source.cc |
@@ -12,6 +12,7 @@ |
#include "base/memory/ref_counted_memory.h" |
#include "base/strings/string_piece.h" |
#include "base/strings/string_util.h" |
+#include "content/public/browser/browser_thread.h" |
#include "content/public/common/content_client.h" |
#include "content/public/common/url_constants.h" |
#include "ui/base/layout.h" |
@@ -148,6 +149,10 @@ std::string SharedResourcesDataSource::GetMimeType( |
scoped_refptr<base::SingleThreadTaskRunner> |
SharedResourcesDataSource::TaskRunnerForRequestPath( |
const std::string& path) const { |
+ // Use UI thread to load CSS since its construction touches non-thread-safe |
+ // gfx::Font names in ui::ResourceBundle. |
+ if (GetMimeType(path) == "text/css") |
+ return BrowserThread::GetTaskRunnerForThread(BrowserThread::UI); |
Dan Beam
2017/02/23 00:27:56
sorry, don't do this
Dan Beam
2017/02/23 00:32:26
and by that i mean, push all text/css to the UI th
tzik
2017/02/23 00:58:19
Updated.
tzik
2017/02/23 00:58:19
Hmm, I think it's unclear from this code that the
Dan Beam
2017/02/23 02:11:30
i'm fine with either
|
return nullptr; |
} |