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

Side by Side Diff: Source/platform/weborigin/OriginAccessEntry.cpp

Issue 1110913002: Removing blink::prefix (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « Source/platform/testing/UnitTestHelpers.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 , m_ipAddressSettings(ipAddressSetting) 44 , m_ipAddressSettings(ipAddressSetting)
45 , m_hostIsPublicSuffix(false) 45 , m_hostIsPublicSuffix(false)
46 { 46 {
47 ASSERT(subdomainSetting == AllowSubdomains || subdomainSetting == DisallowSu bdomains); 47 ASSERT(subdomainSetting == AllowSubdomains || subdomainSetting == DisallowSu bdomains);
48 48
49 // Assume that any host that ends with a digit is trying to be an IP address . 49 // Assume that any host that ends with a digit is trying to be an IP address .
50 m_hostIsIPAddress = !m_host.isEmpty() && isASCIIDigit(m_host[m_host.length() - 1]); 50 m_hostIsIPAddress = !m_host.isEmpty() && isASCIIDigit(m_host[m_host.length() - 1]);
51 51
52 // Look for top-level domains, either with or without an additional dot. 52 // Look for top-level domains, either with or without an additional dot.
53 if (!m_hostIsIPAddress) { 53 if (!m_hostIsIPAddress) {
54 blink::WebPublicSuffixList* suffixList = blink::Platform::current()->pub licSuffixList(); 54 WebPublicSuffixList* suffixList = Platform::current()->publicSuffixList( );
55 if (suffixList && m_host.length() <= suffixList->getPublicSuffixLength(m _host) + 1) 55 if (suffixList && m_host.length() <= suffixList->getPublicSuffixLength(m _host) + 1)
56 m_hostIsPublicSuffix = true; 56 m_hostIsPublicSuffix = true;
57 } 57 }
58 } 58 }
59 59
60 OriginAccessEntry::MatchResult OriginAccessEntry::matchesOrigin(const SecurityOr igin& origin) const 60 OriginAccessEntry::MatchResult OriginAccessEntry::matchesOrigin(const SecurityOr igin& origin) const
61 { 61 {
62 ASSERT(origin.host() == origin.host().lower()); 62 ASSERT(origin.host() == origin.host().lower());
63 ASSERT(origin.protocol() == origin.protocol().lower()); 63 ASSERT(origin.protocol() == origin.protocol().lower());
64 64
(...skipping 20 matching lines...) Expand all
85 if (origin.host().length() <= m_host.length() || origin.host()[origin.host() .length() - m_host.length() - 1] != '.' || !origin.host().endsWith(m_host)) 85 if (origin.host().length() <= m_host.length() || origin.host()[origin.host() .length() - m_host.length() - 1] != '.' || !origin.host().endsWith(m_host))
86 return DoesNotMatchOrigin; 86 return DoesNotMatchOrigin;
87 87
88 if (m_hostIsPublicSuffix) 88 if (m_hostIsPublicSuffix)
89 return MatchesOriginButIsPublicSuffix; 89 return MatchesOriginButIsPublicSuffix;
90 90
91 return MatchesOrigin; 91 return MatchesOrigin;
92 } 92 }
93 93
94 } // namespace blink 94 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/testing/UnitTestHelpers.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698