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

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

Issue 2578653002: Do not call lower() on domains set from DOM after canonicalization (Closed)
Patch Set: add test Created 4 years 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 | « third_party/WebKit/LayoutTests/http/tests/security/document-domain-canonicalizes.html ('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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 ASSERT(origin->isUnique()); 196 ASSERT(origin->isUnique());
197 return origin.release(); 197 return origin.release();
198 } 198 }
199 199
200 PassRefPtr<SecurityOrigin> SecurityOrigin::isolatedCopy() const { 200 PassRefPtr<SecurityOrigin> SecurityOrigin::isolatedCopy() const {
201 return adoptRef(new SecurityOrigin(this)); 201 return adoptRef(new SecurityOrigin(this));
202 } 202 }
203 203
204 void SecurityOrigin::setDomainFromDOM(const String& newDomain) { 204 void SecurityOrigin::setDomainFromDOM(const String& newDomain) {
205 m_domainWasSetInDOM = true; 205 m_domainWasSetInDOM = true;
206 m_domain = newDomain.lower(); 206 m_domain = newDomain;
207 } 207 }
208 208
209 bool SecurityOrigin::isSecure(const KURL& url) { 209 bool SecurityOrigin::isSecure(const KURL& url) {
210 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(url.protocol())) 210 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(url.protocol()))
211 return true; 211 return true;
212 212
213 // URLs that wrap inner URLs are secure if those inner URLs are secure. 213 // URLs that wrap inner URLs are secure if those inner URLs are secure.
214 if (shouldUseInnerURL(url) && SchemeRegistry::shouldTreatURLSchemeAsSecure( 214 if (shouldUseInnerURL(url) && SchemeRegistry::shouldTreatURLSchemeAsSecure(
215 extractInnerURL(url).protocol())) 215 extractInnerURL(url).protocol()))
216 return true; 216 return true;
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 utf8.data(), url::Component(0, utf8.length()), &canonOutput, &outHost); 618 utf8.data(), url::Component(0, utf8.length()), &canonOutput, &outHost);
619 } else { 619 } else {
620 *success = url::CanonicalizeHost(host.characters16(), 620 *success = url::CanonicalizeHost(host.characters16(),
621 url::Component(0, host.length()), 621 url::Component(0, host.length()),
622 &canonOutput, &outHost); 622 &canonOutput, &outHost);
623 } 623 }
624 return String::fromUTF8(canonOutput.data(), canonOutput.length()); 624 return String::fromUTF8(canonOutput.data(), canonOutput.length());
625 } 625 }
626 626
627 } // namespace blink 627 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/document-domain-canonicalizes.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698