Commit c35bb586 authored by andersca@apple.com's avatar andersca@apple.com
Browse files

2010-04-30 Anders Carlsson <andersca@apple.com>

        Reviewed by Timothy Hatcher.

        Next step towards fixing
        
        https://bugs.webkit.org/show_bug.cgi?id=20784
        move npapi.h to C99 integer types

        Use the C99 types everywhere. The "old" types are still around but will be removed
        in a subsequent commit.

        * Plugins/WebBaseNetscapePluginStream.h:
        * Plugins/WebBaseNetscapePluginStream.mm:
        (WebNetscapePluginStream::deliverData):
        * Plugins/WebNetscapePluginView.h:
        * Plugins/WebNetscapePluginView.mm:
        (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]):
        (-[WebNetscapePluginView getAuthenticationInfoWithProtocol:host:port:scheme:realm:username:usernameLength:password:passwordLength:]):
        * Plugins/npapi.mm:
        (NPN_MemAlloc):
        (NPN_MemFlush):
        (NPN_PostURLNotify):
        (NPN_PostURL):
        (NPN_Write):
        (NPN_ScheduleTimer):
        (NPN_UnscheduleTimer):
        (NPN_GetValueForURL):
        (NPN_SetValueForURL):
        (NPN_GetAuthenticationInfo):
        (WKN_CheckIfAllowedToLoadURL):
        (WKN_CancelCheckIfAllowedToLoadURL):
2010-04-30  Anders Carlsson  <andersca@apple.com>

        Reviewed by Timothy Hatcher.

        Next step towards fixing
        
        https://bugs.webkit.org/show_bug.cgi?id=20784
        move npapi.h to C99 integer types

        Use the C99 types everywhere. The "old" types are still around but will be removed
        in a subsequent commit.

        * bridge/npapi.h:
        (_NPCocoaEvent::):
        * plugins/PluginPackage.h:
        * plugins/PluginStream.cpp:
        (WebCore::PluginStream::deliverData):
        * plugins/PluginStream.h:
        * plugins/PluginView.cpp:
        (WebCore::PluginView::postURLNotify):
        (WebCore::PluginView::postURL):
        (WebCore::PluginView::write):
        (WebCore::PluginView::handlePost):
        * plugins/PluginView.h:
        * plugins/PluginViewNone.cpp:
        (WebCore::PluginView::handlePostReadFile):
        * plugins/npapi.cpp:
        (NPN_MemAlloc):
        (NPN_MemFlush):
        (NPN_PostURLNotify):
        (NPN_PostURL):
        (NPN_Write):
        * plugins/npfunctions.h:
        * plugins/win/PluginPackageWin.cpp:
        (WebCore::PluginPackage::NPVersion):
        * plugins/win/PluginViewWin.cpp:
        (WebCore::PluginView::handlePostReadFile):
2010-04-30  Anders Carlsson  <andersca@apple.com>

        Reviewed by Timothy Hatcher.

        Next step towards fixing
        
        https://bugs.webkit.org/show_bug.cgi?id=20784
        move npapi.h to C99 integer types

        Use the C99 types everywhere. The "old" types are still around but will be removed
        in a subsequent commit.

        * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
        (int32VariantToIdentifier):
        (doubleVariantToIdentifier):
        (testIdentifierToInt):
        (testGetIntIdentifier):
        * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
        (NPP_New):
        (NPP_NewStream):
        (NPP_WriteReady):
        (NPP_Write):
        (NPP_HandleEvent):
        * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
        (NPP_New):
        (NPP_NewStream):
        (NPP_WriteReady):
        (NPP_Write):
        (NPP_HandleEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0caec4b3
2010-04-30 Anders Carlsson <andersca@apple.com>
Reviewed by Timothy Hatcher.
Next step towards fixing
https://bugs.webkit.org/show_bug.cgi?id=20784
move npapi.h to C99 integer types
Use the C99 types everywhere. The "old" types are still around but will be removed
in a subsequent commit.
* bridge/npapi.h:
(_NPCocoaEvent::):
* plugins/PluginPackage.h:
* plugins/PluginStream.cpp:
(WebCore::PluginStream::deliverData):
* plugins/PluginStream.h:
* plugins/PluginView.cpp:
(WebCore::PluginView::postURLNotify):
(WebCore::PluginView::postURL):
(WebCore::PluginView::write):
(WebCore::PluginView::handlePost):
* plugins/PluginView.h:
* plugins/PluginViewNone.cpp:
(WebCore::PluginView::handlePostReadFile):
* plugins/npapi.cpp:
(NPN_MemAlloc):
(NPN_MemFlush):
(NPN_PostURLNotify):
(NPN_PostURL):
(NPN_Write):
* plugins/npfunctions.h:
* plugins/win/PluginPackageWin.cpp:
(WebCore::PluginPackage::NPVersion):
* plugins/win/PluginViewWin.cpp:
(WebCore::PluginView::handlePostReadFile):
2010-04-30 Peter Kasting <pkasting@google.com>
 
Reviewed by David Levin.
......@@ -176,8 +176,8 @@ typedef long int32;
#endif
typedef unsigned char NPBool;
typedef int16 NPError;
typedef int16 NPReason;
typedef int16_t NPError;
typedef int16_t NPReason;
typedef char* NPMIMEType;
......@@ -209,8 +209,8 @@ typedef struct _NPStream
void* pdata; /* plug-in private data */
void* ndata; /* netscape private data */
const char* url;
uint32 end;
uint32 lastmodified;
uint32_t end;
uint32_t lastmodified;
void* notifyData;
const char* headers; /* Response headers from host.
* Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
......@@ -227,25 +227,25 @@ typedef struct _NPStream
typedef struct _NPByteRange
{
int32 offset; /* negative offset means from the end */
uint32 length;
int32_t offset; /* negative offset means from the end */
uint32_t length;
struct _NPByteRange* next;
} NPByteRange;
typedef struct _NPSavedData
{
int32 len;
int32_t len;
void* buf;
} NPSavedData;
typedef struct _NPRect
{
uint16 top;
uint16 left;
uint16 bottom;
uint16 right;
uint16_t top;
uint16_t left;
uint16_t bottom;
uint16_t right;
} NPRect;
......@@ -486,25 +486,25 @@ typedef struct _NPNSMenu NPNSMenu;
typedef struct _NPCocoaEvent {
NPCocoaEventType type;
uint32 version;
uint32_t version;
union {
struct {
uint32 modifierFlags;
uint32_t modifierFlags;
double pluginX;
double pluginY;
int32 buttonNumber;
int32 clickCount;
int32_t buttonNumber;
int32_t clickCount;
double deltaX;
double deltaY;
double deltaZ;
} mouse;
struct {
uint32 modifierFlags;
uint32_t modifierFlags;
NPNSString *characters;
NPNSString *charactersIgnoringModifiers;
NPBool isARepeat;
uint16 keyCode;
uint16_t keyCode;
} key;
struct {
CGContextRef context;
......@@ -528,10 +528,10 @@ typedef struct _NPCocoaEvent {
typedef struct _NPWindow
{
void* window; /* Platform specific window handle */
int32 x; /* Position of top left corner relative */
int32 y; /* to a netscape page. */
uint32 width; /* Maximum window size */
uint32 height;
int32_t x; /* Position of top left corner relative */
int32_t y; /* to a netscape page. */
uint32_t width; /* Maximum window size */
uint32_t height;
NPRect clipRect; /* Clipping rectangle in port coordinates */
/* Used by MAC only. */
#if defined(XP_UNIX) || defined(XP_SYMBIAN)
......@@ -558,7 +558,7 @@ typedef struct _NPEmbedPrint
typedef struct _NPPrint
{
uint16 mode; /* NP_FULL or NP_EMBED */
uint16_t mode; /* NP_FULL or NP_EMBED */
union
{
NPFullPrint fullPrint; /* if mode is NP_FULL */
......@@ -591,7 +591,7 @@ typedef QEvent NPEvent;
#elif defined(XP_WIN)
typedef struct _NPEvent
{
uint16 event;
uint16_t event;
uintptr_t wParam;
uintptr_t lParam;
} NPEvent;
......@@ -803,22 +803,22 @@ char* NPP_GetMIMEDescription(void);
NPError NPP_Initialize(void);
void NPP_Shutdown(void);
NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
uint16 mode, int16 argc, char* argn[],
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* stype);
uint16_t* stype);
NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
NPReason reason);
int32 NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
int32 NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
int32 len, void* buffer);
int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
int32_t len, void* buffer);
void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
const char* fname);
void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
int16 NPP_HandleEvent(NPP instance, void* event);
int16_t NPP_HandleEvent(NPP instance, void* event);
void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
NPReason reason, void* notifyData);
jref NP_LOADDS NPP_GetJavaClass(void);
......@@ -838,24 +838,24 @@ NPError NPN_GetURLNotify(NPP instance, const char* url,
NPError NPN_GetURL(NPP instance, const char* url,
const char* target);
NPError NPN_PostURLNotify(NPP instance, const char* url,
const char* target, uint32 len,
const char* target, uint32_t len,
const char* buf, NPBool file,
void* notifyData);
NPError NPN_PostURL(NPP instance, const char* url,
const char* target, uint32 len,
const char* target, uint32_t len,
const char* buf, NPBool file);
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
NPError NPN_NewStream(NPP instance, NPMIMEType type,
const char* target, NPStream** stream);
int32 NPN_Write(NPP instance, NPStream* stream, int32 len,
int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len,
void* buffer);
NPError NPN_DestroyStream(NPP instance, NPStream* stream,
NPReason reason);
void NPN_Status(NPP instance, const char* message);
const char* NPN_UserAgent(NPP instance);
void* NPN_MemAlloc(uint32 size);
void* NPN_MemAlloc(uint32_t size);
void NPN_MemFree(void* ptr);
uint32 NPN_MemFlush(uint32 size);
uint32_t NPN_MemFlush(uint32_t size);
void NPN_ReloadPlugins(NPBool reloadPages);
JRIEnv* NPN_GetJavaEnv(void);
jref NPN_GetJavaPeer(NPP instance);
......@@ -869,11 +869,11 @@ void NPN_ForceRedraw(NPP instance);
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
void NPN_PopPopupsEnabledState(NPP instance);
void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData);
NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32* len);
NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32 len);
NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32 port, const char* scheme, const char *realm, char** username, uint32* ulen, char** password, uint32* plen);
uint32 NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID));
void NPN_UnscheduleTimer(NPP instance, uint32 timerID);
NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32_t* len);
NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32_t len);
NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32_t port, const char* scheme, const char *realm, char** username, uint32_t* ulen, char** password, uint32_t* plen);
uint32_t NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
void NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
......
......@@ -55,7 +55,7 @@ namespace WebCore {
const String& path() const { return m_path; }
const String& fileName() const { return m_fileName; }
const String& parentDirectory() const { return m_parentDirectory; }
uint16 NPVersion() const;
uint16_t NPVersion() const;
time_t lastModified() const { return m_lastModified; }
const MIMEToDescriptionsMap& mimeToDescriptions() const { return m_mimeToDescriptions; }
......
......@@ -336,20 +336,20 @@ void PluginStream::deliverData()
if (!m_stream.ndata || m_deliveryData->size() == 0)
return;
int32 totalBytes = m_deliveryData->size();
int32 totalBytesDelivered = 0;
int32_t totalBytes = m_deliveryData->size();
int32_t totalBytesDelivered = 0;
if (m_loader)
m_loader->setDefersLoading(true);
while (totalBytesDelivered < totalBytes) {
int32 deliveryBytes = m_pluginFuncs->writeready(m_instance, &m_stream);
int32_t deliveryBytes = m_pluginFuncs->writeready(m_instance, &m_stream);
if (deliveryBytes <= 0) {
m_delayDeliveryTimer.startOneShot(0);
break;
} else {
deliveryBytes = min(deliveryBytes, totalBytes - totalBytesDelivered);
int32 dataLength = deliveryBytes;
int32_t dataLength = deliveryBytes;
char* data = m_deliveryData->data() + totalBytesDelivered;
// Write the data
......
......@@ -109,8 +109,8 @@ namespace WebCore {
const NPPluginFuncs* m_pluginFuncs;
NPP m_instance;
uint16 m_transferMode;
int32 m_offset;
uint16_t m_transferMode;
int32_t m_offset;
WTF::CString m_headers;
WTF::CString m_path;
NPReason m_reason;
......
......@@ -582,12 +582,12 @@ NPError PluginView::getURL(const char* url, const char* target)
return load(frameLoadRequest, false, 0);
}
NPError PluginView::postURLNotify(const char* url, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData)
NPError PluginView::postURLNotify(const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
{
return handlePost(url, target, len, buf, file, notifyData, true, true);
}
NPError PluginView::postURL(const char* url, const char* target, uint32 len, const char* buf, NPBool file)
NPError PluginView::postURL(const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
{
// As documented, only allow headers to be specified via NPP_PostURL when using a file.
return handlePost(url, target, len, buf, file, 0, false, file);
......@@ -600,7 +600,7 @@ NPError PluginView::newStream(NPMIMEType type, const char* target, NPStream** st
return NPERR_GENERIC_ERROR;
}
int32 PluginView::write(NPStream* stream, int32 len, void* buffer)
int32_t PluginView::write(NPStream* stream, int32_t len, void* buffer)
{
notImplemented();
// Unsupported
......@@ -1136,7 +1136,7 @@ static inline HTTPHeaderMap parseRFC822HeaderFields(const Vector<char>& buffer,
return headerFields;
}
NPError PluginView::handlePost(const char* url, const char* target, uint32 len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders)
NPError PluginView::handlePost(const char* url, const char* target, uint32_t len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders)
{
if (!url || !len || !buf)
return NPERR_INVALID_PARAM;
......
......@@ -129,10 +129,10 @@ namespace WebCore {
// NPN functions
NPError getURLNotify(const char* url, const char* target, void* notifyData);
NPError getURL(const char* url, const char* target);
NPError postURLNotify(const char* url, const char* target, uint32 len, const char* but, NPBool file, void* notifyData);
NPError postURL(const char* url, const char* target, uint32 len, const char* but, NPBool file);
NPError postURLNotify(const char* url, const char* target, uint32_t len, const char* but, NPBool file, void* notifyData);
NPError postURL(const char* url, const char* target, uint32_t len, const char* but, NPBool file);
NPError newStream(NPMIMEType type, const char* target, NPStream** stream);
int32 write(NPStream* stream, int32 len, void* buffer);
int32_t write(NPStream* stream, int32_t len, void* buffer);
NPError destroyStream(NPStream* stream, NPReason reason);
const char* userAgent();
#if ENABLE(NETSCAPE_PLUGIN_API)
......@@ -232,8 +232,8 @@ namespace WebCore {
void platformDestroy();
static void setCurrentPluginView(PluginView*);
NPError load(const FrameLoadRequest&, bool sendNotification, void* notifyData);
NPError handlePost(const char* url, const char* target, uint32 len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders);
NPError handlePostReadFile(Vector<char>& buffer, uint32 len, const char* buf);
NPError handlePost(const char* url, const char* target, uint32_t len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders);
NPError handlePostReadFile(Vector<char>& buffer, uint32_t len, const char* buf);
static void freeStringArray(char** stringArray, int length);
void setCallingPlugin(bool) const;
......
......@@ -62,7 +62,7 @@ void PluginView::setNPWindowRect(const IntRect&)
{
}
NPError PluginView::handlePostReadFile(Vector<char>&, uint32, const char*)
NPError PluginView::handlePostReadFile(Vector<char>&, uint32_t, const char*)
{
return 0;
}
......
......@@ -43,7 +43,7 @@ static PluginView* pluginViewForInstance(NPP instance)
return PluginView::currentPluginView();
}
void* NPN_MemAlloc(uint32 size)
void* NPN_MemAlloc(uint32_t size)
{
return malloc(size);
}
......@@ -53,7 +53,7 @@ void NPN_MemFree(void* ptr)
free(ptr);
}
uint32 NPN_MemFlush(uint32 size)
uint32_t NPN_MemFlush(uint32_t size)
{
// Do nothing
return 0;
......@@ -79,12 +79,12 @@ NPError NPN_GetURL(NPP instance, const char* url, const char* target)
return pluginViewForInstance(instance)->getURL(url, target);
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData)
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
{
return pluginViewForInstance(instance)->postURLNotify(url, target, len, buf, file, notifyData);
}
NPError NPN_PostURL(NPP instance, const char* url, const char* target, uint32 len, const char* buf, NPBool file)
NPError NPN_PostURL(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
{
return pluginViewForInstance(instance)->postURL(url, target, len, buf, file);
}
......@@ -94,7 +94,7 @@ NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStrea
return pluginViewForInstance(instance)->newStream(type, target, stream);
}
int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
{
return pluginViewForInstance(instance)->write(stream, len, buffer);
}
......
......@@ -40,16 +40,16 @@ extern "C" {
#endif
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 len, const char* buf, NPBool file, 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_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList);
typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream);
typedef int32 (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32 len, void* buffer);
typedef int32_t (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32_t len, void* buffer);
typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message);
typedef const char*(*NPN_UserAgentProcPtr)(NPP instance);
typedef void* (*NPN_MemAllocProcPtr)(uint32 size);
typedef void* (*NPN_MemAllocProcPtr)(uint32_t size);
typedef void (*NPN_MemFreeProcPtr)(void* ptr);
typedef uint32 (*NPN_MemFlushProcPtr)(uint32 size);
typedef uint32_t (*NPN_MemFlushProcPtr)(uint32_t size);
typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages);
typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value);
typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value);
......@@ -57,18 +57,18 @@ typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect);
typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region);
typedef void (*NPN_ForceRedrawProcPtr)(NPP instance);
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 len, const char* buf, NPBool file);
typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* URL, const char* window, uint32_t len, const char* buf, NPBool file);
typedef void* (*NPN_GetJavaEnvProcPtr)(void);
typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance);
typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP instance, NPBool enabled);
typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP instance);
typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP npp, void (*func)(void *), void *userData);
typedef NPError (*NPN_GetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, char** value, uint32* len);
typedef NPError (*NPN_SetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, const char* value, uint32 len);
typedef NPError (*NPN_GetAuthenticationInfoProcPtr)(NPP npp, const char* protocol, const char* host, int32 port, const char* scheme, const char *realm, char** username, uint32* ulen, char** password, uint32* plen);
typedef NPError (*NPN_GetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, char** value, uint32_t* len);
typedef NPError (*NPN_SetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, const char* value, uint32_t len);
typedef NPError (*NPN_GetAuthenticationInfoProcPtr)(NPP npp, const char* protocol, const char* host, int32_t port, const char* scheme, const char *realm, char** username, uint32_t* ulen, char** password, uint32_t* plen);
typedef uint32 (*NPN_ScheduleTimerProcPtr)(NPP npp, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID));
typedef void (*NPN_UnscheduleTimerProcPtr)(NPP npp, uint32 timerID);
typedef uint32_t (*NPN_ScheduleTimerProcPtr)(NPP npp, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
typedef void (*NPN_UnscheduleTimerProcPtr)(NPP npp, uint32_t timerID);
typedef NPError (*NPN_PopUpContextMenuProcPtr)(NPP instance, NPMenu* menu);
typedef NPBool (*NPN_ConvertPointProcPtr)(NPP npp, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
......@@ -96,16 +96,16 @@ typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, const NPUTF8 *message);
typedef bool (*NPN_EnumerateProcPtr) (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count);
typedef bool (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result);
typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
typedef NPError (*NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
typedef NPError (*NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason);
typedef void (*NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname);
typedef int32 (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
typedef int32 (*NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
typedef int32_t (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream);
typedef int32_t (*NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
typedef void (*NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint);
typedef int16 (*NPP_HandleEventProcPtr)(NPP instance, void* event);
typedef int16_t (*NPP_HandleEventProcPtr)(NPP instance, void* event);
typedef void (*NPP_URLNotifyProcPtr)(NPP instance, const char* URL, NPReason reason, void* notifyData);
typedef NPError (*NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value);
typedef NPError (*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value);
......@@ -114,8 +114,8 @@ typedef void *(*NPP_GetJavaClassProcPtr)(void);
typedef void* JRIGlobalRef; //not using this right now
typedef struct _NPNetscapeFuncs {
uint16 size;
uint16 version;
uint16_t size;
uint16_t version;
NPN_GetURLProcPtr geturl;
NPN_PostURLProcPtr posturl;
......@@ -173,8 +173,8 @@ typedef struct _NPNetscapeFuncs {
} NPNetscapeFuncs;
typedef struct _NPPluginFuncs {
uint16 size;
uint16 version;
uint16_t size;
uint16_t version;
NPP_NewProcPtr newp;
NPP_DestroyProcPtr destroy;
NPP_SetWindowProcPtr setwindow;
......
......@@ -335,7 +335,7 @@ bool PluginPackage::equal(const PluginPackage& a, const PluginPackage& b)
return true;
}
uint16 PluginPackage::NPVersion() const
uint16_t PluginPackage::NPVersion() const
{
return NP_VERSION_MINOR;
}
......
......@@ -834,7 +834,7 @@ void PluginView::setNPWindowRect(const IntRect& rect)
}
}
NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32 len, const char* buf)
NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32_t len, const char* buf)
{
String filename(buf, len);
......
2010-04-30 Anders Carlsson <andersca@apple.com>
Reviewed by Timothy Hatcher.
Next step towards fixing
https://bugs.webkit.org/show_bug.cgi?id=20784
move npapi.h to C99 integer types
Use the C99 types everywhere. The "old" types are still around but will be removed
in a subsequent commit.
* Plugins/WebBaseNetscapePluginStream.h:
* Plugins/WebBaseNetscapePluginStream.mm:
(WebNetscapePluginStream::deliverData):
* Plugins/WebNetscapePluginView.h:
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]):
(-[WebNetscapePluginView getAuthenticationInfoWithProtocol:host:port:scheme:realm:username:usernameLength:password:passwordLength:]):
* Plugins/npapi.mm:
(NPN_MemAlloc):
(NPN_MemFlush):
(NPN_PostURLNotify):
(NPN_PostURL):
(NPN_Write):
(NPN_ScheduleTimer):
(NPN_UnscheduleTimer):
(NPN_GetValueForURL):
(NPN_SetValueForURL):
(NPN_GetAuthenticationInfo):
(WKN_CheckIfAllowedToLoadURL):
(WKN_CancelCheckIfAllowedToLoadURL):
2010-04-29 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
......
......@@ -105,7 +105,7 @@ private:
NPP m_plugin;
uint16 m_transferMode;
int32 m_offset;
int32_t m_offset;
NPStream m_stream;
RetainPtr<NSString> m_path;
int m_fileDescriptor;
......
......@@ -507,12 +507,12 @@ void WebNetscapePluginStream::deliverData()
RefPtr<WebNetscapePluginStream> protect(this);
int32 totalBytes = [m_deliveryData.get() length];
int32 totalBytesDelivered = 0;
int32_t totalBytes = [m_deliveryData.get() length];
int32_t totalBytesDelivered = 0;
while (totalBytesDelivered < totalBytes) {
PluginStopDeferrer deferrer(m_pluginView.get());
int32 deliveryBytes = m_pluginFuncs->writeready(m_plugin, &m_stream);
int32_t deliveryBytes = m_pluginFuncs->writeready(m_plugin, &m_stream);
LOG(Plugins, "NPP_WriteReady responseURL=%@ bytes=%d", m_responseURL.get(), deliveryBytes);
if (m_isTerminated)
......@@ -533,7 +533,7 @@ void WebNetscapePluginStream::deliverData()
cancelLoadAndDestroyStreamWithError(pluginCancelledConnectionError());
return;
}
deliveryBytes = min<int32>(deliveryBytes, [subdata length]);
deliveryBytes = min<int32_t>(deliveryBytes, [subdata length]);
m_offset += deliveryBytes;
totalBytesDelivered += deliveryBytes;
LOG(Plugins, "NPP_Write responseURL=%@ bytes=%d total-delivered=%d/%d", m_responseURL.get(), deliveryBytes, m_offset, m_stream.end);
......
......@@ -89,13 +89,13 @@ typedef union PluginPort {
BOOL inSetWindow;
BOOL shouldStopSoon;
uint32 currentTimerID;
HashMap<uint32, PluginTimer*>* timers;
uint32_t currentTimerID;
HashMap<uint32_t, PluginTimer*>* timers;
unsigned pluginFunctionCallDepth;