OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/inspector/AsyncCallTracker.h" | 32 #include "core/inspector/AsyncCallTracker.h" |
33 | 33 |
34 #include "core/dom/ContextLifecycleObserver.h" | 34 #include "core/dom/ContextLifecycleObserver.h" |
35 #include "core/dom/ExecutionContext.h" | 35 #include "core/dom/ExecutionContext.h" |
36 #include "core/dom/ExecutionContextTask.h" | 36 #include "core/dom/ExecutionContextTask.h" |
37 #include "core/events/Event.h" | 37 #include "core/events/Event.h" |
38 #include "core/events/EventTarget.h" | 38 #include "core/events/EventTarget.h" |
39 #include "core/inspector/AsyncOperationMap.h" | 39 #include "core/inspector/AsyncOperationMap.h" |
| 40 #include "core/inspector/V8DebuggerAgent.h" |
40 #include "core/xmlhttprequest/XMLHttpRequest.h" | 41 #include "core/xmlhttprequest/XMLHttpRequest.h" |
41 #include "core/xmlhttprequest/XMLHttpRequestUpload.h" | 42 #include "core/xmlhttprequest/XMLHttpRequestUpload.h" |
42 #include "platform/ScriptForbiddenScope.h" | 43 #include "platform/ScriptForbiddenScope.h" |
43 #include "wtf/text/StringBuilder.h" | 44 #include "wtf/text/StringBuilder.h" |
44 #include "wtf/text/StringHash.h" | 45 #include "wtf/text/StringHash.h" |
45 | 46 |
46 namespace { | 47 namespace { |
47 | 48 |
48 static const char setTimeoutName[] = "setTimeout"; | 49 static const char setTimeoutName[] = "setTimeout"; |
49 static const char setIntervalName[] = "setInterval"; | 50 static const char setIntervalName[] = "setInterval"; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 return static_cast<XMLHttpRequest*>(eventTarget); | 133 return static_cast<XMLHttpRequest*>(eventTarget); |
133 if (interfaceName == EventTargetNames::XMLHttpRequestUpload) | 134 if (interfaceName == EventTargetNames::XMLHttpRequestUpload) |
134 return static_cast<XMLHttpRequestUpload*>(eventTarget)->xmlHttpRequest()
; | 135 return static_cast<XMLHttpRequestUpload*>(eventTarget)->xmlHttpRequest()
; |
135 return nullptr; | 136 return nullptr; |
136 } | 137 } |
137 | 138 |
138 AsyncCallTracker::AsyncCallTracker(V8DebuggerAgent* debuggerAgent, Instrumenting
Agents* instrumentingAgents) | 139 AsyncCallTracker::AsyncCallTracker(V8DebuggerAgent* debuggerAgent, Instrumenting
Agents* instrumentingAgents) |
139 : m_debuggerAgent(debuggerAgent) | 140 : m_debuggerAgent(debuggerAgent) |
140 , m_instrumentingAgents(instrumentingAgents) | 141 , m_instrumentingAgents(instrumentingAgents) |
141 { | 142 { |
| 143 m_debuggerAgent->addAsyncCallTrackingListener(this); |
142 } | 144 } |
143 | 145 |
144 AsyncCallTracker::~AsyncCallTracker() | 146 AsyncCallTracker::~AsyncCallTracker() |
145 { | 147 { |
| 148 #if !ENABLE(OILPAN) |
| 149 m_debuggerAgent->removeAsyncCallTrackingListener(this); |
| 150 #endif |
146 } | 151 } |
147 | 152 |
148 void AsyncCallTracker::asyncCallTrackingStateChanged(bool tracking) | 153 void AsyncCallTracker::asyncCallTrackingStateChanged(bool tracking) |
149 { | 154 { |
150 m_instrumentingAgents->setAsyncCallTracker(tracking ? this : nullptr); | 155 m_instrumentingAgents->setAsyncCallTracker(tracking ? this : nullptr); |
151 } | 156 } |
152 | 157 |
153 void AsyncCallTracker::resetAsyncOperations() | 158 void AsyncCallTracker::resetAsyncOperations() |
154 { | 159 { |
155 for (auto& it : m_executionContextDataMap) | 160 for (auto& it : m_executionContextDataMap) |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 return data; | 427 return data; |
423 } | 428 } |
424 | 429 |
425 DEFINE_TRACE(AsyncCallTracker) | 430 DEFINE_TRACE(AsyncCallTracker) |
426 { | 431 { |
427 #if ENABLE(OILPAN) | 432 #if ENABLE(OILPAN) |
428 visitor->trace(m_executionContextDataMap); | 433 visitor->trace(m_executionContextDataMap); |
429 visitor->trace(m_debuggerAgent); | 434 visitor->trace(m_debuggerAgent); |
430 visitor->trace(m_instrumentingAgents); | 435 visitor->trace(m_instrumentingAgents); |
431 #endif | 436 #endif |
| 437 V8DebuggerAgent::AsyncCallTrackingListener::trace(visitor); |
432 } | 438 } |
433 | 439 |
434 } // namespace blink | 440 } // namespace blink |
OLD | NEW |