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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 } | 214 } |
215 | 215 |
216 DEFINE_TRACE(PendingScript) { | 216 DEFINE_TRACE(PendingScript) { |
217 visitor->trace(m_element); | 217 visitor->trace(m_element); |
218 visitor->trace(m_streamer); | 218 visitor->trace(m_streamer); |
219 visitor->trace(m_client); | 219 visitor->trace(m_client); |
220 ResourceOwner<ScriptResource>::trace(visitor); | 220 ResourceOwner<ScriptResource>::trace(visitor); |
221 MemoryCoordinatorClient::trace(visitor); | 221 MemoryCoordinatorClient::trace(visitor); |
222 } | 222 } |
223 | 223 |
224 ScriptSourceCode PendingScript::getSource(const KURL& documentURL, | 224 NOINLINE ScriptSourceCode PendingScript::getSource(const KURL& documentURL, |
225 bool& errorOccurred) const { | 225 bool& errorOccurred) const { |
226 checkState(); | 226 checkState(); |
227 | 227 |
228 errorOccurred = this->errorOccurred(); | 228 errorOccurred = this->errorOccurred(); |
229 if (resource()) { | 229 if (resource()) { |
230 DCHECK(resource()->isLoaded()); | 230 // For investigating https://crbug.com/692856. |
| 231 CHECK(resource()->isLoaded() || |
| 232 (resource()->isLoading() && resource()->hasRevalidated())); |
| 233 CHECK(resource()->isLoaded() || |
| 234 (resource()->isLoading() && resource()->isCacheValidator())); |
| 235 CHECK(resource()->isLoaded()); |
| 236 |
231 if (m_streamer && !m_streamer->streamingSuppressed()) | 237 if (m_streamer && !m_streamer->streamingSuppressed()) |
232 return ScriptSourceCode(m_streamer, resource()); | 238 return ScriptSourceCode(m_streamer, resource()); |
233 return ScriptSourceCode(resource()); | 239 return ScriptSourceCode(resource()); |
234 } | 240 } |
235 | 241 |
236 return ScriptSourceCode(m_element->textContent(), documentURL, | 242 return ScriptSourceCode(m_element->textContent(), documentURL, |
237 startingPosition()); | 243 startingPosition()); |
238 } | 244 } |
239 | 245 |
240 void PendingScript::setStreamer(ScriptStreamer* streamer) { | 246 void PendingScript::setStreamer(ScriptStreamer* streamer) { |
(...skipping 22 matching lines...) Expand all Loading... |
263 | 269 |
264 void PendingScript::onPurgeMemory() { | 270 void PendingScript::onPurgeMemory() { |
265 checkState(); | 271 checkState(); |
266 if (!m_streamer) | 272 if (!m_streamer) |
267 return; | 273 return; |
268 m_streamer->cancel(); | 274 m_streamer->cancel(); |
269 m_streamer = nullptr; | 275 m_streamer = nullptr; |
270 } | 276 } |
271 | 277 |
272 } // namespace blink | 278 } // namespace blink |
OLD | NEW |