Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ | 5 #ifndef CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ |
| 6 #define CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ | 6 #define CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ |
| 7 | 7 |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| 11 struct IDWriteFactory; | 11 struct IDWriteFactory; |
| 12 struct IDWriteFontCollection; | 12 struct IDWriteFontCollection; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 // This is the shared section that is used between browser and renderer for | |
| 17 // loading font cache. Section name is suffixed with browser process id so that | |
| 18 // multiple instance chrome scenario works fine. | |
| 19 CONTENT_EXPORT extern const char kFontCacheSharedSectionName[]; | |
| 20 | |
| 16 // Function returns custom font collection in terms of IDWriteFontCollection. | 21 // Function returns custom font collection in terms of IDWriteFontCollection. |
| 17 // This function maintains singleton instance of font collection and returns | 22 // This function maintains singleton instance of font collection and returns |
| 18 // it on repeated calls. | 23 // it on repeated calls. |
| 19 CONTENT_EXPORT IDWriteFontCollection* GetCustomFontCollection( | 24 CONTENT_EXPORT IDWriteFontCollection* GetCustomFontCollection( |
| 20 IDWriteFactory* factory); | 25 IDWriteFactory* factory); |
| 21 | 26 |
| 22 // Build and load is to accomplish both tasks of creating a font cache within | 27 // Build and load is to accomplish both tasks of creating a font cache within |
|
scottmg
2014/11/13 07:35:30
this comment seems out of date with the changed na
Shrikant Kelkar
2014/11/13 20:29:21
Done.
| |
| 23 // specified file and then loading it, where loading means creating | 28 // specified file and then loading it, where loading means creating |
| 24 // readonly shared memory mapping. As this function need to iterate through all | 29 // readonly shared memory mapping. As this function need to iterate through all |
| 25 // available fonts in the system, it may take a while. | 30 // available fonts in the system, it may take a while. |
| 26 CONTENT_EXPORT bool BuildAndLoadFontCache(const base::FilePath& file); | 31 CONTENT_EXPORT bool BuildFontCache(const base::FilePath& file); |
| 27 | 32 |
| 28 // Loads font cache from file. This is supposed to be used from browser | 33 // Loads font cache from file. This is supposed to be used from browser |
| 29 // side where loading means creating readonly shared memory file mapping so that | 34 // side where loading means creating readonly shared memory file mapping so that |
| 30 // renderers can read from it. | 35 // renderers can read from it. |
| 31 CONTENT_EXPORT bool LoadFontCache(const base::FilePath& path); | 36 CONTENT_EXPORT bool LoadFontCache(const base::FilePath& path); |
| 32 | 37 |
| 33 // Added in header mainly for unittest | 38 // Added in header mainly for unittest |
| 34 CONTENT_EXPORT bool ValidateFontCacheFile(base::File* file); | 39 CONTENT_EXPORT bool ValidateFontCacheFile(base::File* file); |
| 35 | 40 |
| 36 } // namespace content | 41 } // namespace content |
| 37 | 42 |
| 38 #endif // CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ | 43 #endif // CONTENT_COMMON_DWRITE_FONT_PLATFORM_WIN_H_ |
| OLD | NEW |