#include "PluginDebug.h"
#include <wtf/text/WTFString.h>
#if !LOG_DISABLED
namespace WebCore {
static const char* const errorStrings[] = {
"No errors occurred.",
"Error with no specific error code occurred.",
"Invalid instance passed to the plug-in.",
"Function table invalid.",
"Loading of plug-in failed.",
"Memory allocation failed.",
"Plug-in missing or invalid.",
"Plug-in directory missing or invalid.",
"Versions of plug-in and Communicator do not match.",
"Parameter missing or invalid.",
"URL missing or invalid.",
"File missing or invalid.",
"Stream contains no data.",
"Seekable stream expected.",
"Unknown error code"
};
const char* prettyNameForNPError(NPError error)
{
return errorStrings[error];
}
CString prettyNameForNPNVariable(NPNVariable variable)
{
switch (variable) {
case NPNVxDisplay: return "NPNVxDisplay";
case NPNVxtAppContext: return "NPNVxtAppContext";
case NPNVnetscapeWindow: return "NPNVnetscapeWindow";
case NPNVjavascriptEnabledBool: return "NPNVjavascriptEnabledBool";
case NPNVasdEnabledBool: return "NPNVasdEnabledBool";
case NPNVisOfflineBool: return "NPNVisOfflineBool";
case NPNVserviceManager: return "NPNVserviceManager (not supported)";
case NPNVDOMElement: return "NPNVDOMElement (not supported)";
case NPNVDOMWindow: return "NPNVDOMWindow (not supported)";
case NPNVToolkit: return "NPNVToolkit (not supported)";
case NPNVSupportsXEmbedBool: return "NPNVSupportsXEmbedBool (not supported)";
case NPNVWindowNPObject: return "NPNVWindowNPObject";
case NPNVPluginElementNPObject: return "NPNVPluginElementNPObject";
case NPNVSupportsWindowless: return "NPNVSupportsWindowless";
case NPNVprivateModeBool: return "NPNVprivateModeBool";
default: return "Unknown variable";
}
}
CString prettyNameForNPPVariable(NPPVariable variable, void*)
{
switch (variable) {
case NPPVpluginNameString: return "NPPVpluginNameString";
case NPPVpluginDescriptionString: return "NPPVpluginDescriptionString";
case NPPVpluginWindowBool: return "NPPVpluginWindowBool";
case NPPVpluginTransparentBool: return "NPPVpluginTransparentBool";
case NPPVjavaClass: return "NPPVjavaClass (not supported)";
case NPPVpluginWindowSize: return "NPPVpluginWindowSize (not supported)";
case NPPVpluginTimerInterval: return "NPPVpluginTimerInterval (not supported)";
case NPPVpluginScriptableInstance: return "NPPVpluginScriptableInstance (not supported)";
case NPPVpluginScriptableIID: return "NPPVpluginScriptableIID (not supported)";
case NPPVjavascriptPushCallerBool: return "NPPVjavascriptPushCallerBool (not supported)";
case NPPVpluginKeepLibraryInMemory: return "NPPVpluginKeepLibraryInMemory (not supported)";
case NPPVpluginNeedsXEmbed: return "NPPVpluginNeedsXEmbed (not supported)";
case NPPVpluginScriptableNPObject: return "NPPVpluginScriptableNPObject";
case NPPVformValue: return "NPPVformValue (not supported)";
case NPPVpluginUrlRequestsDisplayedBool: return "NPPVpluginUrlRequestsDisplayedBool (not supported)";
case NPPVpluginWantsAllNetworkStreams: return "NPPVpluginWantsAllNetworkStreams";
case NPPVpluginCancelSrcStream: return "NPPVpluginCancelSrcStream";
default: return "Unknown variable";
}
}
CString prettyNameForNPNURLVariable(NPNURLVariable variable)
{
switch (variable) {
case NPNURLVCookie: return "NPNURLVCookie";
case NPNURLVProxy: return "NPNURLVProxy";
default: return "Unknown variable";
}
}
}
#endif // !LOG_DISABLED