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

Unified Diff: content/browser/renderer_host/pepper/pepper_truetype_font_host.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_host.h
diff --git a/content/renderer/pepper/pepper_truetype_font_host.h b/content/browser/renderer_host/pepper/pepper_truetype_font_host.h
similarity index 52%
rename from content/renderer/pepper/pepper_truetype_font_host.h
rename to content/browser/renderer_host/pepper/pepper_truetype_font_host.h
index 27ff397222b56935a5a66b9f6c91790dcad353b3..ea85616089e733b3006b73d37a060c87af8e1c73 100644
--- a/content/renderer/pepper/pepper_truetype_font_host.h
+++ b/content/browser/renderer_host/pepper/pepper_truetype_font_host.h
@@ -2,23 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
-#define CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
+#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
+#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
+
+#include <string>
+#include <vector>
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "content/browser/renderer_host/pepper/pepper_truetype_font.h"
#include "content/common/content_export.h"
-#include "content/renderer/pepper/pepper_truetype_font.h"
+#include "ppapi/host/host_message_context.h"
#include "ppapi/host/resource_host.h"
namespace content {
-class RendererPpapiHost;
+class BrowserPpapiHost;
class CONTENT_EXPORT PepperTrueTypeFontHost : public ppapi::host::ResourceHost {
public:
- PepperTrueTypeFontHost(RendererPpapiHost* host,
+ PepperTrueTypeFontHost(BrowserPpapiHost* host,
PP_Instance instance,
PP_Resource resource,
const ppapi::proxy::SerializedTrueTypeFontDesc& desc);
@@ -30,15 +34,25 @@ class CONTENT_EXPORT PepperTrueTypeFontHost : public ppapi::host::ResourceHost {
ppapi::host::HostMessageContext* context) OVERRIDE;
private:
- int32_t OnHostMsgDescribe(ppapi::host::HostMessageContext* context);
int32_t OnHostMsgGetTableTags(ppapi::host::HostMessageContext* context);
int32_t OnHostMsgGetTable(ppapi::host::HostMessageContext* context,
uint32_t table,
int32_t offset,
int32_t max_data_length);
- RendererPpapiHost* renderer_ppapi_host_;
- scoped_ptr<PepperTrueTypeFont> font_;
+ void OnInitializeComplete(ppapi::proxy::SerializedTrueTypeFontDesc* desc,
+ int32_t result);
+ void OnGetTableTagsComplete(std::vector<uint32_t>* tags,
+ ppapi::host::ReplyMessageContext reply_context,
+ int32_t result);
+ void OnGetTableComplete(std::string* data,
+ ppapi::host::ReplyMessageContext reply_context,
+ int32_t result);
+
+ // This is created and used on a blocking pool thread. It will be NULL until
+ // our call to PepperTrueTypeFont::Create completes.
+ scoped_refptr<PepperTrueTypeFont> font_;
+ bool create_completed_;
base::WeakPtrFactory<PepperTrueTypeFontHost> weak_factory_;
@@ -47,4 +61,4 @@ class CONTENT_EXPORT PepperTrueTypeFontHost : public ppapi::host::ResourceHost {
} // namespace content
-#endif // CONTENT_RENDERER_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
+#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698