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

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

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/PresentationAttributeStyle.cpp ('k') | Source/core/editing/FrameSelection.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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 void ScriptRunner::suspend() 76 void ScriptRunner::suspend()
77 { 77 {
78 m_timer.stop(); 78 m_timer.stop();
79 } 79 }
80 80
81 void ScriptRunner::resume() 81 void ScriptRunner::resume()
82 { 82 {
83 if (hasPendingScripts()) 83 if (hasPendingScripts())
84 m_timer.startOneShot(0); 84 m_timer.startOneShot(0, FROM_HERE);
85 } 85 }
86 86
87 void ScriptRunner::notifyScriptReady(ScriptLoader* scriptLoader, ExecutionType e xecutionType) 87 void ScriptRunner::notifyScriptReady(ScriptLoader* scriptLoader, ExecutionType e xecutionType)
88 { 88 {
89 switch (executionType) { 89 switch (executionType) {
90 case ASYNC_EXECUTION: 90 case ASYNC_EXECUTION:
91 ASSERT(m_pendingAsyncScripts.contains(scriptLoader)); 91 ASSERT(m_pendingAsyncScripts.contains(scriptLoader));
92 m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptLoader)); 92 m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptLoader));
93 break; 93 break;
94 94
95 case IN_ORDER_EXECUTION: 95 case IN_ORDER_EXECUTION:
96 ASSERT(!m_scriptsToExecuteInOrder.isEmpty()); 96 ASSERT(!m_scriptsToExecuteInOrder.isEmpty());
97 break; 97 break;
98 } 98 }
99 m_timer.startOneShot(0); 99 m_timer.startOneShot(0, FROM_HERE);
100 } 100 }
101 101
102 void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy pe executionType) 102 void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionTy pe executionType)
103 { 103 {
104 switch (executionType) { 104 switch (executionType) {
105 case ASYNC_EXECUTION: 105 case ASYNC_EXECUTION:
106 ASSERT(m_pendingAsyncScripts.contains(scriptLoader)); 106 ASSERT(m_pendingAsyncScripts.contains(scriptLoader));
107 m_pendingAsyncScripts.remove(scriptLoader); 107 m_pendingAsyncScripts.remove(scriptLoader);
108 m_document->decrementLoadEventDelayCount(); 108 m_document->decrementLoadEventDelayCount();
109 break; 109 break;
(...skipping 22 matching lines...) Expand all
132 size_t size = scripts.size(); 132 size_t size = scripts.size();
133 for (size_t i = 0; i < size; ++i) { 133 for (size_t i = 0; i < size; ++i) {
134 ScriptResource* resource = scripts[i].resource(); 134 ScriptResource* resource = scripts[i].resource();
135 RefPtr<Element> element = scripts[i].releaseElementAndClear(); 135 RefPtr<Element> element = scripts[i].releaseElementAndClear();
136 toScriptLoaderIfPossible(element.get())->execute(resource); 136 toScriptLoaderIfPossible(element.get())->execute(resource);
137 m_document->decrementLoadEventDelayCount(); 137 m_document->decrementLoadEventDelayCount();
138 } 138 }
139 } 139 }
140 140
141 } 141 }
OLDNEW
« no previous file with comments | « Source/core/dom/PresentationAttributeStyle.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698