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

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

Issue 2151473002: Small improvements to MixedContentChecker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a TODO to SecurityOrigin::isLocalhost Created 4 years, 5 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 | « third_party/WebKit/Source/platform/network/NetworkUtils.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) 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 m_blockLocalAccessFromLocalOrigin = true; 395 m_blockLocalAccessFromLocalOrigin = true;
396 } 396 }
397 397
398 bool SecurityOrigin::isLocal() const 398 bool SecurityOrigin::isLocal() const
399 { 399 {
400 return SchemeRegistry::shouldTreatURLSchemeAsLocal(m_protocol); 400 return SchemeRegistry::shouldTreatURLSchemeAsLocal(m_protocol);
401 } 401 }
402 402
403 bool SecurityOrigin::isLocalhost() const 403 bool SecurityOrigin::isLocalhost() const
404 { 404 {
405 // TODO(mkwst): Update this to call into net::IsLocalhost.
405 if (m_host == "localhost") 406 if (m_host == "localhost")
406 return true; 407 return true;
407 408
408 if (m_host == "[::1]") 409 if (m_host == "[::1]")
409 return true; 410 return true;
410 411
411 // Test if m_host matches 127.0.0.1/8 412 // Test if m_host matches 127.0.0.1/8
412 ASSERT(m_host.containsOnlyASCII()); 413 ASSERT(m_host.containsOnlyASCII());
413 CString hostAscii = m_host.ascii(); 414 CString hostAscii = m_host.ascii();
414 Vector<uint8_t, 4> ipNumber; 415 Vector<uint8_t, 4> ipNumber;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin; 582 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin;
582 } 583 }
583 584
584 void SecurityOrigin::setUniqueOriginIsPotentiallyTrustworthy(bool isUniqueOrigin PotentiallyTrustworthy) 585 void SecurityOrigin::setUniqueOriginIsPotentiallyTrustworthy(bool isUniqueOrigin PotentiallyTrustworthy)
585 { 586 {
586 ASSERT(!isUniqueOriginPotentiallyTrustworthy || isUnique()); 587 ASSERT(!isUniqueOriginPotentiallyTrustworthy || isUnique());
587 m_isUniqueOriginPotentiallyTrustworthy = isUniqueOriginPotentiallyTrustworth y; 588 m_isUniqueOriginPotentiallyTrustworthy = isUniqueOriginPotentiallyTrustworth y;
588 } 589 }
589 590
590 } // namespace blink 591 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/network/NetworkUtils.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698