| 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 } | 564 } |
| 565 | 565 |
| 566 bool SecurityOrigin::isSameSchemeHostPortAndSuborigin( | 566 bool SecurityOrigin::isSameSchemeHostPortAndSuborigin( |
| 567 const SecurityOrigin* other) const { | 567 const SecurityOrigin* other) const { |
| 568 bool sameSuborigins = | 568 bool sameSuborigins = |
| 569 (hasSuborigin() == other->hasSuborigin()) && | 569 (hasSuborigin() == other->hasSuborigin()) && |
| 570 (!hasSuborigin() || (suborigin()->name() == other->suborigin()->name())); | 570 (!hasSuborigin() || (suborigin()->name() == other->suborigin()->name())); |
| 571 return isSameSchemeHostPort(other) && sameSuborigins; | 571 return isSameSchemeHostPort(other) && sameSuborigins; |
| 572 } | 572 } |
| 573 | 573 |
| 574 bool SecurityOrigin::areSameSchemeHostPort(const KURL& a, const KURL& b) { |
| 575 RefPtr<SecurityOrigin> originA = SecurityOrigin::create(a); |
| 576 RefPtr<SecurityOrigin> originB = SecurityOrigin::create(b); |
| 577 return originB->isSameSchemeHostPort(originA.get()); |
| 578 } |
| 579 |
| 574 const KURL& SecurityOrigin::urlWithUniqueSecurityOrigin() { | 580 const KURL& SecurityOrigin::urlWithUniqueSecurityOrigin() { |
| 575 ASSERT(isMainThread()); | 581 ASSERT(isMainThread()); |
| 576 DEFINE_STATIC_LOCAL(const KURL, uniqueSecurityOriginURL, | 582 DEFINE_STATIC_LOCAL(const KURL, uniqueSecurityOriginURL, |
| 577 (ParsedURLString, "data:,")); | 583 (ParsedURLString, "data:,")); |
| 578 return uniqueSecurityOriginURL; | 584 return uniqueSecurityOriginURL; |
| 579 } | 585 } |
| 580 | 586 |
| 581 std::unique_ptr<SecurityOrigin::PrivilegeData> | 587 std::unique_ptr<SecurityOrigin::PrivilegeData> |
| 582 SecurityOrigin::createPrivilegeData() const { | 588 SecurityOrigin::createPrivilegeData() const { |
| 583 std::unique_ptr<PrivilegeData> privilegeData = | 589 std::unique_ptr<PrivilegeData> privilegeData = |
| (...skipping 28 matching lines...) Expand all Loading... |
| 612 utf8.data(), url::Component(0, utf8.length()), &canonOutput, &outHost); | 618 utf8.data(), url::Component(0, utf8.length()), &canonOutput, &outHost); |
| 613 } else { | 619 } else { |
| 614 *success = url::CanonicalizeHost(host.characters16(), | 620 *success = url::CanonicalizeHost(host.characters16(), |
| 615 url::Component(0, host.length()), | 621 url::Component(0, host.length()), |
| 616 &canonOutput, &outHost); | 622 &canonOutput, &outHost); |
| 617 } | 623 } |
| 618 return String::fromUTF8(canonOutput.data(), canonOutput.length()); | 624 return String::fromUTF8(canonOutput.data(), canonOutput.length()); |
| 619 } | 625 } |
| 620 | 626 |
| 621 } // namespace blink | 627 } // namespace blink |
| OLD | NEW |