summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/mac/Plugins')
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm4
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.h4
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.mm60
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm14
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm4
5 files changed, 13 insertions, 73 deletions
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index e03bc27..0b9036a 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -50,6 +50,7 @@
#import <WebCore/FrameLoader.h>
#import <WebCore/FrameTree.h>
#import <WebCore/KURL.h>
+#import <WebCore/ProxyServer.h>
#import <WebCore/SecurityOrigin.h>
#import <WebCore/ScriptController.h>
#import <WebCore/ScriptValue.h>
@@ -1557,7 +1558,8 @@ bool NetscapePluginInstanceProxy::getProxy(data_t urlData, mach_msg_type_number_
if (!url)
return false;
- WTF::CString proxyStringUTF8 = proxiesForURL(url);
+ Vector<ProxyServer> proxyServers = proxyServersForURL(url, 0);
+ WTF::CString proxyStringUTF8 = toString(proxyServers).utf8();
proxyLength = proxyStringUTF8.length();
mig_allocate(reinterpret_cast<vm_address_t*>(&proxyData), proxyLength);
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
index 9a29cc2..1a4b6bb 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
@@ -145,10 +145,6 @@ class WebHaltablePlugin;
namespace WebKit {
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-WTF::CString proxiesForURL(NSURL *);
-#endif
-
bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr,
WTF::CString& username, WTF::CString& password);
}
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index 4966716..708b017 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -960,66 +960,6 @@ String WebHaltablePlugin::pluginName() const
namespace WebKit {
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
-CString proxiesForURL(NSURL *url)
-{
- RetainPtr<CFDictionaryRef> systemProxies(AdoptCF, CFNetworkCopySystemProxySettings());
- if (!systemProxies)
- return "DIRECT";
-
- RetainPtr<CFArrayRef> proxiesForURL(AdoptCF, CFNetworkCopyProxiesForURL((CFURLRef)url, systemProxies.get()));
- CFIndex proxyCount = proxiesForURL ? CFArrayGetCount(proxiesForURL.get()) : 0;
- if (!proxyCount)
- return "DIRECT";
-
- // proxiesForURL is a CFArray of CFDictionaries. Each dictionary represents a proxy.
- // The format of the result should be:
- // "PROXY host[:port]" (for HTTP proxy) or
- // "SOCKS host[:port]" (for SOCKS proxy) or
- // A combination of the above, separated by semicolon, in the order that they should be tried.
- String proxies;
- for (CFIndex i = 0; i < proxyCount; ++i) {
- CFDictionaryRef proxy = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(proxiesForURL.get(), i));
- if (!proxy)
- continue;
-
- CFStringRef type = static_cast<CFStringRef>(CFDictionaryGetValue(proxy, kCFProxyTypeKey));
- bool isHTTP = type == kCFProxyTypeHTTP || type == kCFProxyTypeHTTPS;
- bool isSOCKS = type == kCFProxyTypeSOCKS;
-
- // We can only report HTTP and SOCKS proxies.
- if (!isHTTP && !isSOCKS)
- continue;
-
- CFStringRef host = static_cast<CFStringRef>(CFDictionaryGetValue(proxy, kCFProxyHostNameKey));
- CFNumberRef port = static_cast<CFNumberRef>(CFDictionaryGetValue(proxy, kCFProxyPortNumberKey));
-
- // If we are inserting multiple entries, add a separator
- if (!proxies.isEmpty())
- proxies += ";";
-
- if (isHTTP)
- proxies += "PROXY ";
- else if (isSOCKS)
- proxies += "SOCKS ";
-
- proxies += host;
-
- if (port) {
- SInt32 intPort;
- CFNumberGetValue(port, kCFNumberSInt32Type, &intPort);
-
- proxies += ":" + String::number(intPort);
- }
- }
-
- if (proxies.isEmpty())
- return "DIRECT";
-
- return proxies.utf8();
-}
-#endif
-
bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr,
CString& username, CString& password)
{
diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
index a5e8f73..3d2b68e 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm
@@ -174,7 +174,7 @@ void WebNetscapePluginEventHandlerCarbon::mouseEntered(NSEvent* theEvent)
EventRecord event;
getCarbonEvent(&event, theEvent);
- event.what = adjustCursorEvent;
+ event.what = NPEventType_AdjustCursorEvent;
BOOL acceptedEvent;
acceptedEvent = sendEvent(&event);
@@ -187,7 +187,7 @@ void WebNetscapePluginEventHandlerCarbon::mouseExited(NSEvent* theEvent)
EventRecord event;
getCarbonEvent(&event, theEvent);
- event.what = adjustCursorEvent;
+ event.what = NPEventType_AdjustCursorEvent;
BOOL acceptedEvent;
acceptedEvent = sendEvent(&event);
@@ -204,7 +204,7 @@ void WebNetscapePluginEventHandlerCarbon::mouseMoved(NSEvent* theEvent)
EventRecord event;
getCarbonEvent(&event, theEvent);
- event.what = adjustCursorEvent;
+ event.what = NPEventType_AdjustCursorEvent;
BOOL acceptedEvent;
acceptedEvent = sendEvent(&event);
@@ -271,14 +271,14 @@ void WebNetscapePluginEventHandlerCarbon::focusChanged(bool hasFocus)
getCarbonEvent(&event);
bool acceptedEvent;
if (hasFocus) {
- event.what = getFocusEvent;
+ event.what = NPEventType_GetFocusEvent;
acceptedEvent = sendEvent(&event);
- LOG(PluginEvents, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent);
+ LOG(PluginEvents, "NPP_HandleEvent(NPEventType_GetFocusEvent): %d", acceptedEvent);
installKeyEventHandler();
} else {
- event.what = loseFocusEvent;
+ event.what = NPEventType_LoseFocusEvent;
acceptedEvent = sendEvent(&event);
- LOG(PluginEvents, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent);
+ LOG(PluginEvents, "NPP_HandleEvent(NPEventType_LoseFocusEvent): %d", acceptedEvent);
removeKeyEventHandler();
}
}
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index ff0ca77..48574bf 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -66,6 +66,7 @@
#import <WebCore/HTMLPlugInElement.h>
#import <WebCore/Page.h>
#import <WebCore/PluginMainThreadScheduler.h>
+#import <WebCore/ProxyServer.h>
#import <WebCore/ScriptController.h>
#import <WebCore/SecurityOrigin.h>
#import <WebCore/SoftLinking.h>
@@ -2239,7 +2240,8 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
if (!URL)
break;
- CString proxiesUTF8 = proxiesForURL(URL);
+ Vector<ProxyServer> proxyServers = proxyServersForURL(URL, 0);
+ CString proxiesUTF8 = toString(proxyServers).utf8();
*value = static_cast<char*>(NPN_MemAlloc(proxiesUTF8.length()));
memcpy(*value, proxiesUTF8.data(), proxiesUTF8.length());