| OLD | NEW |
| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 { | 403 { |
| 404 if (m_host == "localhost") | 404 if (m_host == "localhost") |
| 405 return true; | 405 return true; |
| 406 | 406 |
| 407 if (m_host == "[::1]") | 407 if (m_host == "[::1]") |
| 408 return true; | 408 return true; |
| 409 | 409 |
| 410 // Test if m_host matches 127.0.0.1/8 | 410 // Test if m_host matches 127.0.0.1/8 |
| 411 ASSERT(m_host.containsOnlyASCII()); | 411 ASSERT(m_host.containsOnlyASCII()); |
| 412 CString hostAscii = m_host.ascii(); | 412 CString hostAscii = m_host.ascii(); |
| 413 Vector<uint8, 4> ipNumber; | 413 Vector<uint8_t, 4> ipNumber; |
| 414 ipNumber.resize(4); | 414 ipNumber.resize(4); |
| 415 | 415 |
| 416 int numComponents; | 416 int numComponents; |
| 417 url::Component hostComponent(0, hostAscii.length()); | 417 url::Component hostComponent(0, hostAscii.length()); |
| 418 url::CanonHostInfo::Family family = url::IPv4AddressToNumber( | 418 url::CanonHostInfo::Family family = url::IPv4AddressToNumber( |
| 419 hostAscii.data(), hostComponent, &(ipNumber)[0], &numComponents); | 419 hostAscii.data(), hostComponent, &(ipNumber)[0], &numComponents); |
| 420 if (family != url::CanonHostInfo::IPV4) | 420 if (family != url::CanonHostInfo::IPV4) |
| 421 return false; | 421 return false; |
| 422 return ipNumber[0] == 127; | 422 return ipNumber[0] == 127; |
| 423 } | 423 } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 548 } |
| 549 | 549 |
| 550 void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeD
ata) | 550 void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeD
ata) |
| 551 { | 551 { |
| 552 m_universalAccess = privilegeData->m_universalAccess; | 552 m_universalAccess = privilegeData->m_universalAccess; |
| 553 m_canLoadLocalResources = privilegeData->m_canLoadLocalResources; | 553 m_canLoadLocalResources = privilegeData->m_canLoadLocalResources; |
| 554 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc
alOrigin; | 554 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc
alOrigin; |
| 555 } | 555 } |
| 556 | 556 |
| 557 } // namespace blink | 557 } // namespace blink |
| OLD | NEW |