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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 PassRefPtr<SecurityOrigin> SecurityOrigin::createFromString(const String& origin
String) | 503 PassRefPtr<SecurityOrigin> SecurityOrigin::createFromString(const String& origin
String) |
504 { | 504 { |
505 return SecurityOrigin::create(KURL(KURL(), originString)); | 505 return SecurityOrigin::create(KURL(KURL(), originString)); |
506 } | 506 } |
507 | 507 |
508 PassRefPtr<SecurityOrigin> SecurityOrigin::create(const String& protocol, const
String& host, int port) | 508 PassRefPtr<SecurityOrigin> SecurityOrigin::create(const String& protocol, const
String& host, int port) |
509 { | 509 { |
510 if (port < 0 || port > MaxAllowedPort) | 510 if (port < 0 || port > MaxAllowedPort) |
511 return createUnique(); | 511 return createUnique(); |
512 String decodedHost = decodeURLEscapeSequences(host); | 512 String decodedHost = decodeURLEscapeSequences(host); |
513 return create(KURL(KURL(), protocol + "://" + host + ":" + String::number(po
rt) + "/")); | 513 String portPart = port ? ":" + String::number(port) : String(); |
| 514 return create(KURL(KURL(), protocol + "://" + host + portPart + "/")); |
514 } | 515 } |
515 | 516 |
516 bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const | 517 bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const |
517 { | 518 { |
518 if (m_host != other->m_host) | 519 if (m_host != other->m_host) |
519 return false; | 520 return false; |
520 | 521 |
521 if (m_protocol != other->m_protocol) | 522 if (m_protocol != other->m_protocol) |
522 return false; | 523 return false; |
523 | 524 |
(...skipping 19 matching lines...) Expand all Loading... |
543 } | 544 } |
544 | 545 |
545 void SecurityOrigin::transferPrivilegesFrom(const SecurityOrigin& origin) | 546 void SecurityOrigin::transferPrivilegesFrom(const SecurityOrigin& origin) |
546 { | 547 { |
547 m_universalAccess = origin.m_universalAccess; | 548 m_universalAccess = origin.m_universalAccess; |
548 m_canLoadLocalResources = origin.m_canLoadLocalResources; | 549 m_canLoadLocalResources = origin.m_canLoadLocalResources; |
549 m_blockLocalAccessFromLocalOrigin = origin.m_blockLocalAccessFromLocalOrigin
; | 550 m_blockLocalAccessFromLocalOrigin = origin.m_blockLocalAccessFromLocalOrigin
; |
550 } | 551 } |
551 | 552 |
552 } // namespace blink | 553 } // namespace blink |
OLD | NEW |