Bug 1461243 - Part 3: Remove unused Java `codebase` check from nptest plugin. r=jimm
authorChris Peterson <cpeterson@mozilla.com>
Mon, 19 Feb 2018 15:05:32 -0800
changeset 472680 7e5dc1e92060e204d0b4077969cab54d6375d7f5
parent 472679 82d7309952964597a213676bba71cf6c56cf661e
child 472681 5f02f3bb5c6bb0c97783c2b124857c68aa880d8e
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1461243
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1461243 - Part 3: Remove unused Java `codebase` check from nptest plugin. r=jimm MozReview-Commit-ID: 7BHECmnqbsz
dom/plugins/test/testplugin/nptest.cpp
dom/plugins/test/testplugin/nptest.h
--- a/dom/plugins/test/testplugin/nptest.cpp
+++ b/dom/plugins/test/testplugin/nptest.cpp
@@ -130,17 +130,16 @@ static bool throwExceptionNextInvoke(NPO
 static bool convertPointX(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool convertPointY(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool streamTest(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool postFileToURLTest(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool setPluginWantsAllStreams(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool crashPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool crashOnDestroy(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool getObjectValue(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
-static bool getJavaCodebase(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool checkObjectValue(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool enableFPExceptions(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool hangPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool stallPlugin(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool getClipboardText(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool callOnDestroy(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool reinitWidget(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
 static bool crashPluginInNestedLoop(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result);
@@ -202,17 +201,16 @@ static const NPUTF8* sPluginMethodIdenti
   "convertPointX",
   "convertPointY",
   "streamTest",
   "postFileToURLTest",
   "setPluginWantsAllStreams",
   "crash",
   "crashOnDestroy",
   "getObjectValue",
-  "getJavaCodebase",
   "checkObjectValue",
   "enableFPExceptions",
   "hang",
   "stall",
   "getClipboardText",
   "callOnDestroy",
   "reinitWidget",
   "crashInNestedLoop",
@@ -275,17 +273,16 @@ static const ScriptableFunction sPluginM
   convertPointX,
   convertPointY,
   streamTest,
   postFileToURLTest,
   setPluginWantsAllStreams,
   crashPlugin,
   crashOnDestroy,
   getObjectValue,
-  getJavaCodebase,
   checkObjectValue,
   enableFPExceptions,
   hangPlugin,
   stallPlugin,
   getClipboardText,
   callOnDestroy,
   reinitWidget,
   crashPluginInNestedLoop,
@@ -877,21 +874,16 @@ NPP_New(NPMIMEType pluginType, NPP insta
     // window gets destroyed).
     if (strcmp(argn[i], "cleanupwidget") == 0 &&
         strcmp(argv[i], "false") == 0) {
       instanceData->cleanupWidget = false;
     }
     if (strcmp(argn[i], "bugmode") == 0) {
       instanceData->bugMode = atoi(argv[i]);
     }
-    // Try to emulate java's codebase handling: Use the last seen codebase
-    // value, regardless of whether it is in attributes or params.
-    if (strcasecmp(argn[i], "codebase") == 0) {
-      instanceData->javaCodebase = argv[i];
-    }
 
     // Bug 1307694 - There are two flash parameters that are order dependent for
     // scaling/sizing the plugin. If they ever change from what is expected, it
     // breaks flash on the web. In a test, if the scale tag ever happens
     // with an salign before it, fail the plugin creation.
     if (strcmp(argn[i], "scale") == 0) {
       if (alreadyHasSalign) {
         // If salign came before this parameter, error out now.
@@ -2719,30 +2711,16 @@ void notifyDidPaint(InstanceData* instan
   }
 }
 
 static const NPClass kTestSharedNPClass = {
   NP_CLASS_STRUCT_VERSION,
   // Everything else is nullptr
 };
 
-static bool getJavaCodebase(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result)
-{
-  if (argCount != 0) {
-    return false;
-  }
-
-  NPP npp = static_cast<TestNPObject*>(npobj)->npp;
-  InstanceData* id = static_cast<InstanceData*>(npp->pdata);
-
-  char *outval = NPN_StrDup(id->javaCodebase.c_str());
-  STRINGZ_TO_NPVARIANT(outval, *result);
-  return true;
-}
-
 static bool getObjectValue(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result)
 {
   NPP npp = static_cast<TestNPObject*>(npobj)->npp;
 
   NPObject* o = NPN_CreateObject(npp,
                                  const_cast<NPClass*>(&kTestSharedNPClass));
   if (!o)
     return false;
--- a/dom/plugins/test/testplugin/nptest.h
+++ b/dom/plugins/test/testplugin/nptest.h
@@ -136,17 +136,16 @@ typedef struct InstanceData {
   ActivationState focusState;
   int32_t focusEventCount;
   int32_t eventModel;
   bool closeStream;
   std::string lastKeyText;
   bool wantsAllStreams;
   int32_t mouseUpEventCount;
   int32_t bugMode;
-  std::string javaCodebase;
   AsyncDrawing asyncDrawing;
   NPAsyncSurface *frontBuffer;
   NPAsyncSurface *backBuffer;
   std::string lastComposition;
   void* placeholderWnd;
   double cssZoomFactor;
 } InstanceData;