OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/ppb_var_deprecated_impl.h" | 5 #include "content/renderer/pepper/ppb_var_deprecated_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "content/renderer/pepper/common.h" | |
10 #include "content/renderer/pepper/host_globals.h" | 9 #include "content/renderer/pepper/host_globals.h" |
11 #include "content/renderer/pepper/npapi_glue.h" | 10 #include "content/renderer/pepper/npapi_glue.h" |
12 #include "content/renderer/pepper/npobject_var.h" | 11 #include "content/renderer/pepper/npobject_var.h" |
13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 12 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
14 #include "content/renderer/pepper/plugin_module.h" | 13 #include "content/renderer/pepper/plugin_module.h" |
15 #include "content/renderer/pepper/plugin_object.h" | 14 #include "content/renderer/pepper/plugin_object.h" |
16 #include "ppapi/c/dev/ppb_var_deprecated.h" | 15 #include "ppapi/c/dev/ppb_var_deprecated.h" |
17 #include "ppapi/c/ppb_var.h" | 16 #include "ppapi/c/ppb_var.h" |
18 #include "ppapi/c/pp_var.h" | 17 #include "ppapi/c/pp_var.h" |
19 #include "ppapi/shared_impl/ppb_var_shared.h" | 18 #include "ppapi/shared_impl/ppb_var_shared.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 private: | 156 private: |
158 NPIdentifier identifier_; | 157 NPIdentifier identifier_; |
159 | 158 |
160 DISALLOW_COPY_AND_ASSIGN(ObjectAccessorWithIdentifierTryCatch); | 159 DISALLOW_COPY_AND_ASSIGN(ObjectAccessorWithIdentifierTryCatch); |
161 }; | 160 }; |
162 | 161 |
163 PP_Bool HasProperty(PP_Var var, PP_Var name, PP_Var* exception) { | 162 PP_Bool HasProperty(PP_Var var, PP_Var name, PP_Var* exception) { |
164 ObjectAccessorWithIdentifierTryCatch accessor(var, name, exception); | 163 ObjectAccessorWithIdentifierTryCatch accessor(var, name, exception); |
165 if (accessor.has_exception()) | 164 if (accessor.has_exception()) |
166 return PP_FALSE; | 165 return PP_FALSE; |
167 return BoolToPPBool(WebBindings::hasProperty( | 166 return PP_FromBool(WebBindings::hasProperty( |
168 NULL, accessor.object()->np_object(), accessor.identifier())); | 167 NULL, accessor.object()->np_object(), accessor.identifier())); |
169 } | 168 } |
170 | 169 |
171 bool HasPropertyDeprecated(PP_Var var, PP_Var name, PP_Var* exception) { | 170 bool HasPropertyDeprecated(PP_Var var, PP_Var name, PP_Var* exception) { |
172 return PPBoolToBool(HasProperty(var, name, exception)); | 171 return PP_ToBool(HasProperty(var, name, exception)); |
173 } | 172 } |
174 | 173 |
175 bool HasMethodDeprecated(PP_Var var, PP_Var name, PP_Var* exception) { | 174 bool HasMethodDeprecated(PP_Var var, PP_Var name, PP_Var* exception) { |
176 ObjectAccessorWithIdentifierTryCatch accessor(var, name, exception); | 175 ObjectAccessorWithIdentifierTryCatch accessor(var, name, exception); |
177 if (accessor.has_exception()) | 176 if (accessor.has_exception()) |
178 return false; | 177 return false; |
179 return WebBindings::hasMethod( | 178 return WebBindings::hasMethod( |
180 NULL, accessor.object()->np_object(), accessor.identifier()); | 179 NULL, accessor.object()->np_object(), accessor.identifier()); |
181 } | 180 } |
182 | 181 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 &CallDeprecated, | 415 &CallDeprecated, |
417 &Construct, | 416 &Construct, |
418 &IsInstanceOfDeprecated, | 417 &IsInstanceOfDeprecated, |
419 &CreateObjectDeprecated, | 418 &CreateObjectDeprecated, |
420 &CreateObjectWithModuleDeprecated, }; | 419 &CreateObjectWithModuleDeprecated, }; |
421 | 420 |
422 return &var_deprecated_interface; | 421 return &var_deprecated_interface; |
423 } | 422 } |
424 | 423 |
425 } // namespace content | 424 } // namespace content |
OLD | NEW |