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

Unified Diff: ppapi/proxy/serialized_structs.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/serialized_structs.h ('k') | ppapi/shared_impl/api_id.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/serialized_structs.cc
diff --git a/ppapi/proxy/serialized_structs.cc b/ppapi/proxy/serialized_structs.cc
index c647ed17f6f466b49368f4c288f985a7883b9c90..6622d4a4564a168c3b1b9cb14872d2ceca12b080 100644
--- a/ppapi/proxy/serialized_structs.cc
+++ b/ppapi/proxy/serialized_structs.cc
@@ -8,6 +8,7 @@
#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/c/pp_file_info.h"
#include "ppapi/c/pp_rect.h"
+#include "ppapi/shared_impl/var.h"
namespace ppapi {
namespace proxy {
@@ -26,13 +27,9 @@ SerializedFontDescription::SerializedFontDescription()
SerializedFontDescription::~SerializedFontDescription() {}
void SerializedFontDescription::SetFromPPFontDescription(
- Dispatcher* dispatcher,
- const PP_FontDescription_Dev& desc,
- bool source_owns_ref) {
- if (source_owns_ref)
- face = SerializedVarSendInput(dispatcher, desc.face);
- else
- SerializedVarReturnValue(&face).Return(dispatcher, desc.face);
+ const PP_FontDescription_Dev& desc) {
+ StringVar* string_var = StringVar::FromPPVar(desc.face);
+ face = string_var ? string_var->value() : std::string();
family = desc.family;
size = desc.size;
@@ -44,17 +41,8 @@ void SerializedFontDescription::SetFromPPFontDescription(
}
void SerializedFontDescription::SetToPPFontDescription(
- Dispatcher* dispatcher,
- PP_FontDescription_Dev* desc,
- bool dest_owns_ref) const {
- if (dest_owns_ref) {
- ReceiveSerializedVarReturnValue face_return_value;
- *static_cast<SerializedVar*>(&face_return_value) = face;
- desc->face = face_return_value.Return(dispatcher);
- } else {
- desc->face = SerializedVarReceiveInput(face).Get(dispatcher);
- }
-
+ PP_FontDescription_Dev* desc) const {
+ desc->face = StringVar::StringToPPVar(face);
desc->family = static_cast<PP_FontFamily_Dev>(family);
desc->size = size;
desc->weight = static_cast<PP_FontWeight_Dev>(weight);
« no previous file with comments | « ppapi/proxy/serialized_structs.h ('k') | ppapi/shared_impl/api_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698