Bug 674240: Update NPAPI headers to npapi-sdk r12. r=bgirard
authorJosh Aas <joshmoz@gmail.com>
Thu, 28 Jul 2011 14:32:29 -0400
changeset 73493 83129d0d4abeb704dd1f8261f082273c4040c710
parent 73492 ac0fe0533586e0470dce181d2f3fd5d9ace50170
child 73494 45caaf30e1feb0ade08eb50bea386e9f8098dfe5
child 73522 524a9852f99ff258b965a0bc29391dd32923629a
push id20875
push userjosh@mozilla.com
push dateThu, 28 Jul 2011 18:33:01 +0000
treeherdermozilla-central@83129d0d4abe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard
bugs674240
milestone8.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 674240: Update NPAPI headers to npapi-sdk r12. r=bgirard
dom/plugins/base/npapi.h
dom/plugins/base/npfunctions.h
dom/plugins/base/npruntime.h
dom/plugins/base/nptypes.h
dom/plugins/test/testplugin/nptest.cpp
--- a/dom/plugins/base/npapi.h
+++ b/dom/plugins/base/npapi.h
@@ -361,17 +361,17 @@ typedef enum {
   NPPVpluginWantsAllNetworkStreams = 18,
 
   /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
   NPPVpluginNativeAccessibleAtkPlugId = 19,
 
   /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
   NPPVpluginCancelSrcStream = 20,
 
-  NPPVSupportsAdvancedKeyHandling = 21,
+  NPPVsupportsAdvancedKeyHandling = 21,
 
   NPPVpluginUsesDOMForCursorBool = 22
 
 #if defined(XP_MACOSX)
   /* Used for negotiating drawing models */
   , NPPVpluginDrawingModel = 1000
   /* Used for negotiating event models */
   , NPPVpluginEventModel = 1001
@@ -424,16 +424,18 @@ typedef enum {
   , NPNVsupportsCoreAnimationBool = 2003
   , NPNVsupportsInvalidatingCoreAnimationBool = 2004
 #ifndef NP_NO_CARBON
   , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
 #endif
   , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
   , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
                                                     Cocoa text input specification. */
+  , NPNVsupportsCompositingCoreAnimationPluginsBool = 74656 /* TRUE if the browser supports
+                                                               CA model compositing */
 #endif
 #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
   , NPNVSupportsWindowlessLocal = 2002
 #endif
 } NPNVariable;
 
 typedef enum {
   NPNURLVCookie = 501,
@@ -782,17 +784,17 @@ enum NPEventType {
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /* NPP_* functions are provided by the plugin and called by the navigator. */
 
 #if defined(XP_UNIX)
-char* NPP_GetMIMEDescription(void);
+const char* NPP_GetMIMEDescription(void);
 #endif
 
 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
                           uint16_t mode, int16_t argc, char* argn[],
                           char* argv[], NPSavedData* saved);
 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
--- a/dom/plugins/base/npfunctions.h
+++ b/dom/plugins/base/npfunctions.h
@@ -212,17 +212,17 @@ typedef struct _NPNetscapeFuncs {
 } NPNetscapeFuncs;
 
 #ifdef XP_MACOSX
 /*
  * Mac OS X version(s) of NP_GetMIMEDescription(const char *)
  * These can be called to retreive MIME information from the plugin dynamically
  *
  * Note: For compatibility with Quicktime, BPSupportedMIMEtypes is another way
- *       to get mime info from the plugin only on OSX and may not be supported 
+ *       to get mime info from the plugin only on OSX and may not be supported
  *       in furture version -- use NP_GetMIMEDescription instead
  */
 enum
 {
  kBPSupportedMIMETypesStructVers_1    = 1
 };
 typedef struct _BPSupportedMIMETypes
 {
@@ -268,55 +268,55 @@ typedef struct _NPPluginData {   /* Alte
   char *pMimeTypes;
   char *pFileExtents;
   char *pFileOpenTemplate;
   char *pProductName;
   char *pProductDescription;
   unsigned long dwProductVersionMS;
   unsigned long dwProductVersionLS;
 } NPPluginData;
-typedef NPError (*NP_GetPluginDataFunc)(NPPluginData*);
-NPError OSCALL  NP_GetPluginData(NPPluginData * pPluginData);
+typedef NPError     (*NP_GetPluginDataFunc)(NPPluginData*);
+NPError OSCALL      NP_GetPluginData(NPPluginData * pPluginData);
 #endif
-typedef NPError (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
-NPError OSCALL  NP_GetEntryPoints(NPPluginFuncs* pFuncs);
-typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*);
-NPError OSCALL  NP_Initialize(NPNetscapeFuncs* bFuncs);
-typedef NPError (*NP_ShutdownFunc)(void);
-NPError OSCALL  NP_Shutdown(void);
-typedef char*   (*NP_GetMIMEDescriptionFunc)(void);
-char*           NP_GetMIMEDescription(void);
+typedef NPError     (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
+NPError OSCALL      NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+typedef NPError     (*NP_InitializeFunc)(NPNetscapeFuncs*);
+NPError OSCALL      NP_Initialize(NPNetscapeFuncs* bFuncs);
+typedef NPError     (*NP_ShutdownFunc)(void);
+NPError OSCALL      NP_Shutdown(void);
+typedef const char* (*NP_GetMIMEDescriptionFunc)(void);
+const char*         NP_GetMIMEDescription(void);
 #ifdef __cplusplus
 }
 #endif
 #endif
 
 #if defined(__OS2__)
 #pragma pack()
 #endif
 
 #ifdef XP_UNIX
 #ifdef __cplusplus
 extern "C" {
 #endif
-typedef char*      (*NP_GetPluginVersionFunc)(void);
-NP_EXPORT(char*)   NP_GetPluginVersion(void);
-typedef char*      (*NP_GetMIMEDescriptionFunc)(void);
-NP_EXPORT(char*)   NP_GetMIMEDescription(void);
+typedef char*          (*NP_GetPluginVersionFunc)(void);
+NP_EXPORT(char*)       NP_GetPluginVersion(void);
+typedef const char*    (*NP_GetMIMEDescriptionFunc)(void);
+NP_EXPORT(const char*) NP_GetMIMEDescription(void);
 #ifdef XP_MACOSX
-typedef NPError    (*NP_InitializeFunc)(NPNetscapeFuncs*);
-NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs);
-typedef NPError    (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
-NP_EXPORT(NPError) NP_GetEntryPoints(NPPluginFuncs* pFuncs);
+typedef NPError        (*NP_InitializeFunc)(NPNetscapeFuncs*);
+NP_EXPORT(NPError)     NP_Initialize(NPNetscapeFuncs* bFuncs);
+typedef NPError        (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
+NP_EXPORT(NPError)     NP_GetEntryPoints(NPPluginFuncs* pFuncs);
 #else
-typedef NPError    (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*);
-NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
+typedef NPError        (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*);
+NP_EXPORT(NPError)     NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
 #endif
-typedef NPError    (*NP_ShutdownFunc)(void);
-NP_EXPORT(NPError) NP_Shutdown(void);
-typedef NPError    (*NP_GetValueFunc)(void *, NPPVariable, void *);
-NP_EXPORT(NPError) NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
+typedef NPError        (*NP_ShutdownFunc)(void);
+NP_EXPORT(NPError)     NP_Shutdown(void);
+typedef NPError        (*NP_GetValueFunc)(void *, NPPVariable, void *);
+NP_EXPORT(NPError)     NP_GetValue(void *future, NPPVariable aVariable, void *aValue);
 #ifdef __cplusplus
 }
 #endif
 #endif
 
 #endif /* npfunctions_h_ */
--- a/dom/plugins/base/npruntime.h
+++ b/dom/plugins/base/npruntime.h
@@ -1,27 +1,27 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
- * Copyright (c) 2004, Apple Computer, Inc. and The Mozilla Foundation. 
+ * Copyright (c) 2004, Apple Computer, Inc. and The Mozilla Foundation.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright
  * notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  * notice, this list of conditions and the following disclaimer in the
  * documentation and/or other materials provided with the distribution.
  * 3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla
  * Foundation ("Mozilla") nor the names of their contributors may be used
  * to endorse or promote products derived from this software without
  * specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS "AS
  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR
  * THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
@@ -39,17 +39,17 @@ extern "C" {
 
 #include "nptypes.h"
 
 /*
     This API is used to facilitate binding code written in C to script
     objects.  The API in this header does not assume the presence of a
     user agent.  That is, it can be used to bind C code to scripting
     environments outside of the context of a user agent.
-    
+
     However, the normal use of the this API is in the context of a
     scripting environment running in a browser or other user agent.
     In particular it is used to support the extended Netscape
     script-ability API for plugins (NP-SAP).  NP-SAP is an extension
     of the Netscape plugin API.  As such we have adopted the use of
     the "NP" prefix for this API.
 
     The following NP{N|P}Variables were added to the Netscape plugin
@@ -162,24 +162,24 @@ NP_END_MACRO
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_Double;                                         \
     (_v).value.doubleValue = _val;                                            \
 NP_END_MACRO
 
 #define STRINGZ_TO_NPVARIANT(_val, _v)                                        \
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_String;                                         \
-    NPString str = { _val, uint32_t(strlen(_val)) };                          \
+    NPString str = { _val, (uint32_t)(strlen(_val)) };                        \
     (_v).value.stringValue = str;                                             \
 NP_END_MACRO
 
 #define STRINGN_TO_NPVARIANT(_val, _len, _v)                                  \
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_String;                                         \
-    NPString str = { _val, uint32_t(_len) };                                  \
+    NPString str = { _val, (uint32_t)(_len) };                                \
     (_v).value.stringValue = str;                                             \
 NP_END_MACRO
 
 #define OBJECT_TO_NPVARIANT(_val, _v)                                         \
 NP_BEGIN_MACRO                                                                \
     (_v).type = NPVariantType_Object;                                         \
     (_v).value.objectValue = _val;                                            \
 NP_END_MACRO
@@ -350,17 +350,17 @@ void NPN_ReleaseObject(NPObject *npobj);
 
 /*
     Functions to access script objects represented by NPObject.
 
     Calls to script objects are synchronous.  If a function returns a
     value, it will be supplied via the result NPVariant
     argument. Successful calls will return true, false will be
     returned in case of an error.
-    
+
     Calls made from plugin code to script must be made from the thread
     on which the plugin was initialized.
 */
 
 bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName,
                 const NPVariant *args, uint32_t argCount, NPVariant *result);
 bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args,
                        uint32_t argCount, NPVariant *result);
--- a/dom/plugins/base/nptypes.h
+++ b/dom/plugins/base/nptypes.h
@@ -64,17 +64,17 @@
 
   #ifndef __cplusplus
     typedef int bool;
     #define true   1
     #define false  0
   #endif
 #elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
   /*
-   * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and 
+   * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
    * u_int32_t.
    */
   #include <sys/types.h>
 
   /*
    * BSD/OS ships no header that defines uint32_t, nor bool (for C)
    */
   #if defined(bsdi)
--- a/dom/plugins/test/testplugin/nptest.cpp
+++ b/dom/plugins/test/testplugin/nptest.cpp
@@ -564,19 +564,19 @@ NP_GetPluginVersion()
 {
   return sPluginVersion;
 }
 #endif
 
 static char sMimeDescription[] = "application/x-test:tst:Test mimetype";
 
 #if defined(XP_UNIX)
-NP_EXPORT(char*) NP_GetMIMEDescription()
+NP_EXPORT(const char*) NP_GetMIMEDescription()
 #elif defined(XP_WIN) || defined(XP_OS2)
-char* NP_GetMIMEDescription()
+const char* NP_GetMIMEDescription()
 #endif
 {
   return sMimeDescription;
 }
 
 #ifdef XP_UNIX
 NP_EXPORT(NPError)
 NP_GetValue(void* future, NPPVariable aVariable, void* aValue) {