Merge backout of bug 573960, a=orange
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 18 Jan 2011 22:59:05 -0500
changeset 60847 6e50eac51f45662288369a19f644a0114a003ccd
parent 60846 c9bc3f330a878082367e6bbf7f5e94a968dfd825 (current diff)
parent 60845 2926ad5face71e554ae60fda74ca11f7dd553c76 (diff)
child 60848 1ceb4984486975028b10d3d9fd52a8c6ef113e6c
push id18133
push userbzbarsky@mozilla.com
push dateWed, 19 Jan 2011 03:59:26 +0000
treeherdermozilla-central@6e50eac51f45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersorange
bugs573960
milestone2.0b10pre
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
Merge backout of bug 573960, a=orange
--- a/modules/plugin/base/public/npapi.h
+++ b/modules/plugin/base/public/npapi.h
@@ -96,17 +96,17 @@
 #include <QRegion>
 #endif
 
 /*----------------------------------------------------------------------*/
 /*                        Plugin Version Constants                      */
 /*----------------------------------------------------------------------*/
 
 #define NP_VERSION_MAJOR 0
-#define NP_VERSION_MINOR 26
+#define NP_VERSION_MINOR 27
 
 
 /* The OS/2 version of Netscape uses RC_DATA to define the
    mime types, file extensions, etc that are required.
    Use a vertical bar to separate types, end types with \0.
    FileVersion and ProductVersion are 32bit ints, all other
    entries are strings that MUST be terminated with a \0.
 
@@ -420,16 +420,18 @@ typedef enum {
   , NPNVsupportsCoreGraphicsBool = 2001
   , NPNVsupportsOpenGLBool = 2002
   , 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. */
 #endif
 #if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
   , NPNVSupportsWindowlessLocal = 2002
 #endif
 } NPNVariable;
 
 typedef enum {
   NPNURLVCookie = 501,
@@ -686,16 +688,22 @@ enum NPEventType {
  */
 #define NP_NORMAL     1
 #define NP_SEEK       2
 #define NP_ASFILE     3
 #define NP_ASFILEONLY 4
 
 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
 
+/*
+ * Flags for NPP_ClearSiteData.
+ */
+#define NP_CLEAR_ALL   0
+#define NP_CLEAR_CACHE (1 << 0)
+
 #if !defined(__LP64__)
 #if defined(XP_MACOSX)
 #pragma options align=reset
 #endif
 #endif /* __LP64__ */
 
 /*----------------------------------------------------------------------*/
 /*       Error and Reason Code definitions                              */
@@ -714,16 +722,18 @@ enum NPEventType {
 #define NPERR_INVALID_PLUGIN_ERROR        (NPERR_BASE + 6)
 #define NPERR_INVALID_PLUGIN_DIR_ERROR    (NPERR_BASE + 7)
 #define NPERR_INCOMPATIBLE_VERSION_ERROR  (NPERR_BASE + 8)
 #define NPERR_INVALID_PARAM               (NPERR_BASE + 9)
 #define NPERR_INVALID_URL                 (NPERR_BASE + 10)
 #define NPERR_FILE_NOT_FOUND              (NPERR_BASE + 11)
 #define NPERR_NO_DATA                     (NPERR_BASE + 12)
 #define NPERR_STREAM_NOT_SEEKABLE         (NPERR_BASE + 13)
+#define NPERR_TIME_RANGE_NOT_SUPPORTED    (NPERR_BASE + 14)
+#define NPERR_MALFORMED_SITE              (NPERR_BASE + 15)
 
 /*
  * Values of type NPReason:
  */
 #define NPRES_BASE          0
 #define NPRES_DONE         (NPRES_BASE + 0)
 #define NPRES_NETWORK_ERR  (NPRES_BASE + 1)
 #define NPRES_USER_BREAK   (NPRES_BASE + 2)
@@ -751,16 +761,17 @@ enum NPEventType {
 #define NPVERS_HAS_NPOBJECT_ENUM            18
 #define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
 #define NPVERS_HAS_ALL_NETWORK_STREAMS      20
 #define NPVERS_HAS_URL_AND_AUTH_INFO        21
 #define NPVERS_HAS_PRIVATE_MODE             22
 #define NPVERS_MACOSX_HAS_COCOA_EVENTS      23
 #define NPVERS_HAS_ADVANCED_KEY_HANDLING    25
 #define NPVERS_HAS_URL_REDIRECT_HANDLING    26
+#define NPVERS_HAS_CLEAR_SITE_DATA          27
 
 /*----------------------------------------------------------------------*/
 /*                        Function Prototypes                           */
 /*----------------------------------------------------------------------*/
 
 #if defined(__OS2__)
 #define NP_LOADDS _System
 #else
@@ -772,18 +783,16 @@ extern "C" {
 #endif
 
 /* NPP_* functions are provided by the plugin and called by the navigator. */
 
 #if defined(XP_UNIX)
 char* NPP_GetMIMEDescription(void);
 #endif
 
-NPError NP_LOADDS NPP_Initialize(void);
-void    NP_LOADDS NPP_Shutdown(void);
 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,
                                 NPStream* stream, NPBool seekable,
                                 uint16_t* stype);
@@ -798,16 +807,18 @@ void    NP_LOADDS NPP_Print(NPP instance
 int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
 void    NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
                                 NPReason reason, void* notifyData);
 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
 NPBool  NP_LOADDS NPP_GotFocus(NPP instance, NPFocusDirection direction);
 void    NP_LOADDS NPP_LostFocus(NPP instance);
 void    NP_LOADDS NPP_URLRedirectNotify(NPP instance, const char* url, int32_t status, void* notifyData);
+NPError NP_LOADDS NPP_ClearSiteData(const char* site, uint64_t flags, uint64_t maxAge);
+char**  NP_LOADDS NPP_GetSitesWithData(void);
 
 /* NPN_* functions are provided by the navigator and called by the plugin. */
 void        NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
                                   int* netscape_major, int* netscape_minor);
 NPError     NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
                                        const char* target, void* notifyData);
 NPError     NP_LOADDS NPN_GetURL(NPP instance, const char* url,
                                  const char* target);
--- a/modules/plugin/base/public/npfunctions.h
+++ b/modules/plugin/base/public/npfunctions.h
@@ -43,18 +43,16 @@
 #define NP_LOADDS _System
 #else
 #define NP_LOADDS
 #endif
 
 #include "npapi.h"
 #include "npruntime.h"
 
-typedef void         (* NP_LOADDS NPP_InitializeProcPtr)(void);
-typedef void         (* NP_LOADDS NPP_ShutdownProcPtr)(void);
 typedef NPError      (* NP_LOADDS NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
 typedef NPError      (* NP_LOADDS NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
 typedef NPError      (* NP_LOADDS NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
 typedef NPError      (* NP_LOADDS NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
 typedef NPError      (* NP_LOADDS NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
 typedef int32_t      (* NP_LOADDS NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
 typedef int32_t      (* NP_LOADDS NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
 typedef void         (* NP_LOADDS NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
@@ -63,16 +61,18 @@ typedef int16_t      (* NP_LOADDS NPP_Ha
 typedef void         (* NP_LOADDS NPP_URLNotifyProcPtr)(NPP instance, const char* url, NPReason reason, void* notifyData);
 /* Any NPObjects returned to the browser via NPP_GetValue should be retained
    by the plugin on the way out. The browser is responsible for releasing. */
 typedef NPError      (* NP_LOADDS NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
 typedef NPError      (* NP_LOADDS NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
 typedef NPBool       (* NP_LOADDS NPP_GotFocusPtr)(NPP instance, NPFocusDirection direction);
 typedef void         (* NP_LOADDS NPP_LostFocusPtr)(NPP instance);
 typedef void         (* NP_LOADDS NPP_URLRedirectNotifyPtr)(NPP instance, const char* url, int32_t status, void* notifyData);
+typedef NPError      (* NP_LOADDS NPP_ClearSiteDataPtr)(const char* site, uint64_t flags, uint64_t maxAge);
+typedef char**       (* NP_LOADDS NPP_GetSitesWithDataPtr)(void);
 
 typedef NPError      (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
 typedef NPError      (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
 typedef NPError      (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* url, const char* window, void* notifyData);
 typedef NPError      (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData);
 typedef NPError      (*NPN_GetURLProcPtr)(NPP instance, const char* url, const char* window);
 typedef NPError      (*NPN_PostURLProcPtr)(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file);
 typedef NPError      (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
@@ -142,16 +142,18 @@ typedef struct _NPPluginFuncs {
   NPP_HandleEventProcPtr event;
   NPP_URLNotifyProcPtr urlnotify;
   void* javaClass;
   NPP_GetValueProcPtr getvalue;
   NPP_SetValueProcPtr setvalue;
   NPP_GotFocusPtr gotfocus;
   NPP_LostFocusPtr lostfocus;
   NPP_URLRedirectNotifyPtr urlredirectnotify;
+  NPP_ClearSiteDataPtr clearsitedata;
+  NPP_GetSitesWithDataPtr getsiteswithdata;
 } NPPluginFuncs;
 
 typedef struct _NPNetscapeFuncs {
   uint16_t size;
   uint16_t version;
   NPN_GetURLProcPtr geturl;
   NPN_PostURLProcPtr posturl;
   NPN_RequestReadProcPtr requestread;
--- a/modules/plugin/base/public/nptypes.h
+++ b/modules/plugin/base/public/nptypes.h
@@ -35,29 +35,31 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nptypes_h_
 #define nptypes_h_
 
 /*
- * Header file for ensuring that C99 types ([u]int32_t and bool) and
+ * Header file for ensuring that C99 types ([u]int32_t, [u]int64_t and bool) and
  * true/false macros are available.
  */
 
 #if defined(WIN32) || defined(OS2)
   /*
-   * Win32 and OS/2 don't know C99, so define [u]int_16/32 here. The bool
+   * Win32 and OS/2 don't know C99, so define [u]int_16/32/64 here. The bool
    * is predefined tho, both in C and C++.
    */
   typedef short int16_t;
   typedef unsigned short uint16_t;
   typedef int int32_t;
   typedef unsigned int uint32_t;
+  typedef long long int64_t;
+  typedef unsigned long long uint64_t;
 #elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
   /*
    * AIX and SunOS ship a inttypes.h header that defines [u]int32_t,
    * but not bool for C.
    */
   #include <inttypes.h>
 
   #ifndef __cplusplus
@@ -72,16 +74,17 @@
    */
   #include <sys/types.h>
 
   /*
    * BSD/OS ships no header that defines uint32_t, nor bool (for C)
    */
   #if defined(bsdi)
   typedef u_int32_t uint32_t;
+  typedef u_int64_t uint64_t;
 
   #if !defined(__cplusplus)
     typedef int bool;
     #define true   1
     #define false  0
   #endif
   #else
   /*