| Index: third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
|
| diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
|
| index 0864fb2effcaedb0cfae82fa01314a5861b9de23..a6f6aaaea048e38633f4535c5b4fd4221d00f827 100644
|
| --- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
|
| +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
|
| @@ -103,11 +103,7 @@ static bool shouldTreatAsUniqueOrigin(const KURL& url) {
|
| (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.
|
| - String protocol = relevantURL.protocol().lower();
|
| -
|
| - if (SchemeRegistry::shouldTreatURLSchemeAsNoAccess(protocol))
|
| + if (SchemeRegistry::shouldTreatURLSchemeAsNoAccess(relevantURL.protocol()))
|
| return true;
|
|
|
| // This is the common case.
|
| @@ -115,9 +111,8 @@ static bool shouldTreatAsUniqueOrigin(const KURL& url) {
|
| }
|
|
|
| SecurityOrigin::SecurityOrigin(const KURL& url)
|
| - : m_protocol(url.protocol().isNull() ? emptyString()
|
| - : url.protocol().lower()),
|
| - m_host(url.host().isNull() ? emptyString() : url.host().lower()),
|
| + : m_protocol(url.protocol()),
|
| + m_host(url.host()),
|
| m_port(url.port()),
|
| m_effectivePort(url.port() ? url.port()
|
| : defaultPortForProtocol(m_protocol)),
|
| @@ -126,6 +121,11 @@ SecurityOrigin::SecurityOrigin(const KURL& url)
|
| m_domainWasSetInDOM(false),
|
| m_blockLocalAccessFromLocalOrigin(false),
|
| m_isUniqueOriginPotentiallyTrustworthy(false) {
|
| + if (m_protocol.isNull())
|
| + m_protocol = emptyString();
|
| + if (m_host.isNull())
|
| + m_host = emptyString();
|
| +
|
| // Suborigins are serialized into the host, so extract it if necessary.
|
| String suboriginName;
|
| if (deserializeSuboriginAndProtocolAndHost(m_protocol, m_host, suboriginName,
|
| @@ -320,8 +320,7 @@ bool SecurityOrigin::canDisplay(const KURL& url) const {
|
| if (m_universalAccess)
|
| return true;
|
|
|
| - String protocol = url.protocol().lower();
|
| -
|
| + String protocol = url.protocol();
|
| if (SchemeRegistry::canDisplayOnlyIfCanRequest(protocol))
|
| return canRequest(url);
|
|
|
|
|