Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |