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

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

Issue 656413003: Revert of Oilpan: move ScriptLoader to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « Source/core/dom/ScriptRunner.h ('k') | Source/core/html/HTMLScriptElement.h » ('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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 m_document->decrementLoadEventDelayCount(); 116 m_document->decrementLoadEventDelayCount();
117 } 117 }
118 } 118 }
119 119
120 void ScriptRunner::timerFired(Timer<ScriptRunner>* timer) 120 void ScriptRunner::timerFired(Timer<ScriptRunner>* timer)
121 { 121 {
122 ASSERT_UNUSED(timer, timer == &m_timer); 122 ASSERT_UNUSED(timer, timer == &m_timer);
123 123
124 RefPtrWillBeRawPtr<Document> protect(m_document.get()); 124 RefPtrWillBeRawPtr<Document> protect(m_document.get());
125 125
126 WillBeHeapVector<RawPtrWillBeMember<ScriptLoader> > scriptLoaders; 126 Vector<ScriptLoader*> scriptLoaders;
127 scriptLoaders.swap(m_scriptsToExecuteSoon); 127 scriptLoaders.swap(m_scriptsToExecuteSoon);
128 128
129 size_t numInOrderScriptsToExecute = 0; 129 size_t numInOrderScriptsToExecute = 0;
130 for (; numInOrderScriptsToExecute < m_scriptsToExecuteInOrder.size() && m_sc riptsToExecuteInOrder[numInOrderScriptsToExecute]->isReady(); ++numInOrderScript sToExecute) 130 for (; numInOrderScriptsToExecute < m_scriptsToExecuteInOrder.size() && m_sc riptsToExecuteInOrder[numInOrderScriptsToExecute]->isReady(); ++numInOrderScript sToExecute)
131 scriptLoaders.append(m_scriptsToExecuteInOrder[numInOrderScriptsToExecut e]); 131 scriptLoaders.append(m_scriptsToExecuteInOrder[numInOrderScriptsToExecut e]);
132 if (numInOrderScriptsToExecute) 132 if (numInOrderScriptsToExecute)
133 m_scriptsToExecuteInOrder.remove(0, numInOrderScriptsToExecute); 133 m_scriptsToExecuteInOrder.remove(0, numInOrderScriptsToExecute);
134 134
135 size_t size = scriptLoaders.size(); 135 size_t size = scriptLoaders.size();
136 for (size_t i = 0; i < size; ++i) { 136 for (size_t i = 0; i < size; ++i) {
137 scriptLoaders[i]->execute(); 137 scriptLoaders[i]->execute();
138 m_document->decrementLoadEventDelayCount(); 138 m_document->decrementLoadEventDelayCount();
139 } 139 }
140 } 140 }
141 141
142 void ScriptRunner::trace(Visitor* visitor) 142 void ScriptRunner::trace(Visitor* visitor)
143 { 143 {
144 #if ENABLE(OILPAN) 144 #if ENABLE(OILPAN)
145 visitor->trace(m_document); 145 visitor->trace(m_document);
146 visitor->trace(m_scriptsToExecuteInOrder); 146 visitor->trace(m_scriptsToExecuteInOrder);
147 visitor->trace(m_scriptsToExecuteSoon); 147 visitor->trace(m_scriptsToExecuteSoon);
148 visitor->trace(m_pendingAsyncScripts); 148 visitor->trace(m_pendingAsyncScripts);
149 #endif 149 #endif
150 } 150 }
151 151
152 } 152 }
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptRunner.h ('k') | Source/core/html/HTMLScriptElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698