Chromium Code Reviews| Index: Source/platform/weborigin/KnownPorts.cpp |
| diff --git a/Source/platform/weborigin/KnownPorts.cpp b/Source/platform/weborigin/KnownPorts.cpp |
| index 71499a5120c0c30971113663f74560f12173b096..b289ef258891c62030bfa5cd626009e1ea196df3 100644 |
| --- a/Source/platform/weborigin/KnownPorts.cpp |
| +++ b/Source/platform/weborigin/KnownPorts.cpp |
| @@ -40,15 +40,16 @@ bool isDefaultPortForProtocol(unsigned short port, const String& protocol) |
| if (protocol.isEmpty()) |
| return false; |
| - typedef HashMap<String, unsigned, CaseFoldingHash> DefaultPortsMap; |
| - AtomicallyInitializedStaticReference(DefaultPortsMap, defaultPorts, new DefaultPortsMap()); |
| - if (defaultPorts.isEmpty()) { |
| - defaultPorts.set("http", 80); |
| - defaultPorts.set("https", 443); |
| - defaultPorts.set("ftp", 21); |
| - defaultPorts.set("ftps", 990); |
| - } |
| - return defaultPorts.get(protocol) == port; |
| + if (protocol == "http") |
| + return port == 80; |
| + if (protocol == "https") |
| + return port == 443; |
| + if (protocol == "ftp") |
| + return port == 21; |
| + if (protocol == "ftps") |
| + return port == 990; |
|
kinuko
2015/02/03 03:52:32
Switching on port number, and then comparing proto
Ian Wen
2015/02/03 19:08:54
Indeed. Done.
|
| + |
| + return false; |
| } |
| bool portAllowed(const KURL& url) |