[email protected] | d259a8e | 2011-05-18 22:31:09 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef CONTENT_COMMON_FONT_LIST_H_ | ||||
6 | #define CONTENT_COMMON_FONT_LIST_H_ | ||||
7 | |||||
[email protected] | ec810db | 2012-02-29 19:20:14 | [diff] [blame] | 8 | #include "base/memory/scoped_ptr.h" |
9 | |||||
[email protected] | f3a1c64 | 2011-07-12 19:15:03 | [diff] [blame] | 10 | namespace base { |
[email protected] | d259a8e | 2011-05-18 22:31:09 | [diff] [blame] | 11 | class ListValue; |
[email protected] | f3a1c64 | 2011-07-12 19:15:03 | [diff] [blame] | 12 | } |
[email protected] | d259a8e | 2011-05-18 22:31:09 | [diff] [blame] | 13 | |
14 | namespace content { | ||||
15 | |||||
[email protected] | bc96dad5 | 2013-04-04 12:01:35 | [diff] [blame] | 16 | // Getting the list of fonts on the system is non-threadsafe on Linux for |
17 | // versions of Pango predating 2013. This sequence token can be used to enforce | ||||
18 | // serial execution of get font list tasks. | ||||
19 | extern const char kFontListSequenceToken[]; | ||||
20 | |||||
[email protected] | d259a8e | 2011-05-18 22:31:09 | [diff] [blame] | 21 | // Retrieves the fonts available on the current platform and returns them. |
22 | // The caller will own the returned pointer. Each entry will be a list of | ||||
23 | // two strings, the first being the font family, and the second being the | ||||
24 | // localized name. | ||||
25 | // | ||||
26 | // This function is potentially slow (the system may do a bunch of I/O) so be | ||||
27 | // sure not to call this on a time-critical thread like the UI or I/O threads. | ||||
28 | // | ||||
[email protected] | bc96dad5 | 2013-04-04 12:01:35 | [diff] [blame] | 29 | // Since getting the fonts is not threadsafe on Linux, use |
30 | // |kFontListSequenceToken| to prevent race conditions. | ||||
31 | // | ||||
[email protected] | d259a8e | 2011-05-18 22:31:09 | [diff] [blame] | 32 | // Most callers will want to use the GetFontListAsync function in |
33 | // content/browser/font_list_async.h which does an asynchronous call. | ||||
[email protected] | ec810db | 2012-02-29 19:20:14 | [diff] [blame] | 34 | scoped_ptr<base::ListValue> GetFontList_SlowBlocking(); |
[email protected] | d259a8e | 2011-05-18 22:31:09 | [diff] [blame] | 35 | |
36 | } // namespace content | ||||
37 | |||||
38 | #endif // CONTENT_COMMON_FONT_LIST_H_ |