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

Unified Diff: webkit/glue/cpp_variant.cc

Issue 360006: Implementation of PlainTextController.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « webkit/glue/cpp_variant.h ('k') | webkit/tools/test_shell/plain_text_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ }
+}
« no previous file with comments | « webkit/glue/cpp_variant.h ('k') | webkit/tools/test_shell/plain_text_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698