- Timestamp:
- Sep 24, 2014, 9:34:21 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/icedtea-web/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc
r418 r429 83 83 } 84 84 85 printf("Error on Java side: %s\n", result->error_msg->c_str());85 PLUGIN_ERROR("Error on Java side: %s\n", result->error_msg->c_str()); 86 86 87 87 result->error_occurred = true; … … 136 136 { 137 137 138 if (!message_parts->at(5)->find("literalreturn") )138 if (!message_parts->at(5)->find("literalreturn") || !message_parts->at(5)->find("jsobject")) 139 139 { 140 140 // literal returns don't have a corresponding jni id … … 768 768 std::vector<std::string> args) 769 769 { 770 JavaRequestProcessor* java_request; 771 std::string message = std::string(); 772 std::string* signature; 773 774 signature = new std::string(); 775 *signature += "("; 770 std::string message, signature = "("; 776 771 777 772 // FIXME: Need to determine how to extract array types and complex java objects 778 773 for (int i=0; i < args.size(); i++) 779 774 { 780 *signature += args[i];775 signature += args[i]; 781 776 } 782 777 783 *signature += ")";778 signature += ")"; 784 779 785 780 this->instance = 0; // context is always 0 (needed for java-side backwards compat.) … … 787 782 788 783 IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); 789 message += " GetMethodID "; 790 message += classID; 791 message += " "; 792 message += browser_functions.utf8fromidentifier(methodName); 793 message += " "; 794 message += *signature; 784 message += " GetMethodID " + classID + " "; 785 message += IcedTeaPluginUtilities::NPIdentifierAsString(methodName) + " "; 786 message += signature; 795 787 796 788 postAndWaitForResponse(message); 797 789 798 790 IcedTeaPluginUtilities::releaseReference(); 799 delete signature;800 791 801 792 return result; … … 806 797 std::vector<std::string> args) 807 798 { 808 JavaRequestProcessor* java_request; 809 std::string message = std::string(); 810 std::string* signature; 811 812 signature = new std::string(); 813 *signature += "("; 799 std::string message, signature = "("; 814 800 815 801 // FIXME: Need to determine how to extract array types and complex java objects 816 802 for (int i=0; i < args.size(); i++) 817 803 { 818 *signature += args[i];804 signature += args[i]; 819 805 } 820 806 821 *signature += ")";807 signature += ")"; 822 808 823 809 this->instance = 0; // context is always 0 (needed for java-side backwards compat.) … … 825 811 826 812 IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); 827 message += " GetStaticMethodID "; 828 message += classID; 829 message += " "; 830 message += browser_functions.utf8fromidentifier(methodName); 831 message += " "; 832 message += *signature; 833 834 postAndWaitForResponse(message); 835 836 IcedTeaPluginUtilities::releaseReference(); 837 delete signature; 813 message += " GetStaticMethodID " + classID + " "; 814 message += IcedTeaPluginUtilities::NPIdentifierAsString(methodName) + " "; 815 message += signature; 816 817 postAndWaitForResponse(message); 818 819 IcedTeaPluginUtilities::releaseReference(); 838 820 839 821 return result; … … 982 964 983 965 if (java_result->error_occurred) { 984 printf("Unable to create array\n");966 PLUGIN_ERROR("Unable to create array\n"); 985 967 id->append("-1"); 986 968 return; … … 1001 983 1002 984 if (value_id == "-1") { 1003 printf("Unable to populate array\n");985 PLUGIN_ERROR("Unable to populate array\n"); 1004 986 id->clear(); 1005 987 id->append("-1"); … … 1037 1019 if (java_result->error_occurred) 1038 1020 { 1039 printf("Unable to get JSObject class id\n");1021 PLUGIN_ERROR("Unable to get JSObject class id\n"); 1040 1022 id->clear(); 1041 1023 id->append("-1"); … … 1053 1035 if (java_result->error_occurred) 1054 1036 { 1055 printf("Unable to get JSObject constructor id\n");1037 PLUGIN_ERROR("Unable to get JSObject constructor id\n"); 1056 1038 id->clear(); 1057 1039 id->append("-1"); … … 1077 1059 if (java_result->error_occurred) 1078 1060 { 1079 printf("Unable to create JSObject\n");1061 PLUGIN_ERROR("Unable to create JSObject\n"); 1080 1062 id->clear(); 1081 1063 id->append("-1"); … … 1094 1076 // the result we want is in result_string (assuming there was no error) 1095 1077 if (java_result->error_occurred) { 1096 printf("Unable to find classid for %s\n", className.c_str());1078 PLUGIN_ERROR("Unable to find classid for %s\n", className.c_str()); 1097 1079 id->append("-1"); 1098 1080 return; … … 1109 1091 // the result we want is in result_string (assuming there was no error) 1110 1092 if (java_result->error_occurred) { 1111 printf("Unable to find string constructor for %s\n", className.c_str());1093 PLUGIN_ERROR("Unable to find string constructor for %s\n", className.c_str()); 1112 1094 id->append("-1"); 1113 1095 return; … … 1121 1103 1122 1104 if (java_result->error_occurred) { 1123 printf("Unable to create requested object\n");1105 PLUGIN_ERROR("Unable to create requested object\n"); 1124 1106 id->append("-1"); 1125 1107 return; … … 1134 1116 1135 1117 if (java_result->error_occurred) { 1136 printf("Unable to create requested object\n");1118 PLUGIN_ERROR("Unable to create requested object\n"); 1137 1119 id->append("-1"); 1138 1120 return; … … 1314 1296 JavaResultData* java_result; 1315 1297 JavaRequestProcessor* java_request = new JavaRequestProcessor(); 1316 std::string message = std::string();1317 1298 std::string plugin_instance_id_str = std::string(); 1318 1299 IcedTeaPluginUtilities::itoa(plugin_instance_id, &plugin_instance_id_str); … … 1323 1304 this->reference = IcedTeaPluginUtilities::getReference(); 1324 1305 1306 std::string message; 1325 1307 IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); 1326 message.append(" HasPackage "); 1327 message.append(plugin_instance_id_str); 1328 message.append(" "); 1329 message.append(java_result->return_string->c_str()); 1308 message += " HasPackage " + plugin_instance_id_str + " " + *java_result->return_string; 1330 1309 1331 1310 postAndWaitForResponse(message);
Note:
See TracChangeset
for help on using the changeset viewer.