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

Unified Diff: content/common/font_list.h

Issue 2886883003: Remove content::kFontListSequenceToken. (Closed)
Patch Set: Created 3 years, 7 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 | « content/browser/renderer_host/pepper/pepper_truetype_font_list_host.cc ('k') | content/common/font_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/font_list.h
diff --git a/content/common/font_list.h b/content/common/font_list.h
index 77292138d77f6a738bbbd7091991507740c38c22..3922275d6235904c1e672c407955b0860191682e 100644
--- a/content/common/font_list.h
+++ b/content/common/font_list.h
@@ -7,30 +7,28 @@
#include <memory>
+#include "base/sequenced_task_runner.h"
+
namespace base {
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[];
+// GetFontList_SlowBlocking() must only be called from the SequencedTaskRunner
+// returned by this function because it is non-threadsafe on Linux for versions
+// of Pango predating 2013.
+scoped_refptr<base::SequencedTaskRunner> GetFontListTaskRunner();
// 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
// localized name.
//
-// 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.
+// Can only be called from the SequencedTaskRunner returned by
+// GetFontListTaskRunner(). Most callers will want to use the GetFontListAsync
+// function in content/browser/font_list_async.h which does an asynchronous
+// call.
std::unique_ptr<base::ListValue> GetFontList_SlowBlocking();
} // namespace content
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_truetype_font_list_host.cc ('k') | content/common/font_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698