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

Unified Diff: content/browser/renderer_host/pepper/pepper_truetype_font.h

Issue 337203003: Move PPB_TrueTypeFont_Dev host from renderer to browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add scopers, fix builds. Created 6 years, 6 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
Index: content/browser/renderer_host/pepper/pepper_truetype_font.h
diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font.h b/content/browser/renderer_host/pepper/pepper_truetype_font.h
new file mode 100644
index 0000000000000000000000000000000000000000..80e08c396dcea383e5ee102c92f437ed887c092b
--- /dev/null
+++ b/content/browser/renderer_host/pepper/pepper_truetype_font.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_H_
+#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_H_
+
+#include <string>
+#include <vector>
+
+#include "base/memory/ref_counted.h"
+#include "ppapi/proxy/serialized_structs.h"
+
+namespace content {
+
+class PepperTrueTypeFont
+ : public base::RefCountedThreadSafe<PepperTrueTypeFont> {
+ public:
+ // Factory method to create a font for the current host.
+ static PepperTrueTypeFont* Create();
+
+ // Initializes the font. Updates the descriptor with the actual font's
+ // characteristics. The exact font will depend on the host platform's font
+ // matching and fallback algorithm. On failure, returns NULL and leaves desc
+ // unchanged.
+ // NOTE: This method may perform long blocking file IO.
+ virtual int32_t Initialize(
+ ppapi::proxy::SerializedTrueTypeFontDesc* desc) = 0;
+
+ // Retrieves an array of TrueType table tags contained in this font. Returns
+ // the number of tags on success, a Pepper error code on failure. 'tags' are
+ // written only on success.
+ // NOTE: This method may perform long blocking file IO.
+ virtual int32_t GetTableTags(std::vector<uint32_t>* tags) = 0;
+
+ // Gets a TrueType font table corresponding to the given tag. The 'offset' and
+ // 'max_data_length' parameters determine what part of the table is returned.
+ // Returns the data size in bytes on success, a Pepper error code on failure.
+ // 'data' is written only on success.
+ // NOTE: This method may perform long blocking file IO.
+ virtual int32_t GetTable(uint32_t table_tag,
+ int32_t offset,
+ int32_t max_data_length,
+ std::string* data) = 0;
+
+ protected:
+ friend class base::RefCountedThreadSafe<PepperTrueTypeFont>;
+ virtual ~PepperTrueTypeFont() {};
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_H_

Powered by Google App Engine
This is Rietveld 408576698