--- a/webengine/osswebengine/WebCore/platform/network/ResourceHandle.cpp Thu Aug 19 10:58:56 2010 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/ResourceHandle.cpp Tue Aug 31 16:17:46 2010 +0300
@@ -34,8 +34,6 @@
namespace WebCore {
-static const unsigned invalidPortNumber = 0xFFFF;
-
ResourceHandle::ResourceHandle(const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading,
bool shouldContentSniff, bool mightDownloadFromHandle)
: d(new ResourceHandleInternal(this, request, client, defersLoading, shouldContentSniff, mightDownloadFromHandle))
@@ -73,9 +71,7 @@
ResourceHandleClient* ResourceHandle::client() const
{
- if(d && d->m_client)
- return d->m_client;
- return 0;
+ return d->m_client;
}
void ResourceHandle::setClient(ResourceHandleClient* client)
@@ -167,33 +163,17 @@
2049, // NFS
4045, // lockd
6000, // X11
- 6665, // Alternate IRC [Apple addition]
- 6666, // Alternate IRC [Apple addition]
- 6667, // Standard IRC [Apple addition]
- 6668, // Alternate IRC [Apple addition]
- 6669, // Alternate IRC [Apple addition]
- invalidPortNumber, // Used to block all invalid port numbers
};
const unsigned short* const blockedPortListEnd = blockedPortList
+ sizeof(blockedPortList) / sizeof(blockedPortList[0]);
+// fixme use the template
#if PLATFORM(SYMBIAN)
- bool found = false;
-
- for (int i = 0; i < sizeof(blockedPortList) / sizeof(blockedPortList[0]); ++i) {
- if (blockedPortList[i] == port) {
- found = true;
- break;
- }
- }
- // If the port is not in the blocked port list, allow it.
- if(!found) return true;
-
+ return true;
#else
// If the port is not in the blocked port list, allow it.
if (!std::binary_search(blockedPortList, blockedPortListEnd, port))
return true;
-#endif
// Allow ports 21 and 22 for FTP URLs, as Mozilla does.
if ((port == 21 || port == 22) && request.url().url().startsWith("ftp:", false))
@@ -204,6 +184,7 @@
return true;
return false;
+#endif
}
} // namespace WebCore