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

Unified Diff: content/common/mac/font_loader.h

Issue 10052006: Merge 131324 - Mac: OOP font loading should run on FILE thread. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 8 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/render_message_filter.cc ('k') | content/common/mac/font_loader.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mac/font_loader.h
===================================================================
--- content/common/mac/font_loader.h (revision 131698)
+++ content/common/mac/font_loader.h (working copy)
@@ -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,27 @@
class FontLoader {
public:
- // Load a font specified by |font_to_encode| into a shared memory buffer
- // suitable for sending over IPC.
+ // This structure holds the result of LoadFont(). This structure is passed to
+ // LoadFont(), which should run on the file thread, then it is passed to a
+ // task which sends the result to the originating renderer.
+ struct Result {
+ 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. The buffer is only valid when both |result->font_data_size|
+ // and |result->font_id| are not zero.
+ // |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.
« no previous file with comments | « content/browser/renderer_host/render_message_filter.cc ('k') | content/common/mac/font_loader.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698