OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/plugins/ppapi/ppb_font_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_font_impl.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_font_dev.h" | 7 #include "ppapi/c/dev/ppb_font_dev.h" |
8 #include "ppapi/shared_impl/font_impl.h" | 8 #include "ppapi/shared_impl/font_impl.h" |
9 #include "ppapi/shared_impl/ppapi_preferences.h" | 9 #include "ppapi/shared_impl/ppapi_preferences.h" |
10 #include "ppapi/shared_impl/var.h" | 10 #include "ppapi/shared_impl/var.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 PPB_Font_Impl::~PPB_Font_Impl() { | 57 PPB_Font_Impl::~PPB_Font_Impl() { |
58 } | 58 } |
59 | 59 |
60 // static | 60 // static |
61 PP_Resource PPB_Font_Impl::Create(PluginInstance* instance, | 61 PP_Resource PPB_Font_Impl::Create(PluginInstance* instance, |
62 const PP_FontDescription_Dev& description) { | 62 const PP_FontDescription_Dev& description) { |
63 if (!::ppapi::FontImpl::IsPPFontDescriptionValid(description)) | 63 if (!::ppapi::FontImpl::IsPPFontDescriptionValid(description)) |
64 return 0; | 64 return 0; |
65 scoped_refptr<PPB_Font_Impl> font(new PPB_Font_Impl(instance, description)); | 65 return (new PPB_Font_Impl(instance, description))->GetReference(); |
66 return font->GetReference(); | |
67 } | 66 } |
68 | 67 |
69 ::ppapi::thunk::PPB_Font_API* PPB_Font_Impl::AsPPB_Font_API() { | 68 ::ppapi::thunk::PPB_Font_API* PPB_Font_Impl::AsPPB_Font_API() { |
70 return this; | 69 return this; |
71 } | 70 } |
72 | 71 |
73 PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description, | 72 PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description, |
74 PP_FontMetrics_Dev* metrics) { | 73 PP_FontMetrics_Dev* metrics) { |
75 std::string face; | 74 std::string face; |
76 PP_Bool result = PP_FALSE; | 75 PP_Bool result = PP_FALSE; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return this; | 151 return this; |
153 } | 152 } |
154 | 153 |
155 PP_Var PPB_Font_FunctionImpl::GetFontFamilies(PP_Instance instance) { | 154 PP_Var PPB_Font_FunctionImpl::GetFontFamilies(PP_Instance instance) { |
156 return PP_MakeUndefined(); | 155 return PP_MakeUndefined(); |
157 } | 156 } |
158 | 157 |
159 } // namespace ppapi | 158 } // namespace ppapi |
160 } // namespace webkit | 159 } // namespace webkit |
161 | 160 |
OLD | NEW |