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

Unified Diff: ppapi/proxy/ppb_pdf_proxy.cc

Issue 10905227: Introduce PPB_Flash_Font. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 | « ppapi/proxy/ppb_flash_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_pdf_proxy.cc
diff --git a/ppapi/proxy/ppb_pdf_proxy.cc b/ppapi/proxy/ppb_pdf_proxy.cc
index aee308f38a885ae8539ee9b206346adf5c55aa9a..e06b806c048793694a5f47b285b0306bb9435f6f 100644
--- a/ppapi/proxy/ppb_pdf_proxy.cc
+++ b/ppapi/proxy/ppb_pdf_proxy.cc
@@ -15,6 +15,9 @@
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
+#include "ppapi/shared_impl/proxy_lock.h"
+#include "ppapi/shared_impl/var_tracker.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_pdf_api.h"
@@ -67,12 +70,14 @@ PP_Resource GetFontFileWithFallback(
PP_Instance instance,
const PP_FontDescription_Dev* description,
PP_PrivateFontCharset charset) {
+ ProxyAutoLock lock;
+
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
if (!dispatcher)
return 0;
SerializedFontDescription desc;
- desc.SetFromPPFontDescription(dispatcher, *description, true);
+ desc.SetFromPPFontDescription(*description);
HostResource result;
dispatcher->Send(new PpapiHostMsg_PPBPDF_GetFontFileWithFallback(
@@ -168,10 +173,13 @@ void PPB_PDF_Proxy::OnMsgGetFontFileWithFallback(
int32_t charset,
HostResource* result) {
PP_FontDescription_Dev desc;
- in_desc.SetToPPFontDescription(dispatcher(), &desc, false);
+ in_desc.SetToPPFontDescription(&desc);
result->SetHostResource(instance,
ppb_pdf_impl_->GetFontFileWithFallback(
instance, &desc, static_cast<PP_PrivateFontCharset>(charset)));
+
+ // SetToPPFontDescription() creates a var which is owned by the caller.
+ PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(desc.face);
}
void PPB_PDF_Proxy::OnMsgGetFontTableForPrivateFontFile(
« no previous file with comments | « ppapi/proxy/ppb_flash_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698