Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: third_party/WebKit/Source/platform/weborigin/KnownPorts.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 72 String protocol = url.protocol();
73 if (protocol.isNull()) 73 if (protocol.isNull())
74 protocol = emptyString(); 74 protocol = emptyString;
75 unsigned short effectivePort = url.port(); 75 unsigned short effectivePort = url.port();
76 if (!effectivePort) 76 if (!effectivePort)
77 effectivePort = defaultPortForProtocol(protocol); 77 effectivePort = defaultPortForProtocol(protocol);
78 StringUTF8Adaptor utf8(protocol); 78 StringUTF8Adaptor utf8(protocol);
79 return net::IsPortAllowedForScheme(effectivePort, 79 return net::IsPortAllowedForScheme(effectivePort,
80 std::string(utf8.data(), utf8.length())); 80 std::string(utf8.data(), utf8.length()));
81 } 81 }
82 82
83 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/KURL.cpp ('k') | third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698