Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: third_party/WebKit/Source/core/dom/PendingScript.cpp

Issue 2706303002: Check whether ScriptResource is still loading due to revalidation (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698