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

Unified Diff: ppapi/proxy/resource_creation_proxy.cc

Issue 11316161: Refactor BrowserFont to new design (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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: ppapi/proxy/resource_creation_proxy.cc
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
index bb103c3ce6e07c413786c3a6f5e32f26c7e15b2b..2ad19d35e16e0c4db2a834d223c3dcd48224d1b3 100644
--- a/ppapi/proxy/resource_creation_proxy.cc
+++ b/ppapi/proxy/resource_creation_proxy.cc
@@ -8,6 +8,7 @@
#include "ppapi/c/pp_size.h"
#include "ppapi/c/trusted/ppb_image_data_trusted.h"
#include "ppapi/proxy/audio_input_resource.h"
+#include "ppapi/proxy/browser_font_resource_trusted.h"
#include "ppapi/proxy/connection.h"
#include "ppapi/proxy/file_chooser_resource.h"
#include "ppapi/proxy/flash_device_id_resource.h"
@@ -47,7 +48,6 @@
#include "ppapi/shared_impl/ppb_audio_config_shared.h"
#include "ppapi/shared_impl/ppb_input_event_shared.h"
#include "ppapi/shared_impl/ppb_resource_array_shared.h"
-#include "ppapi/shared_impl/private/ppb_browser_font_trusted_shared.h"
#include "ppapi/shared_impl/var.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_image_data_api.h"
@@ -293,8 +293,14 @@ PP_Resource ResourceCreationProxy::CreateBrowserFont(
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
if (!dispatcher)
return 0;
- return PPB_BrowserFont_Trusted_Shared::Create(
- OBJECT_IS_PROXY, instance, *description, dispatcher->preferences());
+ scoped_refptr<BrowserFontResource_Trusted> font(
+ new BrowserFontResource_Trusted(GetConnection(),
+ instance,
+ *description,
+ dispatcher->preferences()));
+ if (!BrowserFontResource_Trusted::IsPPFontDescriptionValid(*description))
brettw 2012/11/26 23:50:37 Also move this before creating the BrowserFontReso
victorhsieh 2012/11/27 03:00:50 Done.
+ return 0;
+ return font->GetReference();
}
PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance,

Powered by Google App Engine
This is Rietveld 408576698