Ignore:
Timestamp:
Feb 11, 2013, 8:53:47 PM (13 years ago)
Author:
dmik
Message:

Merge icedtea-web v1.3 to trunk.

Location:
trunk/icedtea-web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/icedtea-web

  • trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc

    r394 r418  
    108108#define PLUGIN_FULL_NAME PLUGIN_NAME " (using " PLUGIN_VERSION ")"
    109109#define PLUGIN_DESC "The <a href=\"" PACKAGE_URL "\">" PLUGIN_NAME "</a> executes Java applets."
     110
     111#ifdef HAVE_JAVA7
     112 #define JPI_VERSION "1.7.0_" JDK_UPDATE_VERSION
     113 #define PLUGIN_APPLET_MIME_DESC7 \
     114  "application/x-java-applet;version=1.7:class,jar:IcedTea;"
     115 #define PLUGIN_BEAN_MIME_DESC7 \
     116  "application/x-java-bean;version=1.7:class,jar:IcedTea;"
     117#else
     118 #define JPI_VERSION "1.6.0_" JDK_UPDATE_VERSION
     119 #define PLUGIN_APPLET_MIME_DESC7
     120 #define PLUGIN_BEAN_MIME_DESC7
     121#endif
    110122
    111123#define PLUGIN_MIME_DESC                                               \
     
    126138  "application/x-java-applet;version=1.5:class,jar:IcedTea;"           \
    127139  "application/x-java-applet;version=1.6:class,jar:IcedTea;"           \
    128   "application/x-java-applet;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"  \
     140  PLUGIN_APPLET_MIME_DESC7 \
     141  "application/x-java-applet;jpi-version=" JPI_VERSION ":class,jar:IcedTea;"  \
    129142  "application/x-java-bean:class,jar:IcedTea;"                         \
    130143  "application/x-java-bean;version=1.1:class,jar:IcedTea;"             \
     
    142155  "application/x-java-bean;version=1.5:class,jar:IcedTea;"             \
    143156  "application/x-java-bean;version=1.6:class,jar:IcedTea;"             \
    144   "application/x-java-bean;jpi-version=1.6.0_" JDK_UPDATE_VERSION ":class,jar:IcedTea;"    \
     157  PLUGIN_BEAN_MIME_DESC7 \
     158  "application/x-java-bean;jpi-version=" JPI_VERSION ":class,jar:IcedTea;"    \
    145159  "application/x-java-vm-npruntime::IcedTea;"
    146160
     
    280294pthread_cond_t cond_message_available = PTHREAD_COND_INITIALIZER;
    281295
     296
     297#ifdef LEGACY_GLIB
     298// Returns key from first item stored in hashtable
     299gboolean
     300find_first_item_in_hash_table(gpointer key, gpointer value, gpointer user_data)
     301{
     302    user_data = key;
     303    return (gboolean)TRUE;
     304}
     305
     306int
     307g_strcmp0(char *str1, char *str2)
     308{
     309   if (str1 != NULL)
     310     return str2 != NULL ? strcmp(str1, str2) : 1;
     311   else // str1 == NULL
     312     return str2 != NULL ? 1 : 0;
     313}
     314
     315
     316#endif
     317
     318
     319/*
     320 * Find first member in GHashTable* depending on version of glib
     321 */
     322gpointer getFirstInTableInstance(GHashTable* table)
     323{
     324      gpointer id, instance;
     325      #ifndef LEGACY_GLIB
     326        GHashTableIter iter;
     327        g_hash_table_iter_init (&iter, table);
     328        g_hash_table_iter_next (&iter, &instance, &id);
     329      #else
     330        g_hash_table_find(table, (GHRFunc)find_first_item_in_hash_table, &instance);
     331      #endif
     332        return instance;
     333}
     334
    282335// Functions prefixed by ITNP_ are instance functions.  They are called
    283336// by the browser and operate on instances of ITNPPluginData.
     
    405458
    406459 cleanup_appletviewer_mutex:
    407   g_free (data->appletviewer_mutex);
     460  g_mutex_free (data->appletviewer_mutex);
    408461  data->appletviewer_mutex = NULL;
    409462
     
    9651018get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len)
    9661019{
     1020  // Only attempt to perform this operation if there is a valid plugin instance
     1021  if (g_hash_table_size(instance_to_id_map) <= 0)
     1022  {
     1023    return NPERR_GENERIC_ERROR;
     1024  }
    9671025#if MOZILLA_VERSION_COLLAPSED < 1090100
    9681026  nsresult rv;
     
    10081066  if (browser_functions.getvalueforurl)
    10091067  {
    1010       GHashTableIter iter;
    1011       gpointer id, instance;
    1012 
    1013       g_hash_table_iter_init (&iter, instance_to_id_map);
    1014       g_hash_table_iter_next (&iter, &instance, &id);
    1015 
     1068      gpointer instance=getFirstInTableInstance(instance_to_id_map);
    10161069      return browser_functions.getvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len);
    10171070  } else
     
    10231076
    10241077  return NPERR_NO_ERROR;
     1078}
     1079
     1080static NPError
     1081set_cookie_info(const char* siteAddr, const char* cookieString, uint32_t len)
     1082{
     1083  // Only attempt to perform this operation if there is a valid plugin instance
     1084  if (g_hash_table_size(instance_to_id_map) > 0 && browser_functions.getvalueforurl)
     1085  {
     1086      // We arbitrarily use the first valid instance we can grab
     1087      // For an explanation of the logic behind this, see get_cookie_info
     1088      gpointer instance = getFirstInTableInstance(instance_to_id_map);
     1089      return browser_functions.setvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len);
     1090  }
     1091
     1092  return NPERR_GENERIC_ERROR;;
    10251093}
    10261094
     
    11381206                               href_id, &href);
    11391207
    1140   // Strip everything after the last "/"
    1141 #if MOZILLA_VERSION_COLLAPSED < 1090200
    1142   gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).utf8characters, "/", -1);
    1143 #else
    1144   gchar** parts = g_strsplit (NPVARIANT_TO_STRING(href).UTF8Characters, "/", -1);
    1145 #endif
    1146   guint parts_sz = g_strv_length (parts);
    1147 
    1148   std::string location_str;
    1149   for (int i=0; i < parts_sz - 1; i++)
    1150   {
    1151       location_str += parts[i];
    1152       location_str += "/";
    1153   }
    1154 
    1155   documentbase_copy = g_strdup (location_str.c_str());
     1208  std::string href_str = IcedTeaPluginUtilities::NPVariantAsString(href);
     1209  documentbase_copy = g_strdup (href_str.c_str());
    11561210
    11571211  // Release references.
     
    12581312}
    12591313
     1314static
     1315void consume_plugin_message(gchar* message) {
     1316  // internal plugin related message
     1317  gchar** parts = g_strsplit (message, " ", 5);
     1318  if (g_str_has_prefix(parts[1], "PluginProxyInfo"))
     1319  {
     1320    gchar* proxy;
     1321    uint32_t len;
     1322
     1323    gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar));
     1324    IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
     1325    PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
     1326
     1327    gchar* proxy_info;
     1328
     1329#if MOZILLA_VERSION_COLLAPSED < 1090100
     1330        proxy = (char*) malloc(sizeof(char)*2048);
     1331#endif
     1332
     1333    proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", parts[3], " ", NULL);
     1334    if (get_proxy_info(decoded_url, &proxy, &len) == NPERR_NO_ERROR)
     1335      {
     1336        proxy_info = g_strconcat (proxy_info, proxy, NULL);
     1337      }
     1338
     1339    PLUGIN_DEBUG("Proxy info: %s\n", proxy_info);
     1340    plugin_send_message_to_appletviewer(proxy_info);
     1341
     1342    free(decoded_url);
     1343    decoded_url = NULL;
     1344    g_free(proxy_info);
     1345    proxy_info = NULL;
     1346
     1347#if MOZILLA_VERSION_COLLAPSED < 1090100
     1348        g_free(proxy);
     1349        proxy = NULL;
     1350#endif
     1351
     1352  } else if (g_str_has_prefix(parts[1], "PluginCookieInfo"))
     1353  {
     1354    gchar* decoded_url = (gchar*) calloc(strlen(parts[4])+1, sizeof(gchar));
     1355    IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
     1356
     1357    gchar* cookie_info = g_strconcat ("plugin PluginCookieInfo reference ", parts[3], " ", NULL);
     1358    gchar* cookie_string;
     1359    uint32_t len;
     1360    if (get_cookie_info(decoded_url, &cookie_string, &len) == NPERR_NO_ERROR)
     1361    {
     1362        cookie_info = g_strconcat (cookie_info, cookie_string, NULL);
     1363    }
     1364
     1365    PLUGIN_DEBUG("Cookie info: %s\n", cookie_info);
     1366    plugin_send_message_to_appletviewer(cookie_info);
     1367
     1368    free(decoded_url);
     1369    decoded_url = NULL;
     1370    g_free(cookie_info);
     1371    cookie_info = NULL;
     1372  } else if (g_str_has_prefix(parts[1], "PluginSetCookie"))
     1373  {
     1374    // Message structure: plugin PluginSetCookie reference -1 <url> <cookie>
     1375    gchar** cookie_parts = g_strsplit (message, " ", 6);
     1376
     1377    if (g_strv_length(cookie_parts) < 6)
     1378    {
     1379       g_strfreev (parts);
     1380       g_strfreev (cookie_parts);
     1381       return; // Defensive, message _should_ be properly formatted
     1382    }
     1383
     1384    gchar* decoded_url = (gchar*) calloc(strlen(cookie_parts[4])+1, sizeof(gchar));
     1385    IcedTeaPluginUtilities::decodeURL(cookie_parts[4], &decoded_url);
     1386
     1387    gchar* cookie_string = cookie_parts[5];
     1388    uint32_t len = strlen(cookie_string);
     1389    if (set_cookie_info(decoded_url, cookie_string, len) == NPERR_NO_ERROR)
     1390    {
     1391          PLUGIN_DEBUG("Setting cookie for URL %s to %s\n", decoded_url, cookie_string);
     1392    } else
     1393    {
     1394          PLUGIN_DEBUG("Not able to set cookie for URL %s to %s\n", decoded_url, cookie_string);
     1395    }
     1396
     1397    free(decoded_url);
     1398    decoded_url = NULL;
     1399    g_strfreev (cookie_parts);
     1400    cookie_parts = NULL;
     1401  }
     1402
     1403  g_strfreev (parts);
     1404  parts = NULL;
     1405}
     1406
    12601407void consume_message(gchar* message) {
    12611408
     
    12871434
    12881435          // clear the "instance X status" parts
    1289           sprintf(parts[0], "");
    1290           sprintf(parts[1], "");
    1291           sprintf(parts[2], "");
     1436          strcpy(parts[0], "");
     1437          strcpy(parts[1], "");
     1438          strcpy(parts[2], "");
    12921439
    12931440          // join the rest
     
    13201467  else if (g_str_has_prefix (message, "plugin "))
    13211468    {
    1322       // internal plugin related message
    1323       gchar** parts = g_strsplit (message, " ", 5);
    1324       if (g_str_has_prefix(parts[1], "PluginProxyInfo"))
    1325       {
    1326         gchar* proxy;
    1327         uint32_t len;
    1328 
    1329         gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar));
    1330         IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
    1331         PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url);
    1332 
    1333         gchar* proxy_info;
    1334 
    1335 #if MOZILLA_VERSION_COLLAPSED < 1090100
    1336         proxy = (char*) malloc(sizeof(char)*2048);
    1337 #endif
    1338 
    1339         proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", parts[3], " ", NULL);
    1340         if (get_proxy_info(decoded_url, &proxy, &len) == NPERR_NO_ERROR)
    1341           {
    1342             proxy_info = g_strconcat (proxy_info, proxy, NULL);
    1343           }
    1344 
    1345         PLUGIN_DEBUG("Proxy info: %s\n", proxy_info);
    1346         plugin_send_message_to_appletviewer(proxy_info);
    1347 
    1348         g_free(decoded_url);
    1349         decoded_url = NULL;
    1350         g_free(proxy_info);
    1351         proxy_info = NULL;
    1352 
    1353 #if MOZILLA_VERSION_COLLAPSED < 1090100
    1354         g_free(proxy);
    1355         proxy = NULL;
    1356 #endif
    1357 
    1358       } else if (g_str_has_prefix(parts[1], "PluginCookieInfo"))
    1359       {
    1360         gchar* decoded_url = (gchar*) calloc(strlen(parts[4])+1, sizeof(gchar));
    1361         IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
    1362 
    1363         gchar* cookie_info = g_strconcat ("plugin PluginCookieInfo reference ", parts[3], " ", NULL);
    1364         gchar* cookie_string;
    1365         uint32_t len;
    1366         if (get_cookie_info(decoded_url, &cookie_string, &len) == NPERR_NO_ERROR)
    1367         {
    1368             cookie_info = g_strconcat (cookie_info, cookie_string, NULL);
    1369         }
    1370 
    1371         PLUGIN_DEBUG("Cookie info: %s\n", cookie_info);
    1372         plugin_send_message_to_appletviewer(cookie_info);
    1373 
    1374         g_free(decoded_url);
    1375         decoded_url = NULL;
    1376         g_free(cookie_info);
    1377         cookie_info = NULL;
    1378       }
     1469        consume_plugin_message(message);
    13791470    }
    13801471  else
     
    13821473        g_print ("  Unable to handle message: %s\n", message);
    13831474    }
     1475
    13841476}
    13851477
     
    14011493get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len)
    14021494{
     1495  // Only attempt to perform this operation if there is a valid plugin instance
     1496  if (g_hash_table_size(instance_to_id_map) <= 0)
     1497  {
     1498          return NPERR_GENERIC_ERROR;
     1499  }
    14031500#if MOZILLA_VERSION_COLLAPSED < 1090100
    14041501  nsresult rv;
     
    14751572
    14761573      // As in get_cookie_info, we use the first active instance
    1477       GHashTableIter iter;
    1478       gpointer id, instance;
    1479 
    1480       g_hash_table_iter_init (&iter, instance_to_id_map);
    1481       g_hash_table_iter_next (&iter, &instance, &id);
    1482 
     1574      gpointer instance=getFirstInTableInstance(instance_to_id_map);
    14831575      browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len);
    14841576  } else
     
    20862178
    20872179  // cleanup_appletviewer_mutex:
    2088   g_free (tofree->appletviewer_mutex);
     2180  g_mutex_free (tofree->appletviewer_mutex);
    20892181  tofree->appletviewer_mutex = NULL;
    20902182
     
    21092201}
    21102202
    2111 static NPError
    2112 plugin_get_entry_points (NPPluginFuncs* pluginTable)
    2113 {
    2114   // Ensure that the plugin function table we've received is large
    2115   // enough to store the number of functions that we may provide.
    2116   if (pluginTable->size < sizeof (NPPluginFuncs))
    2117     {
    2118       PLUGIN_ERROR ("Invalid plugin function table.");
    2119 
    2120       return NPERR_INVALID_FUNCTABLE_ERROR;
    2121     }
    2122 
    2123   // Return to the browser the plugin functions that we implement.
     2203static bool
     2204initialize_browser_functions(const NPNetscapeFuncs* browserTable)
     2205{
     2206#if MOZILLA_VERSION_COLLAPSED < 1090100
     2207#define NPNETSCAPEFUNCS_LAST_FIELD_USED (browserTable->pluginthreadasynccall)
     2208#else
     2209#define NPNETSCAPEFUNCS_LAST_FIELD_USED (browserTable->setvalueforurl)
     2210#endif
     2211
     2212  //Determine the size in bytes, as a difference of the address past the last used field
     2213  //And the browser table address
     2214  size_t usedSize = (char*)(1 + &NPNETSCAPEFUNCS_LAST_FIELD_USED) - (char*)browserTable;
     2215
     2216  // compare the reported size versus the size we required
     2217  if (browserTable->size < usedSize)
     2218  {
     2219    return false;
     2220  }
     2221
     2222  //Ensure any unused fields are NULL
     2223  memset(&browser_functions, 0, sizeof(NPNetscapeFuncs));
     2224
     2225  //browserTable->size can be larger than sizeof(NPNetscapeFuncs) (PR1106)
     2226  size_t copySize = browserTable->size < sizeof(NPNetscapeFuncs) ?
     2227                    browserTable->size : sizeof(NPNetscapeFuncs);
     2228
     2229  //Copy fields according to given size
     2230  memcpy(&browser_functions, browserTable, copySize);
     2231
     2232  return true;
     2233}
     2234
     2235/* Set the plugin table to the correct contents, taking care not to write past
     2236 * the provided object space */
     2237static bool
     2238initialize_plugin_table(NPPluginFuncs* pluginTable)
     2239{
     2240#define NPPLUGINFUNCS_LAST_FIELD_USED (pluginTable->getvalue)
     2241
     2242  //Determine the size in bytes, as a difference of the address past the last used field
     2243  //And the browser table address
     2244  size_t usedSize = (char*)(1 + &NPPLUGINFUNCS_LAST_FIELD_USED) - (char*)pluginTable;
     2245
     2246  // compare the reported size versus the size we required
     2247  if (pluginTable->size < usedSize)
     2248    return false;
     2249
    21242250  pluginTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
    21252251  pluginTable->size = sizeof (NPPluginFuncs);
     
    21512277#endif
    21522278
    2153   return NPERR_NO_ERROR;
     2279  return true;
    21542280}
    21552281
     
    22002326    }
    22012327
    2202   // Ensure that the browser function table is large enough to store
    2203   // the number of browser functions that we may use.
    2204   if (browserTable->size < sizeof (NPNetscapeFuncs))
    2205     {
    2206       fprintf (stderr, "ERROR: Invalid browser function table. Some functionality may be restricted.\n");
    2207     }
    2208 
    2209   // Store in a local table the browser functions that we may use.
    2210   browser_functions.size                    = browserTable->size;
    2211   browser_functions.version                 = browserTable->version;
    2212   browser_functions.geturlnotify            = browserTable->geturlnotify;
    2213   browser_functions.geturl                  = browserTable->geturl;
    2214   browser_functions.posturlnotify           = browserTable->posturlnotify;
    2215   browser_functions.posturl                 = browserTable->posturl;
    2216   browser_functions.requestread             = browserTable->requestread;
    2217   browser_functions.newstream               = browserTable->newstream;
    2218   browser_functions.write                   = browserTable->write;
    2219   browser_functions.destroystream           = browserTable->destroystream;
    2220   browser_functions.status                  = browserTable->status;
    2221   browser_functions.uagent                  = browserTable->uagent;
    2222   browser_functions.memalloc                = browserTable->memalloc;
    2223   browser_functions.memfree                 = browserTable->memfree;
    2224   browser_functions.memflush                = browserTable->memflush;
    2225   browser_functions.reloadplugins           = browserTable->reloadplugins;
    2226   browser_functions.getJavaEnv              = browserTable->getJavaEnv;
    2227   browser_functions.getJavaPeer             = browserTable->getJavaPeer;
    2228   browser_functions.getvalue                = browserTable->getvalue;
    2229   browser_functions.setvalue                = browserTable->setvalue;
    2230   browser_functions.invalidaterect          = browserTable->invalidaterect;
    2231   browser_functions.invalidateregion        = browserTable->invalidateregion;
    2232   browser_functions.forceredraw             = browserTable->forceredraw;
    2233   browser_functions.getstringidentifier     = browserTable->getstringidentifier;
    2234   browser_functions.getstringidentifiers    = browserTable->getstringidentifiers;
    2235   browser_functions.getintidentifier        = browserTable->getintidentifier;
    2236   browser_functions.identifierisstring      = browserTable->identifierisstring;
    2237   browser_functions.utf8fromidentifier      = browserTable->utf8fromidentifier;
    2238   browser_functions.intfromidentifier       = browserTable->intfromidentifier;
    2239   browser_functions.createobject            = browserTable->createobject;
    2240   browser_functions.retainobject            = browserTable->retainobject;
    2241   browser_functions.releaseobject           = browserTable->releaseobject;
    2242   browser_functions.invoke                  = browserTable->invoke;
    2243   browser_functions.invokeDefault           = browserTable->invokeDefault;
    2244   browser_functions.evaluate                = browserTable->evaluate;
    2245   browser_functions.getproperty             = browserTable->getproperty;
    2246   browser_functions.setproperty             = browserTable->setproperty;
    2247   browser_functions.removeproperty          = browserTable->removeproperty;
    2248   browser_functions.hasproperty             = browserTable->hasproperty;
    2249   browser_functions.hasmethod               = browserTable->hasmethod;
    2250   browser_functions.releasevariantvalue     = browserTable->releasevariantvalue;
    2251   browser_functions.setexception            = browserTable->setexception;
    2252   browser_functions.pluginthreadasynccall   = browserTable->pluginthreadasynccall;
    2253 #if MOZILLA_VERSION_COLLAPSED >= 1090100
    2254   browser_functions.getvalueforurl          = browserTable->getvalueforurl;
    2255   browser_functions.setvalueforurl          = browserTable->setvalueforurl;
    2256 #endif
    2257 
    2258   NPError np_error = NPERR_NO_ERROR;
     2328  // Copy into a global table (browser_functions) the browser functions that we may use.
     2329  // If the browser functions needed change, update NPNETSCAPEFUNCS_LAST_FIELD_USED
     2330  // within this function
     2331  bool browser_functions_supported = initialize_browser_functions(browserTable);
     2332
     2333  // Check if everything we rely on is supported
     2334  if ( !browser_functions_supported )
     2335  {
     2336        PLUGIN_ERROR ("Invalid browser function table.");
     2337
     2338        return NPERR_INVALID_FUNCTABLE_ERROR;
     2339  }
     2340
    22592341#if !defined(_WIN32) && !defined (__OS2__)
    2260   np_error = plugin_get_entry_points (pluginTable);
    2261   if (np_error != NPERR_NO_ERROR)
    2262     return np_error;
     2342  // Return to the browser the plugin functions that we implement.
     2343  // If the plugin functions needed change, update NPPLUGINFUNCS_LAST_FIELD_USED
     2344  // within this function
     2345  bool plugin_functions_supported = initialize_plugin_table(pluginTable);
     2346
     2347  // Check if everything we rely on is supported
     2348  if ( !plugin_functions_supported )
     2349  {
     2350    PLUGIN_ERROR ("Invalid plugin function table.");
     2351
     2352    return NPERR_INVALID_FUNCTABLE_ERROR;
     2353  }
    22632354#endif
    22642355
     
    22872378      return NPERR_OUT_OF_MEMORY_ERROR;
    22882379    }
     2380  NPError np_error = NPERR_NO_ERROR;
     2381  gchar* filename = NULL;
    22892382
    22902383  // If P_tmpdir does not exist, try /tmp directly
     
    22932386                    (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)))
    22942387    {
     2388      int file_error = 0;
     2389
    22952390      data_directory = g_strconcat ("/tmp", NULL);
    22962391        if (!data_directory)
     
    24532548  }
    24542549
    2455   return plugin_get_entry_points (pluginTable);
     2550  // Return to the browser the plugin functions that we implement.
     2551  // If the plugin functions needed change, update NPPLUGINFUNCS_LAST_FIELD_USED
     2552  // within this function
     2553  bool plugin_functions_supported = initialize_plugin_table(pluginTable);
     2554
     2555  // Check if everything we rely on is supported
     2556  if ( !plugin_functions_supported )
     2557  {
     2558    PLUGIN_ERROR ("Invalid plugin function table.");
     2559
     2560    return NPERR_INVALID_FUNCTABLE_ERROR;
     2561  }
     2562
     2563  return NPERR_NO_ERROR;
    24562564}
    24572565#endif
     
    24592567// Returns a string describing the MIME type that this plugin
    24602568// handles.
    2461 const char*
     2569#ifdef LEGACY_XULRUNNERAPI
     2570  char*
     2571#else
     2572  const char*
     2573#endif
    24622574OSCALL NP_GetMIMEDescription ()
    24632575{
Note: See TracChangeset for help on using the changeset viewer.