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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost()) | 360 if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost()) |
361 return true; | 361 return true; |
362 | 362 |
363 if (SecurityPolicy::isOriginWhiteListedTrustworthy(*this)) | 363 if (SecurityPolicy::isOriginWhiteListedTrustworthy(*this)) |
364 return true; | 364 return true; |
365 | 365 |
366 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) ."; | 366 errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) ."; |
367 return false; | 367 return false; |
368 } | 368 } |
369 | 369 |
370 bool SecurityOrigin::isPotentiallyTrustworthy() const | |
estark
2015/12/14 20:50:44
Hmmm... since you've already introduced the no-arg
| |
371 { | |
estark
2015/12/14 20:50:44
I would suggest the following:
bool SecurityOrigi
| |
372 String unusedErrorMessage; | |
373 return isPotentiallyTrustworthy(unusedErrorMessage); | |
374 } | |
375 | |
370 void SecurityOrigin::grantLoadLocalResources() | 376 void SecurityOrigin::grantLoadLocalResources() |
371 { | 377 { |
372 // Granting privileges to some, but not all, documents in a SecurityOrigin | 378 // Granting privileges to some, but not all, documents in a SecurityOrigin |
373 // is a security hazard because the documents without the privilege can | 379 // is a security hazard because the documents without the privilege can |
374 // obtain the privilege by injecting script into the documents that have | 380 // obtain the privilege by injecting script into the documents that have |
375 // been granted the privilege. | 381 // been granted the privilege. |
376 m_canLoadLocalResources = true; | 382 m_canLoadLocalResources = true; |
377 } | 383 } |
378 | 384 |
379 void SecurityOrigin::grantUniversalAccess() | 385 void SecurityOrigin::grantUniversalAccess() |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
541 } | 547 } |
542 | 548 |
543 void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeD ata) | 549 void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeD ata) |
544 { | 550 { |
545 m_universalAccess = privilegeData->m_universalAccess; | 551 m_universalAccess = privilegeData->m_universalAccess; |
546 m_canLoadLocalResources = privilegeData->m_canLoadLocalResources; | 552 m_canLoadLocalResources = privilegeData->m_canLoadLocalResources; |
547 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin; | 553 m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLoc alOrigin; |
548 } | 554 } |
549 | 555 |
550 } // namespace blink | 556 } // namespace blink |
OLD | NEW |