| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // Enforces the given suborigin as part of the security origin for this | 93 // Enforces the given suborigin as part of the security origin for this |
| 94 // security context. |name| must not be empty, although it may be null. A null | 94 // security context. |name| must not be empty, although it may be null. A null |
| 95 // name represents a lack of a suborigin. | 95 // name represents a lack of a suborigin. |
| 96 // See: https://w3c.github.io/webappsec-suborigins/index.html | 96 // See: https://w3c.github.io/webappsec-suborigins/index.html |
| 97 void SecurityContext::enforceSuborigin(const Suborigin& suborigin) | 97 void SecurityContext::enforceSuborigin(const Suborigin& suborigin) |
| 98 { | 98 { |
| 99 if (!RuntimeEnabledFeatures::suboriginsEnabled()) | 99 if (!RuntimeEnabledFeatures::suboriginsEnabled()) |
| 100 return; | 100 return; |
| 101 | 101 |
| 102 ASSERT(!suborigin.name().isEmpty()); | 102 DCHECK(!suborigin.name().isEmpty()); |
| 103 ASSERT(RuntimeEnabledFeatures::suboriginsEnabled()); | 103 DCHECK(RuntimeEnabledFeatures::suboriginsEnabled()); |
| 104 ASSERT(m_securityOrigin.get()); | 104 DCHECK(m_securityOrigin.get()); |
| 105 ASSERT(!m_securityOrigin->hasSuborigin() || m_securityOrigin->suborigin()->n
ame() == suborigin.name()); | 105 DCHECK(!m_securityOrigin->hasSuborigin() || m_securityOrigin->suborigin()->n
ame() == suborigin.name()); |
| 106 m_securityOrigin->addSuborigin(suborigin); | 106 m_securityOrigin->addSuborigin(suborigin); |
| 107 didUpdateSecurityOrigin(); | 107 didUpdateSecurityOrigin(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |