| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 return true; | 375 return true; |
| 376 } | 376 } |
| 377 | 377 |
| 378 bool SecurityOrigin::isPotentiallyTrustworthy(String& errorMessage) const | 378 bool SecurityOrigin::isPotentiallyTrustworthy(String& errorMessage) const |
| 379 { | 379 { |
| 380 ASSERT(m_protocol != "data"); | 380 ASSERT(m_protocol != "data"); |
| 381 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() ||
isLocalhost()) | 381 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() ||
isLocalhost()) |
| 382 return true; | 382 return true; |
| 383 | 383 |
| 384 if (SecurityPolicy::isOriginWhiteListedTrustworthy(*this)) |
| 385 return true; |
| 386 |
| 384 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV)
."; | 387 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV)
."; |
| 385 return false; | 388 return false; |
| 386 } | 389 } |
| 387 | 390 |
| 388 SecurityOrigin::Policy SecurityOrigin::canShowNotifications() const | 391 SecurityOrigin::Policy SecurityOrigin::canShowNotifications() const |
| 389 { | 392 { |
| 390 if (m_universalAccess) | 393 if (m_universalAccess) |
| 391 return AlwaysAllow; | 394 return AlwaysAllow; |
| 392 if (isUnique()) | 395 if (isUnique()) |
| 393 return AlwaysDeny; | 396 return AlwaysDeny; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 534 } |
| 532 | 535 |
| 533 void SecurityOrigin::transferPrivilegesFrom(const SecurityOrigin& origin) | 536 void SecurityOrigin::transferPrivilegesFrom(const SecurityOrigin& origin) |
| 534 { | 537 { |
| 535 m_universalAccess = origin.m_universalAccess; | 538 m_universalAccess = origin.m_universalAccess; |
| 536 m_canLoadLocalResources = origin.m_canLoadLocalResources; | 539 m_canLoadLocalResources = origin.m_canLoadLocalResources; |
| 537 m_enforceFilePathSeparation = origin.m_enforceFilePathSeparation; | 540 m_enforceFilePathSeparation = origin.m_enforceFilePathSeparation; |
| 538 } | 541 } |
| 539 | 542 |
| 540 } // namespace blink | 543 } // namespace blink |
| OLD | NEW |