diff options
Diffstat (limited to 'plugin/icedteanp/IcedTeaJavaRequestProcessor.cc')
-rw-r--r-- | plugin/icedteanp/IcedTeaJavaRequestProcessor.cc | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc index 7529f5a..f7b7332 100644 --- a/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc +++ b/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc @@ -751,36 +751,27 @@ JavaResultData* JavaRequestProcessor::getMethodID(std::string classID, NPIdentifier methodName, std::vector<std::string> args) { - JavaRequestProcessor* java_request; - std::string message = std::string(); - std::string* signature; - - signature = new std::string(); - *signature += "("; + std::string message, signature = "("; // FIXME: Need to determine how to extract array types and complex java objects for (int i=0; i < args.size(); i++) { - *signature += args[i]; + signature += args[i]; } - *signature += ")"; + signature += ")"; this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); - message += " GetMethodID "; - message += classID; - message += " "; - message += browser_functions.utf8fromidentifier(methodName); - message += " "; - message += *signature; + message += " GetMethodID " + classID + " "; + message += IcedTeaPluginUtilities::NPIdentifierAsString(methodName) + " "; + message += signature; postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); - delete signature; return result; } @@ -789,36 +780,27 @@ JavaResultData* JavaRequestProcessor::getStaticMethodID(std::string classID, NPIdentifier methodName, std::vector<std::string> args) { - JavaRequestProcessor* java_request; - std::string message = std::string(); - std::string* signature; - - signature = new std::string(); - *signature += "("; + std::string message, signature = "("; // FIXME: Need to determine how to extract array types and complex java objects for (int i=0; i < args.size(); i++) { - *signature += args[i]; + signature += args[i]; } - *signature += ")"; + signature += ")"; this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); - message += " GetStaticMethodID "; - message += classID; - message += " "; - message += browser_functions.utf8fromidentifier(methodName); - message += " "; - message += *signature; + message += " GetStaticMethodID " + classID + " "; + message += IcedTeaPluginUtilities::NPIdentifierAsString(methodName) + " "; + message += signature; postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); - delete signature; return result; } |