| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. | 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return 990; | 62 return 990; |
| 63 | 63 |
| 64 return 0; | 64 return 0; |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool isPortAllowedForScheme(const KURL& url) { | 67 bool isPortAllowedForScheme(const KURL& url) { |
| 68 // Returns true for URLs without a port specified. This is needed to let | 68 // Returns true for URLs without a port specified. This is needed to let |
| 69 // through non-network schemes that don't go over the network. | 69 // through non-network schemes that don't go over the network. |
| 70 if (!url.hasPort()) | 70 if (!url.hasPort()) |
| 71 return true; | 71 return true; |
| 72 String protocol = url.protocol().isNull() ? "" : url.protocol().lower(); | 72 String protocol = url.protocol().isNull() ? "" : url.protocol(); |
| 73 unsigned short effectivePort = url.port(); | 73 unsigned short effectivePort = url.port(); |
| 74 if (!effectivePort) | 74 if (!effectivePort) |
| 75 effectivePort = defaultPortForProtocol(protocol); | 75 effectivePort = defaultPortForProtocol(protocol); |
| 76 StringUTF8Adaptor utf8(protocol); | 76 StringUTF8Adaptor utf8(protocol); |
| 77 return net::IsPortAllowedForScheme(effectivePort, | 77 return net::IsPortAllowedForScheme(effectivePort, |
| 78 std::string(utf8.data(), utf8.length())); | 78 std::string(utf8.data(), utf8.length())); |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace blink | 81 } // namespace blink |
| OLD | NEW |