| Index: ppapi/cpp/dev/truetype_font_dev.cc
|
| diff --git a/ppapi/cpp/dev/truetype_font_dev.cc b/ppapi/cpp/dev/truetype_font_dev.cc
|
| index 3de81fd4ca56ba302e42696f547a8bbd8e0572d0..b10348a0c730d2ca4d193250e8fb8c8867bedbdc 100644
|
| --- a/ppapi/cpp/dev/truetype_font_dev.cc
|
| +++ b/ppapi/cpp/dev/truetype_font_dev.cc
|
| @@ -4,7 +4,6 @@
|
|
|
| #include "ppapi/cpp/dev/truetype_font_dev.h"
|
|
|
| -#include <stdio.h>
|
| #include <string.h> // memcpy
|
|
|
| #include "ppapi/c/dev/ppb_truetype_font_dev.h"
|
| @@ -41,7 +40,7 @@ TrueTypeFontDesc_Dev::TrueTypeFontDesc_Dev(
|
| PassRef,
|
| const PP_TrueTypeFontDesc_Dev& pp_desc) {
|
| desc_ = pp_desc;
|
| - family_ = Var(PASS_REF, pp_desc.family);
|
| + set_family(Var(PASS_REF, pp_desc.family));
|
| }
|
|
|
| TrueTypeFontDesc_Dev::TrueTypeFontDesc_Dev(const TrueTypeFontDesc_Dev& other) {
|
| @@ -61,12 +60,12 @@ TrueTypeFontDesc_Dev& TrueTypeFontDesc_Dev::operator=(
|
| if (this == &other)
|
| return *this;
|
|
|
| - desc_ = other.desc_;
|
| - // Be careful about the refcount of the string, the assignment above doesn't
|
| - // copy a ref. The assignments below take a ref to the new name and copy the
|
| - // PP_Var into the wrapped descriptor.
|
| - family_ = other.family();
|
| - desc_.family = family_.pp_var();
|
| + set_family(other.family());
|
| + set_generic_family(other.generic_family());
|
| + set_style(other.style());
|
| + set_weight(other.weight());
|
| + set_width(other.width());
|
| + set_charset(other.charset());
|
|
|
| return *this;
|
| }
|
| @@ -104,6 +103,21 @@ int32_t TrueTypeFont_Dev::GetFontFamilies(
|
| return cc.MayForce(PP_ERROR_NOINTERFACE);
|
| }
|
|
|
| +// static
|
| +int32_t TrueTypeFont_Dev::GetFontsInFamily(
|
| + const InstanceHandle& instance,
|
| + const Var& family,
|
| + const CompletionCallbackWithOutput<std::vector<TrueTypeFontDesc_Dev> >& cc)
|
| + {
|
| + if (has_interface<PPB_TrueTypeFont_Dev_0_1>()) {
|
| + return get_interface<PPB_TrueTypeFont_Dev_0_1>()->GetFontsInFamily(
|
| + instance.pp_instance(),
|
| + family.pp_var(),
|
| + cc.output(), cc.pp_completion_callback());
|
| + }
|
| + return cc.MayForce(PP_ERROR_NOINTERFACE);
|
| +}
|
| +
|
| int32_t TrueTypeFont_Dev::Describe(
|
| const CompletionCallbackWithOutput<TrueTypeFontDesc_Dev>& cc) {
|
| if (has_interface<PPB_TrueTypeFont_Dev_0_1>()) {
|
|
|