diff options
author | Ben Murdoch <benm@google.com> | 2010-05-11 18:35:50 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-05-14 10:23:05 +0100 |
commit | 21939df44de1705786c545cd1bf519d47250322d (patch) | |
tree | ef56c310f5c0cdc379c2abb2e212308a3281ce20 /WebKit/mac/Plugins | |
parent | 4ff1d8891d520763f17675827154340c7c740f90 (diff) | |
download | external_webkit-21939df44de1705786c545cd1bf519d47250322d.zip external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.gz external_webkit-21939df44de1705786c545cd1bf519d47250322d.tar.bz2 |
Merge Webkit at r58956: Initial merge by Git.
Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228
Diffstat (limited to 'WebKit/mac/Plugins')
-rw-r--r-- | WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm | 2 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebBaseNetscapePluginStream.h | 4 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm | 12 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebBaseNetscapePluginView.mm | 4 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebBasePluginPackage.mm | 6 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h | 10 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm | 6 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebNetscapeContainerCheckPrivate.h | 12 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebNetscapePluginPackage.h | 4 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebNetscapePluginPackage.mm | 6 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebNetscapePluginView.h | 28 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebNetscapePluginView.mm | 98 | ||||
-rw-r--r-- | WebKit/mac/Plugins/WebPluginDatabase.mm | 6 | ||||
-rw-r--r-- | WebKit/mac/Plugins/npapi.mm | 24 |
14 files changed, 115 insertions, 107 deletions
diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm index cd3724e..9da1b53 100644 --- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm +++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm @@ -46,6 +46,7 @@ #import <WebCore/runtime_root.h> #import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> +#import <wtf/Threading.h> using namespace WebCore; using namespace WebKit; @@ -60,6 +61,7 @@ extern "C" { + (void)initialize { JSC::initializeThreading(); + WTF::initializeMainThreadToProcessMainThread(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h index a28793a..8fbe262 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.h @@ -104,8 +104,8 @@ private: RetainPtr<NSString> m_mimeType; NPP m_plugin; - uint16 m_transferMode; - int32 m_offset; + uint16_t m_transferMode; + int32_t m_offset; NPStream m_stream; RetainPtr<NSString> m_path; int m_fileDescriptor; diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm index 232a6c4..7322d31 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm @@ -220,8 +220,8 @@ void WebNetscapePluginStream::startStream(NSURL *url, long long expectedContentL m_stream.url = strdup([m_responseURL.get() _web_URLCString]); m_stream.ndata = this; - m_stream.end = expectedContentLength > 0 ? (uint32)expectedContentLength : 0; - m_stream.lastmodified = (uint32)[lastModifiedDate timeIntervalSince1970]; + m_stream.end = expectedContentLength > 0 ? (uint32_t)expectedContentLength : 0; + m_stream.lastmodified = (uint32_t)[lastModifiedDate timeIntervalSince1970]; m_stream.notifyData = m_notifyData; if (headers) { @@ -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); diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index eec80f8..acd5152 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm @@ -41,7 +41,6 @@ #import "WebView.h" #import "WebViewInternal.h" -#import <WebCore/WebCoreObjCExtras.h> #import <WebCore/AuthenticationMac.h> #import <WebCore/BitmapImage.h> #import <WebCore/Credential.h> @@ -56,9 +55,11 @@ #import <WebCore/ProtectionSpace.h> #import <WebCore/RenderView.h> #import <WebCore/RenderWidget.h> +#import <WebCore/WebCoreObjCExtras.h> #import <WebKit/DOMPrivate.h> #import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> +#import <wtf/Threading.h> #import <wtf/text/CString.h> #define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification" @@ -115,6 +116,7 @@ String WebHaltablePlugin::pluginName() const + (void)initialize { JSC::initializeThreading(); + WTF::initializeMainThreadToProcessMainThread(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.mm b/WebKit/mac/Plugins/WebBasePluginPackage.mm index 1bddbcf..f186b81 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.mm +++ b/WebKit/mac/Plugins/WebBasePluginPackage.mm @@ -28,13 +28,14 @@ #import <WebKit/WebBasePluginPackage.h> +#import <WebCore/WebCoreObjCExtras.h> #import <WebKit/WebKitNSStringExtras.h> -#import <WebKit/WebNetscapePluginPackage.h> #import <WebKit/WebNSObjectExtras.h> +#import <WebKit/WebNetscapePluginPackage.h> #import <WebKit/WebPluginPackage.h> -#import <WebCore/WebCoreObjCExtras.h> #import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> +#import <wtf/Threading.h> #import <wtf/Vector.h> #import <WebKitSystemInterface.h> @@ -63,6 +64,7 @@ + (void)initialize { JSC::initializeThreading(); + WTF::initializeMainThreadToProcessMainThread(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif diff --git a/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h b/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h index e9b14a7..dcd4dd4 100644 --- a/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h +++ b/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h @@ -31,14 +31,14 @@ #if ENABLE(NETSCAPE_PLUGIN_API) @interface WebNetscapeContainerCheckContextInfo : NSObject { - uint32 _checkRequestID; - void (*_callback)(NPP npp, uint32, NPBool, void *); + uint32_t _checkRequestID; + void (*_callback)(NPP npp, uint32_t, NPBool, void *); void *_context; } -- (id)initWithCheckRequestID:(uint32)checkRequestID callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context; -- (uint32)checkRequestID; -- (void (*)(NPP npp, uint32, NPBool, void*))callback; +- (id)initWithCheckRequestID:(uint32_t)checkRequestID callbackFunc:(void (*)(NPP npp, uint32_t checkID, NPBool allowed, void* context))callbackFunc context:(void*)context; +- (uint32_t)checkRequestID; +- (void (*)(NPP npp, uint32_t, NPBool, void*))callback; - (void*)context; @end diff --git a/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm b/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm index 34a0ec1..8991c95 100644 --- a/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm +++ b/WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm @@ -29,7 +29,7 @@ @implementation WebNetscapeContainerCheckContextInfo -- (id)initWithCheckRequestID:(uint32)checkRequestID callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context +- (id)initWithCheckRequestID:(uint32_t)checkRequestID callbackFunc:(void (*)(NPP npp, uint32_t checkID, NPBool allowed, void* context))callbackFunc context:(void*)context { self = [super init]; if (!self) @@ -41,12 +41,12 @@ return self; } -- (uint32)checkRequestID +- (uint32_t)checkRequestID { return _checkRequestID; } -- (void (*)(NPP npp, uint32, NPBool, void*))callback +- (void (*)(NPP npp, uint32_t, NPBool, void*))callback { return _callback; } diff --git a/WebKit/mac/Plugins/WebNetscapeContainerCheckPrivate.h b/WebKit/mac/Plugins/WebNetscapeContainerCheckPrivate.h index dfde2f7..799680b 100644 --- a/WebKit/mac/Plugins/WebNetscapeContainerCheckPrivate.h +++ b/WebKit/mac/Plugins/WebNetscapeContainerCheckPrivate.h @@ -40,17 +40,17 @@ extern "C" { #define WKNVBrowserContainerCheckFuncsVersionHasGetLocation 2 -typedef uint32 (*WKN_CheckIfAllowedToLoadURLProcPtr)(NPP npp, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32, NPBool allowed, void* context), void* context); -typedef void (*WKN_CancelCheckIfAllowedToLoadURLProcPtr)(NPP npp, uint32); +typedef uint32_t (*WKN_CheckIfAllowedToLoadURLProcPtr)(NPP npp, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32_t, NPBool allowed, void* context), void* context); +typedef void (*WKN_CancelCheckIfAllowedToLoadURLProcPtr)(NPP npp, uint32_t); typedef char* (*WKN_ResolveURLProcPtr)(NPP npp, const char* url, const char* target); -uint32 WKN_CheckIfAllowedToLoadURL(NPP npp, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32, NPBool allowed, void* context), void* context); -void WKN_CancelCheckIfAllowedToLoadURL(NPP npp, uint32); +uint32_t WKN_CheckIfAllowedToLoadURL(NPP npp, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32_t, NPBool allowed, void* context), void* context); +void WKN_CancelCheckIfAllowedToLoadURL(NPP npp, uint32_t); char* WKN_ResolveURL(NPP npp, const char* url, const char* target); typedef struct _WKNBrowserContainerCheckFuncs { - uint16 size; - uint16 version; + uint16_t size; + uint16_t version; WKN_CheckIfAllowedToLoadURLProcPtr checkIfAllowedToLoadURL; WKN_CancelCheckIfAllowedToLoadURLProcPtr cancelCheckIfAllowedToLoadURL; diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.h b/WebKit/mac/Plugins/WebNetscapePluginPackage.h index 010956d..1d4c893 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginPackage.h +++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.h @@ -47,8 +47,8 @@ typedef enum { NPPluginFuncs pluginFuncs; NPNetscapeFuncs browserFuncs; - uint16 pluginSize; - uint16 pluginVersion; + uint16_t pluginSize; + uint16_t pluginVersion; ResFileRefNum resourceRef; diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.mm b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm index 5c10d95..5651e7e 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginPackage.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm @@ -697,11 +697,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); FunctionPointer functionPointerForTVector(TransitionVector tvp) { - const uint32 temp[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420}; - uint32 *newGlue = NULL; + const uint32_t temp[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420}; + uint32_t *newGlue = NULL; if (tvp != NULL) { - newGlue = (uint32 *)malloc(sizeof(temp)); + newGlue = (uint32_t *)malloc(sizeof(temp)); if (newGlue != NULL) { unsigned i; for (i = 0; i < 6; i++) newGlue[i] = temp[i]; diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.h b/WebKit/mac/Plugins/WebNetscapePluginView.h index 5bc4467..b2debfa 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginView.h +++ b/WebKit/mac/Plugins/WebNetscapePluginView.h @@ -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; - int32 specifiedHeight; - int32 specifiedWidth; + int32_t specifiedHeight; + int32_t specifiedWidth; HashSet<RefPtr<WebNetscapePluginStream> > streams; RetainPtr<NSMutableDictionary> _pendingFrameLoads; @@ -104,7 +104,7 @@ typedef union PluginPort { BOOL _isSilverlight; NSMutableDictionary *_containerChecksInProgress; - uint32 _currentContainerCheckRequestID; + uint32_t _currentContainerCheckRequestID; } + (WebNetscapePluginView *)currentPluginView; @@ -146,8 +146,8 @@ typedef union PluginPort { - (void)handleMouseEntered:(NSEvent *)event; - (void)handleMouseExited:(NSEvent *)event; -- (uint32)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context; -- (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID; +- (uint32_t)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString callbackFunc:(void (*)(NPP npp, uint32_t checkID, NPBool allowed, void* context))callbackFunc context:(void*)context; +- (void)cancelCheckIfAllowedToLoadURL:(uint32_t)checkID; @end @@ -172,14 +172,14 @@ typedef union PluginPort { - (void)forceRedraw; - (NPError)getVariable:(NPNVariable)variable value:(void *)value; - (NPError)setVariable:(NPPVariable)variable value:(void *)value; -- (uint32)scheduleTimerWithInterval:(uint32)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32 timerID))timerFunc; -- (void)unscheduleTimer:(uint32)timerID; +- (uint32_t)scheduleTimerWithInterval:(uint32_t)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32_t timerID))timerFunc; +- (void)unscheduleTimer:(uint32_t)timerID; - (NPError)popUpContextMenu:(NPMenu *)menu; -- (NPError)getVariable:(NPNURLVariable)variable forURL:(const char*)url value:(char**)value length:(uint32*)length; -- (NPError)setVariable:(NPNURLVariable)variable forURL:(const char*)url value:(const char*)value length:(uint32)length; -- (NPError)getAuthenticationInfoWithProtocol:(const char*) protocol host:(const char*)host port:(int32)port scheme:(const char*)scheme realm:(const char*)realm - username:(char**)username usernameLength:(uint32*)usernameLength - password:(char**)password passwordLength:(uint32*)passwordLength; +- (NPError)getVariable:(NPNURLVariable)variable forURL:(const char*)url value:(char**)value length:(uint32_t*)length; +- (NPError)setVariable:(NPNURLVariable)variable forURL:(const char*)url value:(const char*)value length:(uint32_t)length; +- (NPError)getAuthenticationInfoWithProtocol:(const char*) protocol host:(const char*)host port:(int32_t)port scheme:(const char*)scheme realm:(const char*)realm + username:(char**)username usernameLength:(uint32_t*)usernameLength + password:(char**)password passwordLength:(uint32_t*)passwordLength; - (char*)resolveURL:(const char*)url forTarget:(const char*)target; @end diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm index 388b84b..ebc3f85 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm @@ -30,13 +30,13 @@ #import "WebNetscapePluginView.h" +#import "WebBaseNetscapePluginStream.h" #import "WebDataSourceInternal.h" #import "WebDefaultUIDelegate.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebKitErrorsPrivate.h" #import "WebKitLogging.h" -#import "WebNetscapeContainerCheckPrivate.h" #import "WebKitNSStringExtras.h" #import "WebKitSystemInterface.h" #import "WebNSDataExtras.h" @@ -45,18 +45,16 @@ #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import "WebNSViewExtras.h" -#import "WebNetscapePluginPackage.h" -#import "WebBaseNetscapePluginStream.h" -#import "WebPluginContainerCheck.h" #import "WebNetscapeContainerCheckContextInfo.h" +#import "WebNetscapeContainerCheckPrivate.h" #import "WebNetscapePluginEventHandler.h" -#import "WebPreferences.h" +#import "WebNetscapePluginPackage.h" +#import "WebPluginContainerCheck.h" #import "WebPluginRequest.h" -#import "WebViewInternal.h" +#import "WebPreferences.h" #import "WebUIDelegatePrivate.h" +#import "WebViewInternal.h" #import <Carbon/Carbon.h> -#import <runtime/JSLock.h> -#import <WebCore/npruntime_impl.h> #import <WebCore/CookieJar.h> #import <WebCore/DocumentLoader.h> #import <WebCore/Element.h> @@ -71,12 +69,15 @@ #import <WebCore/SoftLinking.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebCoreURLResponse.h> +#import <WebCore/npruntime_impl.h> #import <WebKit/DOMPrivate.h> #import <WebKit/WebUIDelegate.h> +#import <objc/objc-runtime.h> #import <runtime/InitializeThreading.h> +#import <runtime/JSLock.h> #import <wtf/Assertions.h> +#import <wtf/Threading.h> #import <wtf/text/CString.h> -#import <objc/objc-runtime.h> #define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification" #define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification" @@ -112,9 +113,9 @@ static const double ThrottledTimerInterval = 0.25; class PluginTimer : public TimerBase { public: - typedef void (*TimerFunc)(NPP npp, uint32 timerID); + typedef void (*TimerFunc)(NPP npp, uint32_t timerID); - PluginTimer(NPP npp, uint32 timerID, uint32 interval, NPBool repeat, TimerFunc timerFunc) + PluginTimer(NPP npp, uint32_t timerID, uint32_t interval, NPBool repeat, TimerFunc timerFunc) : m_npp(npp) , m_timerID(timerID) , m_interval(interval) @@ -147,8 +148,8 @@ private: } NPP m_npp; - uint32 m_timerID; - uint32 m_interval; + uint32_t m_timerID; + uint32_t m_interval; NPBool m_repeat; TimerFunc m_timerFunc; }; @@ -188,6 +189,7 @@ typedef struct { + (void)initialize { JSC::initializeThreading(); + WTF::initializeMainThreadToProcessMainThread(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif @@ -252,20 +254,20 @@ static UInt32 getQDPixelFormatForBitmapContext(CGContextRef context) static inline void getNPRect(const CGRect& cgr, NPRect& npr) { - npr.top = static_cast<uint16>(cgr.origin.y); - npr.left = static_cast<uint16>(cgr.origin.x); - npr.bottom = static_cast<uint16>(CGRectGetMaxY(cgr)); - npr.right = static_cast<uint16>(CGRectGetMaxX(cgr)); + npr.top = static_cast<uint16_t>(cgr.origin.y); + npr.left = static_cast<uint16_t>(cgr.origin.x); + npr.bottom = static_cast<uint16_t>(CGRectGetMaxY(cgr)); + npr.right = static_cast<uint16_t>(CGRectGetMaxX(cgr)); } #endif static inline void getNPRect(const NSRect& nr, NPRect& npr) { - npr.top = static_cast<uint16>(nr.origin.y); - npr.left = static_cast<uint16>(nr.origin.x); - npr.bottom = static_cast<uint16>(NSMaxY(nr)); - npr.right = static_cast<uint16>(NSMaxX(nr)); + npr.top = static_cast<uint16_t>(nr.origin.y); + npr.left = static_cast<uint16_t>(nr.origin.x); + npr.bottom = static_cast<uint16_t>(NSMaxY(nr)); + npr.right = static_cast<uint16_t>(NSMaxX(nr)); } - (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate @@ -304,10 +306,10 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) #endif window.type = NPWindowTypeWindow; - window.x = (int32)boundsInWindow.origin.x; - window.y = (int32)boundsInWindow.origin.y; - window.width = static_cast<uint32>(NSWidth(boundsInWindow)); - window.height = static_cast<uint32>(NSHeight(boundsInWindow)); + window.x = (int32_t)boundsInWindow.origin.x; + window.y = (int32_t)boundsInWindow.origin.y; + window.width = static_cast<uint32_t>(NSWidth(boundsInWindow)); + window.height = static_cast<uint32_t>(NSHeight(boundsInWindow)); // "Clip-out" the plug-in when: // 1) it's not really in a window or off-screen or has no height or width. @@ -353,8 +355,8 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) CGrafPtr port = GetWindowPort(windowRef); GetPortBounds(port, &portBounds); nPort.qdPort.port = port; - nPort.qdPort.portx = (int32)-boundsInWindow.origin.x; - nPort.qdPort.porty = (int32)-boundsInWindow.origin.y; + nPort.qdPort.portx = (int32_t)-boundsInWindow.origin.x; + nPort.qdPort.porty = (int32_t)-boundsInWindow.origin.y; window.window = &nPort; PortState_QD *qdPortState = (PortState_QD*)malloc(sizeof(PortState_QD)); @@ -417,8 +419,8 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) origin.x = offscreenBounds.left - origin.x * (axisFlip.x - origin.x); origin.y = offscreenBounds.bottom + origin.y * (axisFlip.y - origin.y); - nPort.qdPort.portx = static_cast<int32>(-boundsInWindow.origin.x + origin.x); - nPort.qdPort.porty = static_cast<int32>(-boundsInWindow.origin.y - origin.y); + nPort.qdPort.portx = static_cast<int32_t>(-boundsInWindow.origin.x + origin.x); + nPort.qdPort.porty = static_cast<int32_t>(-boundsInWindow.origin.y - origin.y); window.x = 0; window.y = 0; window.window = &nPort; @@ -697,8 +699,8 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) if (!timers) return; - HashMap<uint32, PluginTimer*>::const_iterator end = timers->end(); - for (HashMap<uint32, PluginTimer*>::const_iterator it = timers->begin(); it != end; ++it) { + HashMap<uint32_t, PluginTimer*>::const_iterator end = timers->end(); + for (HashMap<uint32_t, PluginTimer*>::const_iterator it = timers->begin(); it != end; ++it) { PluginTimer* timer = it->second; timer->stop(); } @@ -715,8 +717,8 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) if (!timers) return; - HashMap<uint32, PluginTimer*>::const_iterator end = timers->end(); - for (HashMap<uint32, PluginTimer*>::const_iterator it = timers->begin(); it != end; ++it) { + HashMap<uint32_t, PluginTimer*>::const_iterator end = timers->end(); + for (HashMap<uint32_t, PluginTimer*>::const_iterator it = timers->begin(); it != end; ++it) { PluginTimer* timer = it->second; ASSERT(!timer->isActive()); timer->start(_isCompletelyObscured); @@ -1235,9 +1237,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) } } -- (uint32)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString - callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc - context:(void*)context +- (uint32_t)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString + callbackFunc:(void (*)(NPP npp, uint32_t checkID, NPBool allowed, void* context))callbackFunc + context:(void*)context { if (!_containerChecksInProgress) _containerChecksInProgress = [[NSMutableDictionary alloc] init]; @@ -1266,7 +1268,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) - (void)_containerCheckResult:(PolicyAction)policy contextInfo:(id)contextInfo { ASSERT([contextInfo isKindOfClass:[WebNetscapeContainerCheckContextInfo class]]); - void (*pluginCallback)(NPP npp, uint32, NPBool, void*) = [contextInfo callback]; + void (*pluginCallback)(NPP npp, uint32_t, NPBool, void*) = [contextInfo callback]; if (!pluginCallback) { ASSERT_NOT_REACHED(); @@ -1276,7 +1278,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) pluginCallback([self plugin], [contextInfo checkRequestID], (policy == PolicyUse), [contextInfo context]); } -- (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID +- (void)cancelCheckIfAllowedToLoadURL:(uint32_t)checkID { WebPluginContainerCheck *check = (WebPluginContainerCheck *)[_containerChecksInProgress objectForKey:[NSNumber numberWithInt:checkID]]; @@ -1402,7 +1404,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) if (!_isStarted) return; - if ([NSGraphicsContext currentContextDrawingToScreen]) + if ([NSGraphicsContext currentContextDrawingToScreen] || _isFlash) [self sendDrawRectEvent:rect]; else { NSBitmapImageRep *printedPluginBitmap = [self _printedPluginBitmap]; @@ -2131,15 +2133,15 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) } } -- (uint32)scheduleTimerWithInterval:(uint32)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32 timerID))timerFunc +- (uint32_t)scheduleTimerWithInterval:(uint32_t)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32_t timerID))timerFunc { if (!timerFunc) return 0; if (!timers) - timers = new HashMap<uint32, PluginTimer*>; + timers = new HashMap<uint32_t, PluginTimer*>; - uint32 timerID; + uint32_t timerID; do { timerID = ++currentTimerID; @@ -2154,7 +2156,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) return timerID; } -- (void)unscheduleTimer:(uint32)timerID +- (void)unscheduleTimer:(uint32_t)timerID { if (!timers) return; @@ -2175,7 +2177,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) return NPERR_NO_ERROR; } -- (NPError)getVariable:(NPNURLVariable)variable forURL:(const char*)url value:(char**)value length:(uint32*)length +- (NPError)getVariable:(NPNURLVariable)variable forURL:(const char*)url value:(char**)value length:(uint32_t*)length { switch (variable) { case NPNURLVCookie: { @@ -2227,7 +2229,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) return NPERR_GENERIC_ERROR; } -- (NPError)setVariable:(NPNURLVariable)variable forURL:(const char*)url value:(const char*)value length:(uint32)length +- (NPError)setVariable:(NPNURLVariable)variable forURL:(const char*)url value:(const char*)value length:(uint32_t)length { switch (variable) { case NPNURLVCookie: { @@ -2253,9 +2255,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) return NPERR_GENERIC_ERROR; } -- (NPError)getAuthenticationInfoWithProtocol:(const char*)protocolStr host:(const char*)hostStr port:(int32)port scheme:(const char*)schemeStr realm:(const char*)realmStr - username:(char**)usernameStr usernameLength:(uint32*)usernameLength - password:(char**)passwordStr passwordLength:(uint32*)passwordLength +- (NPError)getAuthenticationInfoWithProtocol:(const char*)protocolStr host:(const char*)hostStr port:(int32_t)port scheme:(const char*)schemeStr realm:(const char*)realmStr + username:(char**)usernameStr usernameLength:(uint32_t*)usernameLength + password:(char**)passwordStr passwordLength:(uint32_t*)passwordLength { if (!protocolStr || !hostStr || !schemeStr || !realmStr || !usernameStr || !usernameLength || !passwordStr || !passwordLength) return NPERR_GENERIC_ERROR; diff --git a/WebKit/mac/Plugins/WebPluginDatabase.mm b/WebKit/mac/Plugins/WebPluginDatabase.mm index 1856fe1..34f5e0f 100644 --- a/WebKit/mac/Plugins/WebPluginDatabase.mm +++ b/WebKit/mac/Plugins/WebPluginDatabase.mm @@ -35,13 +35,13 @@ #import "WebFrameViewInternal.h" #import "WebHTMLRepresentation.h" #import "WebHTMLView.h" -#import "WebHTMLView.h" #import "WebKitLogging.h" #import "WebNSFileManagerExtras.h" #import "WebNetscapePluginPackage.h" #import "WebPluginController.h" #import "WebPluginPackage.h" #import "WebViewPrivate.h" +#import "WebViewInternal.h" #import <WebKitSystemInterface.h> #import <wtf/Assertions.h> @@ -296,7 +296,7 @@ static NSArray *additionalWebPlugInPaths; continue; if (self == sharedDatabase) - [WebView registerViewClass:[WebHTMLView class] representationClass:[WebHTMLRepresentation class] forMIMEType:MIMEType]; + [WebView _registerPluginMIMEType:MIMEType]; } [MIMETypes release]; @@ -415,7 +415,7 @@ static NSArray *additionalWebPlugInPaths; while ((MIMEType = [MIMETypeEnumerator nextObject])) { if ([registeredMIMETypes containsObject:MIMEType]) { if (self == sharedDatabase) - [WebView _unregisterViewClassAndRepresentationClassForMIMEType:MIMEType]; + [WebView _unregisterPluginMIMEType:MIMEType]; [registeredMIMETypes removeObject:MIMEType]; } } diff --git a/WebKit/mac/Plugins/npapi.mm b/WebKit/mac/Plugins/npapi.mm index 51c37ae..8b1cfd6 100644 --- a/WebKit/mac/Plugins/npapi.mm +++ b/WebKit/mac/Plugins/npapi.mm @@ -39,7 +39,7 @@ WebNetscapePluginView *pluginViewForInstance(NPP instance); // general plug-in to browser functions -void* NPN_MemAlloc(uint32 size) +void* NPN_MemAlloc(uint32_t size) { return malloc(size); } @@ -49,7 +49,7 @@ void NPN_MemFree(void* ptr) free(ptr); } -uint32 NPN_MemFlush(uint32 size) +uint32_t NPN_MemFlush(uint32_t size) { LOG(Plugins, "NPN_MemFlush"); return size; @@ -89,12 +89,12 @@ NPError NPN_GetURL(NPP instance, const char* URL, const char* target) return [pluginViewForInstance(instance) getURL:URL target: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:target len:len buf:buf file:file notifyData: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:target len:len buf:buf file:file]; } @@ -104,7 +104,7 @@ NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStrea return [pluginViewForInstance(instance) newStream:type target:target stream: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:len buffer:buffer]; } @@ -176,12 +176,12 @@ void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userDa PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData); } -uint32 NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID)) +uint32_t NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID)) { return [pluginViewForInstance(instance) scheduleTimerWithInterval:interval repeat:repeat timerFunc:timerFunc]; } -void NPN_UnscheduleTimer(NPP instance, uint32 timerID) +void NPN_UnscheduleTimer(NPP instance, uint32_t timerID) { [pluginViewForInstance(instance) unscheduleTimer:timerID]; } @@ -191,17 +191,17 @@ NPError NPN_PopUpContextMenu(NPP instance, NPMenu *menu) return [pluginViewForInstance(instance) popUpContextMenu:menu]; } -NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32* len) +NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32_t* len) { return [pluginViewForInstance(instance) getVariable:variable forURL:url value:value length:len]; } -NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32 len) +NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32_t len) { return [pluginViewForInstance(instance) setVariable:variable forURL:url value:value length: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) +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) { return [pluginViewForInstance(instance) getAuthenticationInfoWithProtocol:protocol host:host @@ -217,12 +217,12 @@ NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordina return [pluginViewForInstance(instance) convertFromX:sourceX andY:sourceY space:sourceSpace toX:destX andY:destY space:destSpace]; } -uint32 WKN_CheckIfAllowedToLoadURL(NPP instance, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32, NPBool, void*), void* context) +uint32_t WKN_CheckIfAllowedToLoadURL(NPP instance, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32_t, NPBool, void*), void* context) { return [pluginViewForInstance(instance) checkIfAllowedToLoadURL:url frame:frame callbackFunc:callbackFunc context:context]; } -void WKN_CancelCheckIfAllowedToLoadURL(NPP instance, uint32 checkID) +void WKN_CancelCheckIfAllowedToLoadURL(NPP instance, uint32_t checkID) { [pluginViewForInstance(instance) cancelCheckIfAllowedToLoadURL:checkID]; } |