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

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

Issue 1718083005: Re-order unregistration and detachment of failed ScriptLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | no next file » | 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 break; 216 break;
217 } 217 }
218 case IN_ORDER_EXECUTION: 218 case IN_ORDER_EXECUTION:
219 bool foundLoader = removePendingInOrderScript(scriptLoader); 219 bool foundLoader = removePendingInOrderScript(scriptLoader);
220 #if !ENABLE(OILPAN) 220 #if !ENABLE(OILPAN)
221 foundLoader = foundLoader || m_isDisposed; 221 foundLoader = foundLoader || m_isDisposed;
222 #endif 222 #endif
223 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundLoader); 223 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(foundLoader);
224 break; 224 break;
225 } 225 }
226 scriptLoader->detach();
227 m_document->decrementLoadEventDelayCount(); 226 m_document->decrementLoadEventDelayCount();
228 } 227 }
229 228
230 void ScriptRunner::movePendingScript(Document& oldDocument, Document& newDocumen t, ScriptLoader* scriptLoader) 229 void ScriptRunner::movePendingScript(Document& oldDocument, Document& newDocumen t, ScriptLoader* scriptLoader)
231 { 230 {
232 RefPtrWillBeRawPtr<Document> newContextDocument = newDocument.contextDocumen t().get(); 231 RefPtrWillBeRawPtr<Document> newContextDocument = newDocument.contextDocumen t().get();
233 if (!newContextDocument) { 232 if (!newContextDocument) {
234 // Document's contextDocument() method will return no Document if the 233 // Document's contextDocument() method will return no Document if the
235 // following conditions both hold: 234 // following conditions both hold:
236 // 235 //
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 #if ENABLE(OILPAN) 299 #if ENABLE(OILPAN)
301 visitor->trace(m_document); 300 visitor->trace(m_document);
302 visitor->trace(m_pendingInOrderScripts); 301 visitor->trace(m_pendingInOrderScripts);
303 visitor->trace(m_pendingAsyncScripts); 302 visitor->trace(m_pendingAsyncScripts);
304 visitor->trace(m_asyncScriptsToExecuteSoon); 303 visitor->trace(m_asyncScriptsToExecuteSoon);
305 visitor->trace(m_inOrderScriptsToExecuteSoon); 304 visitor->trace(m_inOrderScriptsToExecuteSoon);
306 #endif 305 #endif
307 } 306 }
308 307
309 } // namespace blink 308 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698