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

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

Issue 660863002: [DevTools] Added public method for async execution of scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: platform/WebExecuteScriptCallback -> web/WebScriptCallback 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 174 }
175 175
176 int ExecutionContext::circularSequentialID() 176 int ExecutionContext::circularSequentialID()
177 { 177 {
178 ++m_circularSequentialID; 178 ++m_circularSequentialID;
179 if (m_circularSequentialID <= 0) 179 if (m_circularSequentialID <= 0)
180 m_circularSequentialID = 1; 180 m_circularSequentialID = 1;
181 return m_circularSequentialID; 181 return m_circularSequentialID;
182 } 182 }
183 183
184 int ExecutionContext::installNewTimeout(PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot) 184 int ExecutionContext::installNewTimeout(PassOwnPtr<ScheduledActionBase> action, int timeout, bool singleShot)
vsevik 2014/10/17 13:19:43 I don't think it is fine that we generate timeoutI
185 { 185 {
186 int timeoutID; 186 int timeoutID;
187 while (true) { 187 while (true) {
188 timeoutID = circularSequentialID(); 188 timeoutID = circularSequentialID();
189 if (!m_timeouts.contains(timeoutID)) 189 if (!m_timeouts.contains(timeoutID))
190 break; 190 break;
191 } 191 }
192 TimeoutMap::AddResult result = m_timeouts.add(timeoutID, DOMTimer::create(th is, action, timeout, singleShot, timeoutID)); 192 TimeoutMap::AddResult result = m_timeouts.add(timeoutID, DOMTimer::create(th is, action, timeout, singleShot, timeoutID));
193 ASSERT(result.isNewEntry); 193 ASSERT(result.isNewEntry);
194 DOMTimer* timer = result.storedValue->value.get(); 194 DOMTimer* timer = result.storedValue->value.get();
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 void ExecutionContext::trace(Visitor* visitor) 267 void ExecutionContext::trace(Visitor* visitor)
268 { 268 {
269 #if ENABLE(OILPAN) 269 #if ENABLE(OILPAN)
270 visitor->trace(m_pendingExceptions); 270 visitor->trace(m_pendingExceptions);
271 HeapSupplementable<ExecutionContext>::trace(visitor); 271 HeapSupplementable<ExecutionContext>::trace(visitor);
272 #endif 272 #endif
273 LifecycleContext<ExecutionContext>::trace(visitor); 273 LifecycleContext<ExecutionContext>::trace(visitor);
274 } 274 }
275 275
276 } // namespace blink 276 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698