Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/FrameRequestCallbackCollection.h" | 5 #include "core/dom/FrameRequestCallbackCollection.h" |
| 6 | 6 |
| 7 #include "core/dom/FrameRequestCallback.h" | 7 #include "core/dom/FrameRequestCallback.h" |
| 8 #include "core/inspector/InspectorInstrumentation.h" | 8 #include "core/inspector/InspectorInstrumentation.h" |
| 9 #include "core/inspector/InspectorTraceEvents.h" | 9 #include "core/inspector/InspectorTraceEvents.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 FrameRequestCallbackCollection::FrameRequestCallbackCollection(ExecutionContext* context) | 13 FrameRequestCallbackCollection::FrameRequestCallbackCollection(ExecutionContext* context) |
| 14 : m_context(context) | 14 : m_context(context) |
| 15 { | 15 { |
| 16 #if ENABLE(OILPAN) | |
| 17 ASSERT(ThreadState::forObject(m_context.get()) == ThreadState::current()); | |
| 18 #endif | |
| 16 } | 19 } |
| 17 | 20 |
| 18 FrameRequestCallbackCollection::CallbackId FrameRequestCallbackCollection::regis terCallback(FrameRequestCallback* callback) | 21 FrameRequestCallbackCollection::CallbackId FrameRequestCallbackCollection::regis terCallback(FrameRequestCallback* callback) |
| 19 { | 22 { |
| 23 ASSERT(ThreadState::forObject(callback) == ThreadState::current()); | |
|
haraken
2016/01/07 08:06:21
Is this useful?
| |
| 20 FrameRequestCallbackCollection::CallbackId id = ++m_nextCallbackId; | 24 FrameRequestCallbackCollection::CallbackId id = ++m_nextCallbackId; |
| 21 callback->m_cancelled = false; | 25 callback->m_cancelled = false; |
| 22 callback->m_id = id; | 26 callback->m_id = id; |
| 23 m_callbacks.append(callback); | 27 m_callbacks.append(callback); |
| 24 | 28 |
| 25 TRACE_EVENT_INSTANT1("devtools.timeline", "RequestAnimationFrame", TRACE_EVE NT_SCOPE_THREAD, "data", InspectorAnimationFrameEvent::data(m_context, id)); | 29 TRACE_EVENT_INSTANT1("devtools.timeline", "RequestAnimationFrame", TRACE_EVE NT_SCOPE_THREAD, "data", InspectorAnimationFrameEvent::data(m_context, id)); |
| 26 InspectorInstrumentation::didRequestAnimationFrame(m_context, id); | 30 InspectorInstrumentation::didRequestAnimationFrame(m_context, id); |
| 27 | 31 |
| 28 return id; | 32 return id; |
| 29 } | 33 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 DEFINE_TRACE(FrameRequestCallbackCollection) | 80 DEFINE_TRACE(FrameRequestCallbackCollection) |
| 77 { | 81 { |
| 78 #if ENABLE(OILPAN) | 82 #if ENABLE(OILPAN) |
| 79 visitor->trace(m_callbacks); | 83 visitor->trace(m_callbacks); |
| 80 visitor->trace(m_callbacksToInvoke); | 84 visitor->trace(m_callbacksToInvoke); |
| 81 visitor->trace(m_context); | 85 visitor->trace(m_context); |
| 82 #endif | 86 #endif |
| 83 } | 87 } |
| 84 | 88 |
| 85 } // namespace blink | 89 } // namespace blink |
| OLD | NEW |