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

Unified Diff: Source/platform/weborigin/SecurityOrigin.cpp

Issue 1320793002: Remove some code, an obsolete criteria, from SecurityOrigin test for uniqueness. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/weborigin/KURLTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/weborigin/SecurityOrigin.cpp
diff --git a/Source/platform/weborigin/SecurityOrigin.cpp b/Source/platform/weborigin/SecurityOrigin.cpp
index 5404ee5b95b9f9c665feeef3e0c11f9bb9e494a1..9d318bf4f2c3e08719bfba532469212138afd2c5 100644
--- a/Source/platform/weborigin/SecurityOrigin.cpp
+++ b/Source/platform/weborigin/SecurityOrigin.cpp
@@ -49,14 +49,6 @@ const int MaxAllowedPort = 65535;
static SecurityOriginCache* s_originCache = 0;
-static bool schemeRequiresAuthority(const KURL& url)
-{
- // We expect URLs with these schemes to have authority components. If the
- // URL lacks an authority component, we get concerned and mark the origin
- // as unique.
- return url.protocolIsInHTTPFamily() || url.protocolIs("ftp");
-}
-
static SecurityOrigin* cachedOrigin(const KURL& url)
{
if (s_originCache)
@@ -106,11 +98,12 @@ static bool shouldTreatAsUniqueOrigin(const KURL& url)
relevantURL = url;
}
- // For edge case URLs that were probably misparsed, make sure that the origin is unique.
- // FIXME: Do we really need to do this? This looks to be a hack around a
- // security bug in CFNetwork that might have been fixed.
- if (schemeRequiresAuthority(relevantURL) && relevantURL.host().isEmpty())
- return true;
+ // URLs with schemes that require an authority, but which don't have one,
+ // will have failed the isValid() test; e.g. valid HTTP URLs must have a
+ // host.
+ ASSERT(
+ !((relevantURL.protocolIsInHTTPFamily() || relevantURL.protocolIs("ftp"))
+ && relevantURL.host().isEmpty()));
// SchemeRegistry needs a lower case protocol because it uses HashMaps
// that assume the scheme has already been canonicalized.
« no previous file with comments | « Source/platform/weborigin/KURLTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698