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

Side by Side Diff: third_party/WebKit/WebCore/platform/KURLGoogle.cpp

Issue 858001: Merge WebKit r55822:... (Closed) Base URL: svn://chrome-svn/chrome/branches/249/src/
Patch Set: Created 10 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Google Inc. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 const KURL& blankURL() 961 const KURL& blankURL()
962 { 962 {
963 static KURL staticBlankURL(ParsedURLString, "about:blank"); 963 static KURL staticBlankURL(ParsedURLString, "about:blank");
964 return staticBlankURL; 964 return staticBlankURL;
965 } 965 }
966 966
967 bool protocolIs(const String& url, const char* protocol) 967 bool protocolIs(const String& url, const char* protocol)
968 { 968 {
969 // Do the comparison without making a new string object. 969 // Do the comparison without making a new string object.
970 assertProtocolIsGood(protocol); 970 assertProtocolIsGood(protocol);
971 for (int i = 0; ; ++i) { 971
972 if (!protocol[i]) 972 // Check the scheme like GURL does.
973 return url[i] == ':'; 973 return url_util::FindAndCompareScheme(url.characters(), url.length(),
974 if (toASCIILower(url[i]) != protocol[i]) 974 protocol, NULL);
975 return false;
976 }
977 } 975 }
978 976
979 inline bool KURL::protocolIs(const String& string, const char* protocol) 977 inline bool KURL::protocolIs(const String& string, const char* protocol)
980 { 978 {
981 return WebCore::protocolIs(string, protocol); 979 return WebCore::protocolIs(string, protocol);
982 } 980 }
983 981
984 bool protocolHostAndPortAreEqual(const KURL& a, const KURL& b) 982 bool protocolHostAndPortAreEqual(const KURL& a, const KURL& b)
985 { 983 {
986 if (a.parsed().scheme.end() != b.parsed().scheme.end()) 984 if (a.parsed().scheme.end() != b.parsed().scheme.end())
(...skipping 16 matching lines...) Expand all
1003 1001
1004 if (a.port() != b.port()) 1002 if (a.port() != b.port())
1005 return false; 1003 return false;
1006 1004
1007 return true; 1005 return true;
1008 } 1006 }
1009 1007
1010 } // namespace WebCore 1008 } // namespace WebCore
1011 1009
1012 #endif // USE(GOOGLEURL) 1010 #endif // USE(GOOGLEURL)
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-window-open-javascript-url-leading-format-char-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698