Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/inspector/V8AsyncCallTracker.h" | 6 #include "core/inspector/V8AsyncCallTracker.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/V8PerContextData.h" | 8 #include "bindings/core/v8/V8PerContextData.h" |
| 9 #include "core/inspector/AsyncCallChainMap.h" | 9 #include "core/inspector/AsyncCallChainMap.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 else if (eventType == v8AsyncTaskEventDidHandle) | 107 else if (eventType == v8AsyncTaskEventDidHandle) |
| 108 m_debuggerAgent->traceAsyncCallbackCompleted(); | 108 m_debuggerAgent->traceAsyncCallbackCompleted(); |
| 109 else | 109 else |
| 110 ASSERT_NOT_REACHED(); | 110 ASSERT_NOT_REACHED(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void V8AsyncCallTracker::didEnqueueV8AsyncTask(ScriptState* state, const String& eventName, int id) | 113 void V8AsyncCallTracker::didEnqueueV8AsyncTask(ScriptState* state, const String& eventName, int id) |
| 114 { | 114 { |
| 115 ASSERT(state); | 115 ASSERT(state); |
| 116 ASSERT(m_debuggerAgent->trackingAsyncCalls()); | 116 ASSERT(m_debuggerAgent->trackingAsyncCalls()); |
| 117 RefPtrWillBeRawPtr<AsyncCallChain> callChain = m_debuggerAgent->traceAsyncOp erationStarting(eventName); | 117 int operationId = m_debuggerAgent->traceAsyncOperationStarting(eventName); |
| 118 if (!callChain) | 118 if (!operationId) |
| 119 return; | 119 return; |
| 120 V8ContextAsyncCallChains* contextCallChains = m_contextAsyncCallChainMap.get (state); | 120 V8ContextAsyncCallChains* contextCallChains = m_contextAsyncCallChainMap.get (state); |
| 121 if (!contextCallChains) | 121 if (!contextCallChains) |
| 122 contextCallChains = m_contextAsyncCallChainMap.set(state, adoptPtrWillBe Noop(new V8ContextAsyncCallChains(m_debuggerAgent))).storedValue->value.get(); | 122 contextCallChains = m_contextAsyncCallChainMap.set(state, adoptPtrWillBe Noop(new V8ContextAsyncCallChains(m_debuggerAgent))).storedValue->value.get(); |
| 123 contextCallChains->m_v8AsyncCallChains.set(makeV8AsyncTaskUniqueId(eventName , id), callChain.release()); | 123 contextCallChains->m_v8AsyncCallChains.set(makeV8AsyncTaskUniqueId(eventName , id), operationId); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void V8AsyncCallTracker::willHandleV8AsyncTask(ScriptState* state, const String& eventName, int id) | 126 void V8AsyncCallTracker::willHandleV8AsyncTask(ScriptState* state, const String& eventName, int id) |
| 127 { | 127 { |
| 128 ASSERT(state); | 128 ASSERT(state); |
| 129 ASSERT(m_debuggerAgent->trackingAsyncCalls()); | 129 ASSERT(m_debuggerAgent->trackingAsyncCalls()); |
| 130 if (V8ContextAsyncCallChains* contextCallChains = m_contextAsyncCallChainMap .get(state)) { | 130 if (V8ContextAsyncCallChains* contextCallChains = m_contextAsyncCallChainMap .get(state)) { |
| 131 String taskId = makeV8AsyncTaskUniqueId(eventName, id); | 131 String taskId = makeV8AsyncTaskUniqueId(eventName, id); |
| 132 m_debuggerAgent->traceAsyncCallbackStarting(state->isolate(), contextCal lChains->m_v8AsyncCallChains.get(taskId)); | 132 m_debuggerAgent->traceAsyncCallbackStarting(state->isolate(), contextCal lChains->m_v8AsyncCallChains.get(taskId)); |
| 133 contextCallChains->m_v8AsyncCallChains.remove(taskId); | 133 contextCallChains->m_v8AsyncCallChains.remove(taskId); |
| 134 } else { | 134 } else { |
| 135 m_debuggerAgent->traceAsyncCallbackStarting(state->isolate(), nullptr); | 135 m_debuggerAgent->traceAsyncCallbackStarting(state->isolate(), 0); |
|
aandrey
2015/01/20 14:33:36
0 -> public const
yurys
2015/01/20 17:15:39
Done.
| |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| OLD | NEW |