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

Unified Diff: content/common/font_list.h

Issue 13458002: Use sequenced workers for the getting the system's font list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use sequenced workers Created 7 years, 9 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
Index: content/common/font_list.h
diff --git a/content/common/font_list.h b/content/common/font_list.h
index 4f59e6d4d476ce01fafe6fff15cf380429c31039..dd14ce71c6866fda05865c8552f365c9433cecb4 100644
--- a/content/common/font_list.h
+++ b/content/common/font_list.h
@@ -13,6 +13,11 @@ class ListValue;
namespace content {
+// Getting the list of fonts on the system is non-threadsafe on Linux for
+// versions of Pango predating 2013. This sequence token can be used to enforce
+// serial execution of get font list tasks.
+extern const char kFontListSequenceToken[];
+
// Retrieves the fonts available on the current platform and returns them.
// The caller will own the returned pointer. Each entry will be a list of
// two strings, the first being the font family, and the second being the
@@ -21,6 +26,9 @@ namespace content {
// This function is potentially slow (the system may do a bunch of I/O) so be
// sure not to call this on a time-critical thread like the UI or I/O threads.
//
+// Since getting the fonts is not threadsafe on Linux, use
+// |kFontListSequenceToken| to prevent race conditions.
+//
// Most callers will want to use the GetFontListAsync function in
// content/browser/font_list_async.h which does an asynchronous call.
scoped_ptr<base::ListValue> GetFontList_SlowBlocking();

Powered by Google App Engine
This is Rietveld 408576698