OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // In order to simulate the correct behavior, Blink explicitly does the SRI | 148 // In order to simulate the correct behavior, Blink explicitly does the SRI |
149 // checks here, when a PendingScript tied to a particular request is | 149 // checks here, when a PendingScript tied to a particular request is |
150 // finished (and in the case of a StyleSheet, at the point of execution), | 150 // finished (and in the case of a StyleSheet, at the point of execution), |
151 // while having proper Fetch checks in the fetch module for use in the | 151 // while having proper Fetch checks in the fetch module for use in the |
152 // fetch JavaScript API. In a future world where the ResourceFetcher uses | 152 // fetch JavaScript API. In a future world where the ResourceFetcher uses |
153 // the Fetch algorithm, this should be fixed by having separate Response | 153 // the Fetch algorithm, this should be fixed by having separate Response |
154 // objects (perhaps attached to identical Resource objects) per request. | 154 // objects (perhaps attached to identical Resource objects) per request. |
155 // | 155 // |
156 // See https://crbug.com/500701 for more information. | 156 // See https://crbug.com/500701 for more information. |
157 if (m_element) { | 157 if (m_element) { |
158 ASSERT(resource->type() == Resource::Script); | 158 ASSERT(resource->getType() == Resource::Script); |
159 ScriptResource* scriptResource = toScriptResource(resource); | 159 ScriptResource* scriptResource = toScriptResource(resource); |
160 String integrityAttr = m_element->fastGetAttribute(HTMLNames::integrityA
ttr); | 160 String integrityAttr = m_element->fastGetAttribute(HTMLNames::integrityA
ttr); |
161 | 161 |
162 // It is possible to get back a script resource with integrity metadata | 162 // It is possible to get back a script resource with integrity metadata |
163 // for a request with an empty integrity attribute. In that case, the | 163 // for a request with an empty integrity attribute. In that case, the |
164 // integrity check should be skipped, so this check ensures that the | 164 // integrity check should be skipped, so this check ensures that the |
165 // integrity attribute isn't empty in addition to checking if the | 165 // integrity attribute isn't empty in addition to checking if the |
166 // resource has empty integrity metadata. | 166 // resource has empty integrity metadata. |
167 if (!integrityAttr.isEmpty() && !scriptResource->integrityMetadata().isE
mpty()) { | 167 if (!integrityAttr.isEmpty() && !scriptResource->integrityMetadata().isE
mpty()) { |
168 ScriptIntegrityDisposition disposition = scriptResource->integrityDi
sposition(); | 168 ScriptIntegrityDisposition disposition = scriptResource->integrityDi
sposition(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 bool PendingScript::isReady() const | 218 bool PendingScript::isReady() const |
219 { | 219 { |
220 if (resource() && !resource()->isLoaded()) | 220 if (resource() && !resource()->isLoaded()) |
221 return false; | 221 return false; |
222 if (m_streamer && !m_streamer->isFinished()) | 222 if (m_streamer && !m_streamer->isFinished()) |
223 return false; | 223 return false; |
224 return true; | 224 return true; |
225 } | 225 } |
226 | 226 |
227 } // namespace blink | 227 } // namespace blink |
OLD | NEW |