Changeset 68951 in webkit
- Timestamp:
- Oct 1, 2010 4:28:17 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r68942 r68951 1 2010-10-01 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Add proxy server query function proxyServersForURL and change the Mac plug-in code to use it 6 https://bugs.webkit.org/show_bug.cgi?id=47022 7 <rdar://problem/8504712> 8 9 * WebCore.exp.in: 10 Export proxyServersForURL and toString. 11 12 * WebCore.vcproj/WebCore.vcproj: 13 * WebCore.xcodeproj/project.pbxproj: 14 Add new files. 15 16 * platform/network/ProxyServer.cpp: Added. 17 (WebCore::appendProxyServerString): 18 (WebCore::toString): 19 New function that converts a vector of ProxyServers into a PAC style string. 20 21 * platform/network/ProxyServer.h: Added. 22 (WebCore::ProxyServer::ProxyServer): 23 (WebCore::ProxyServer::type): 24 (WebCore::ProxyServer::hostName): 25 (WebCore::ProxyServer::port): 26 Add ProxyServer class. 27 28 * platform/network/cf/ProxyServerCFNet.cpp: Added. 29 (WebCore::proxyServersForURL): 30 (WebCore::addProxyServersForURL): 31 Query CFNetwork for the proxy servers given a URL. 32 1 33 2010-09-30 Zhenyao Mo <zmo@google.com> 2 34 -
trunk/WebCore/WebCore.exp.in
r68854 r68951 415 415 __ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE 416 416 __ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE 417 __ZN7WebCore18proxyServersForURLERKNS_4KURLE 417 418 __ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE 418 419 __ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE … … 760 761 __ZN7WebCore8blankURLEv 761 762 __ZN7WebCore8makeRGBAEiiii 763 __ZN7WebCore8toStringERKN3WTF6VectorINS_11ProxyServerELm0EEE 762 764 __ZN7WebCore9DOMWindow30dispatchAllPendingUnloadEventsEv 763 765 __ZN7WebCore9DOMWindow36dispatchAllPendingBeforeUnloadEventsEv -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r68905 r68951 27385 27385 </File> 27386 27386 <File 27387 RelativePath="..\platform\network\ProxyServer.cpp" 27388 > 27389 </File> 27390 <File 27391 RelativePath="..\platform\network\ProxyServer.h" 27392 > 27393 </File> 27394 <File 27387 27395 RelativePath="..\platform\network\ResourceErrorBase.cpp" 27388 27396 > … … 27602 27610 RelativePath="..\platform\network\cf\LoaderRunLoopCF.h" 27603 27611 > 27612 </File> 27613 <File 27614 RelativePath="..\platform\network\cf\ProxyServerCFNet.cpp" 27615 > 27616 <FileConfiguration 27617 Name="Debug_Cairo|Win32" 27618 ExcludedFromBuild="true" 27619 > 27620 <Tool 27621 Name="VCCLCompilerTool" 27622 /> 27623 </FileConfiguration> 27624 <FileConfiguration 27625 Name="Release_Cairo|Win32" 27626 ExcludedFromBuild="true" 27627 > 27628 <Tool 27629 Name="VCCLCompilerTool" 27630 /> 27631 </FileConfiguration> 27604 27632 </File> 27605 27633 <File -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r68878 r68951 595 595 1AE82FED0CAB07EE002237AE /* JSSQLResultSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE82FEB0CAB07EE002237AE /* JSSQLResultSet.h */; }; 596 596 1AF326790D78B9440068F0C4 /* EditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF326770D78B9440068F0C4 /* EditorClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 597 1AF8E11A1256592600230FF7 /* ProxyServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF8E1191256592600230FF7 /* ProxyServer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 598 1AF8E13312565A4400230FF7 /* ProxyServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF8E13212565A4400230FF7 /* ProxyServer.cpp */; }; 599 1AF8E1C3125673E000230FF7 /* ProxyServerCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF8E1C1125673E000230FF7 /* ProxyServerCFNet.cpp */; }; 597 600 1AFE117D0CBFFB36003017FA /* SQLResultSetRowList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFE117B0CBFFB36003017FA /* SQLResultSetRowList.cpp */; }; 598 601 1AFE117E0CBFFB36003017FA /* SQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE117C0CBFFB36003017FA /* SQLResultSetRowList.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6582 6585 1AE82FEB0CAB07EE002237AE /* JSSQLResultSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSet.h; sourceTree = "<group>"; }; 6583 6586 1AF326770D78B9440068F0C4 /* EditorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditorClient.h; sourceTree = "<group>"; }; 6587 1AF8E1191256592600230FF7 /* ProxyServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyServer.h; sourceTree = "<group>"; }; 6588 1AF8E13212565A4400230FF7 /* ProxyServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProxyServer.cpp; sourceTree = "<group>"; }; 6589 1AF8E1C1125673E000230FF7 /* ProxyServerCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProxyServerCFNet.cpp; sourceTree = "<group>"; }; 6584 6590 1AFE117B0CBFFB36003017FA /* SQLResultSetRowList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLResultSetRowList.cpp; sourceTree = "<group>"; }; 6585 6591 1AFE117C0CBFFB36003017FA /* SQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLResultSetRowList.h; sourceTree = "<group>"; }; … … 7286 7292 51A9267B0D53F0570063ECC2 /* OriginUsageRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginUsageRecord.h; sourceTree = "<group>"; }; 7287 7293 51AA3F6E0BD5AA9E00892971 /* ResourceLoaderMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceLoaderMac.mm; sourceTree = "<group>"; }; 7288 51ABAE1A103C18FF008C5260 /* SocketStreamError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocketStreamError.h; path = cf/SocketStreamError.h; sourceTree = "<group>"; };7289 51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocketStreamHandle.h; path = cf/SocketStreamHandle.h; sourceTree = "<group>"; };7290 51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocketStreamHandleCFNet.cpp; path = cf/SocketStreamHandleCFNet.cpp; sourceTree = "<group>"; };7294 51ABAE1A103C18FF008C5260 /* SocketStreamError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamError.h; sourceTree = "<group>"; }; 7295 51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SocketStreamHandle.h; path = ../qt/SocketStreamHandle.h; sourceTree = "<group>"; }; 7296 51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketStreamHandleCFNet.cpp; sourceTree = "<group>"; }; 7291 7297 51ABAE421043AB4A008C5260 /* WebSocketHandshake.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshake.cpp; sourceTree = "<group>"; }; 7292 7298 51ABAE431043AB4A008C5260 /* WebSocketHandshake.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshake.h; sourceTree = "<group>"; }; … … 10206 10212 B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContextCG.cpp; sourceTree = "<group>"; }; 10207 10213 B2F34FE50E82F81400F627CD /* DNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNS.h; sourceTree = "<group>"; }; 10208 B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DNSCFNet.cpp; path = cf/DNSCFNet.cpp; sourceTree = "<group>"; };10214 B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNSCFNet.cpp; sourceTree = "<group>"; }; 10209 10215 B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGAnimateColorElement.cpp; sourceTree = "<group>"; }; 10210 10216 B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGAnimateColorElement.h; sourceTree = "<group>"; }; … … 12839 12845 514C765F0CE923A1007EF3CD /* ProtectionSpace.cpp */, 12840 12846 514C76600CE923A1007EF3CD /* ProtectionSpace.h */, 12847 1AF8E13212565A4400230FF7 /* ProxyServer.cpp */, 12848 1AF8E1191256592600230FF7 /* ProxyServer.h */, 12841 12849 51A052551058874000CC9E95 /* ProtectionSpaceHash.h */, 12842 12850 934F713D0D5A6F2800018D69 /* ResourceErrorBase.cpp */, … … 16498 16506 children = ( 16499 16507 B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */, 16508 1AF8E1C1125673E000230FF7 /* ProxyServerCFNet.cpp */, 16500 16509 51ABAE1A103C18FF008C5260 /* SocketStreamError.h */, 16501 16510 51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */, 16502 16511 51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */, 16503 16512 ); 16504 name= cf;16513 path = cf; 16505 16514 sourceTree = "<group>"; 16506 16515 }; … … 20952 20961 080E49261255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.h in Headers */, 20953 20962 080E49281255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.h in Headers */, 20963 1AF8E11A1256592600230FF7 /* ProxyServer.h in Headers */, 20954 20964 ); 20955 20965 runOnlyForDeploymentPostprocessing = 0; … … 21011 21021 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 21012 21022 compatibilityVersion = "Xcode 2.4"; 21023 developmentRegion = English; 21013 21024 hasScannedForEncodings = 1; 21014 21025 knownRegions = ( … … 23480 23491 080E49251255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.cpp in Sources */, 23481 23492 080E49271255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.cpp in Sources */, 23493 1AF8E13312565A4400230FF7 /* ProxyServer.cpp in Sources */, 23494 1AF8E1C3125673E000230FF7 /* ProxyServerCFNet.cpp in Sources */, 23482 23495 ); 23483 23496 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit/mac/ChangeLog
r68854 r68951 1 2010-10-01 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Add proxy server query function proxyServersForURL and change the Mac plug-in code to use it 6 https://bugs.webkit.org/show_bug.cgi?id=47022 7 <rdar://problem/8504712> 8 9 * Plugins/Hosted/NetscapePluginInstanceProxy.mm: 10 (WebKit::NetscapePluginInstanceProxy::getProxy): 11 * Plugins/WebBaseNetscapePluginView.h: 12 * Plugins/WebBaseNetscapePluginView.mm: 13 * Plugins/WebNetscapePluginView.mm: 14 (-[WebNetscapePluginView getVariable:forURL:value:length:]): 15 1 16 2010-09-30 Darin Adler <darin@apple.com> 2 17 -
trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
r68160 r68951 51 51 #import <WebCore/FrameTree.h> 52 52 #import <WebCore/KURL.h> 53 #import <WebCore/ProxyServer.h> 53 54 #import <WebCore/SecurityOrigin.h> 54 55 #import <WebCore/ScriptController.h> … … 1558 1559 return false; 1559 1560 1560 WTF::CString proxyStringUTF8 = proxiesForURL(url); 1561 Vector<ProxyServer> proxyServers = proxyServersForURL(URL); 1562 WTF::CString proxyStringUTF8 = toString(proxyServers).utf8(); 1561 1563 1562 1564 proxyLength = proxyStringUTF8.length(); -
trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h
r65021 r68951 146 146 147 147 namespace WebKit { 148 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)149 WTF::CString proxiesForURL(NSURL *);150 #endif151 152 148 bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr, 153 149 WTF::CString& username, WTF::CString& password); -
trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
r65904 r68951 961 961 namespace WebKit { 962 962 963 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)964 CString proxiesForURL(NSURL *url)965 {966 RetainPtr<CFDictionaryRef> systemProxies(AdoptCF, CFNetworkCopySystemProxySettings());967 if (!systemProxies)968 return "DIRECT";969 970 RetainPtr<CFArrayRef> proxiesForURL(AdoptCF, CFNetworkCopyProxiesForURL((CFURLRef)url, systemProxies.get()));971 CFIndex proxyCount = proxiesForURL ? CFArrayGetCount(proxiesForURL.get()) : 0;972 if (!proxyCount)973 return "DIRECT";974 975 // proxiesForURL is a CFArray of CFDictionaries. Each dictionary represents a proxy.976 // The format of the result should be:977 // "PROXY host[:port]" (for HTTP proxy) or978 // "SOCKS host[:port]" (for SOCKS proxy) or979 // A combination of the above, separated by semicolon, in the order that they should be tried.980 String proxies;981 for (CFIndex i = 0; i < proxyCount; ++i) {982 CFDictionaryRef proxy = static_cast<CFDictionaryRef>(CFArrayGetValueAtIndex(proxiesForURL.get(), i));983 if (!proxy)984 continue;985 986 CFStringRef type = static_cast<CFStringRef>(CFDictionaryGetValue(proxy, kCFProxyTypeKey));987 bool isHTTP = type == kCFProxyTypeHTTP || type == kCFProxyTypeHTTPS;988 bool isSOCKS = type == kCFProxyTypeSOCKS;989 990 // We can only report HTTP and SOCKS proxies.991 if (!isHTTP && !isSOCKS)992 continue;993 994 CFStringRef host = static_cast<CFStringRef>(CFDictionaryGetValue(proxy, kCFProxyHostNameKey));995 CFNumberRef port = static_cast<CFNumberRef>(CFDictionaryGetValue(proxy, kCFProxyPortNumberKey));996 997 // If we are inserting multiple entries, add a separator998 if (!proxies.isEmpty())999 proxies += ";";1000 1001 if (isHTTP)1002 proxies += "PROXY ";1003 else if (isSOCKS)1004 proxies += "SOCKS ";1005 1006 proxies += host;1007 1008 if (port) {1009 SInt32 intPort;1010 CFNumberGetValue(port, kCFNumberSInt32Type, &intPort);1011 1012 proxies += ":" + String::number(intPort);1013 }1014 }1015 1016 if (proxies.isEmpty())1017 return "DIRECT";1018 1019 return proxies.utf8();1020 }1021 #endif1022 1023 963 bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr, 1024 964 CString& username, CString& password) -
trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm
r68630 r68951 67 67 #import <WebCore/Page.h> 68 68 #import <WebCore/PluginMainThreadScheduler.h> 69 #import <WebCore/ProxyServer.h> 69 70 #import <WebCore/ScriptController.h> 70 71 #import <WebCore/SecurityOrigin.h> … … 2240 2241 break; 2241 2242 2242 CString proxiesUTF8 = proxiesForURL(URL); 2243 Vector<ProxyServer> proxyServers = proxyServersForURL(URL); 2244 CString proxiesUTF8 = toString(proxyServers).utf8(); 2243 2245 2244 2246 *value = static_cast<char*>(NPN_MemAlloc(proxiesUTF8.length()));
Note: See TracChangeset
for help on using the changeset viewer.