| Index: webkit/glue/cpp_variant.cc
|
| ===================================================================
|
| --- webkit/glue/cpp_variant.cc (revision 30898)
|
| +++ webkit/glue/cpp_variant.cc (working copy)
|
| @@ -210,7 +210,6 @@
|
| }
|
|
|
| std::vector<std::wstring> CppVariant::ToStringVector() const {
|
| -
|
| DCHECK(isObject());
|
| std::vector<std::wstring> wstring_vector;
|
| NPObject* np_value = value.objectValue;
|
| @@ -235,7 +234,8 @@
|
| NPIdentifier index_id = WebBindings::getStringIdentifier(index.c_str());
|
| if (WebBindings::hasProperty(NULL, np_value, index_id)) {
|
| NPVariant index_value;
|
| - if (WebBindings::getProperty(NULL, np_value, index_id, &index_value)) {
|
| + if (WebBindings::getProperty(NULL, np_value, index_id,
|
| + &index_value)) {
|
| if (NPVARIANT_IS_STRING(index_value)) {
|
| std::string string(
|
| NPVARIANT_TO_STRING(index_value).UTF8Characters,
|
| @@ -252,16 +252,33 @@
|
| }
|
|
|
| bool CppVariant::Invoke(const std::string& method, const CppVariant* args,
|
| - uint32 arg_count, CppVariant& result) const {
|
| + uint32 arg_count, CppVariant* result) const {
|
| DCHECK(isObject());
|
| NPIdentifier method_name = WebBindings::getStringIdentifier(method.c_str());
|
| NPObject* np_object = value.objectValue;
|
| if (WebBindings::hasMethod(NULL, np_object, method_name)) {
|
| NPVariant r;
|
| - bool status = WebBindings::invoke(NULL, np_object, method_name, args, arg_count, &r);
|
| - result.Set(r);
|
| + bool status = WebBindings::invoke(NULL, np_object, method_name, args,
|
| + arg_count, &r);
|
| + result->Set(r);
|
| return status;
|
| } else {
|
| return false;
|
| }
|
| }
|
| +
|
| +bool CppVariant::GetProperty(const std::string& property,
|
| + CppVariant* result) const {
|
| + DCHECK(isObject());
|
| + NPIdentifier property_name =
|
| + WebBindings::getStringIdentifier(property.c_str());
|
| + NPObject* np_object = value.objectValue;
|
| + if (WebBindings::hasProperty(NULL, np_object, property_name)) {
|
| + NPVariant r;
|
| + bool status = WebBindings::getProperty(NULL, np_object, property_name, &r);
|
| + result->Set(r);
|
| + return status;
|
| + } else {
|
| + return false;
|
| + }
|
| +}
|
|
|