Index: content/common/mac/font_loader.h |
diff --git a/content/common/mac/font_loader.h b/content/common/mac/font_loader.h |
index 0b6441746b505899eb701c3c7a3ed5b6d7783ac9..bf73e159bd8cd7392d46dee43476dae006d468d1 100644 |
--- a/content/common/mac/font_loader.h |
+++ b/content/common/mac/font_loader.h |
@@ -17,6 +17,8 @@ |
class NSFont; |
#endif |
+struct FontDescriptor; |
+ |
// Provides functionality to transmit fonts over IPC. |
// |
// Note about font formats: .dfont (datafork suitcase) fonts are currently not |
@@ -25,20 +27,23 @@ class NSFont; |
class FontLoader { |
public: |
- // Load a font specified by |font_to_encode| into a shared memory buffer |
- // suitable for sending over IPC. |
+ struct Result { |
jeremy
2012/04/04 08:35:38
can you add a comment here describing what the str
bashi
2012/04/04 09:36:22
Done.
|
+ uint32 font_data_size; |
+ base::SharedMemory font_data; |
+ uint32 font_id; |
+ }; |
+ // Load a font specified by |font| into a shared memory buffer suitable for |
+ // sending over IPC. |
// |
// On return: |
- // returns true on success, false on failure. |
- // |font_data| - shared memory buffer containing the raw data for the font |
- // file. |
- // |font_data_size| - size of data contained in |font_data|. |
- // |font_id| - unique identifier for the on-disk file we load for the font. |
+ // |result->font_data| - shared memory buffer containing the raw data for |
+ // the font file. |
jeremy
2012/04/04 08:35:38
Can you add a comment as to what to expect in this
bashi
2012/04/04 09:36:22
The buffer won't be valid on failure. Added descri
|
+ // |result->font_data_size| - size of data contained in |result->font_data|. |
+ // This value is zero on failure. |
+ // |result->font_id| - unique identifier for the on-disk file we load for |
+ // the font. This value is zero on failure. |
CONTENT_EXPORT |
- static bool LoadFontIntoBuffer(NSFont* font_to_encode, |
- base::SharedMemory* font_data, |
- uint32* font_data_size, |
- uint32* font_id); |
+ static void LoadFont(const FontDescriptor& font, FontLoader::Result* result); |
// Given a shared memory buffer containing the raw data for a font file, load |
// the font and return a CGFontRef. |