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

Side by Side Diff: third_party/WebKit/Source/core/inspector/AsyncCallTracker.cpp

Issue 1367623006: DevTools: extract V8DebuggerAgent interface, move it under .../inspector/v8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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) 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
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"
41 #include "core/xmlhttprequest/XMLHttpRequest.h" 40 #include "core/xmlhttprequest/XMLHttpRequest.h"
42 #include "core/xmlhttprequest/XMLHttpRequestUpload.h" 41 #include "core/xmlhttprequest/XMLHttpRequestUpload.h"
43 #include "platform/ScriptForbiddenScope.h" 42 #include "platform/ScriptForbiddenScope.h"
44 #include "wtf/text/StringBuilder.h" 43 #include "wtf/text/StringBuilder.h"
45 #include "wtf/text/StringHash.h" 44 #include "wtf/text/StringHash.h"
46 45
47 namespace { 46 namespace {
48 47
49 static const char setTimeoutName[] = "setTimeout"; 48 static const char setTimeoutName[] = "setTimeout";
50 static const char setIntervalName[] = "setInterval"; 49 static const char setIntervalName[] = "setInterval";
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return static_cast<XMLHttpRequest*>(eventTarget); 132 return static_cast<XMLHttpRequest*>(eventTarget);
134 if (interfaceName == EventTargetNames::XMLHttpRequestUpload) 133 if (interfaceName == EventTargetNames::XMLHttpRequestUpload)
135 return static_cast<XMLHttpRequestUpload*>(eventTarget)->xmlHttpRequest() ; 134 return static_cast<XMLHttpRequestUpload*>(eventTarget)->xmlHttpRequest() ;
136 return nullptr; 135 return nullptr;
137 } 136 }
138 137
139 AsyncCallTracker::AsyncCallTracker(V8DebuggerAgent* debuggerAgent, Instrumenting Agents* instrumentingAgents) 138 AsyncCallTracker::AsyncCallTracker(V8DebuggerAgent* debuggerAgent, Instrumenting Agents* instrumentingAgents)
140 : m_debuggerAgent(debuggerAgent) 139 : m_debuggerAgent(debuggerAgent)
141 , m_instrumentingAgents(instrumentingAgents) 140 , m_instrumentingAgents(instrumentingAgents)
142 { 141 {
143 m_debuggerAgent->addAsyncCallTrackingListener(this);
144 } 142 }
145 143
146 AsyncCallTracker::~AsyncCallTracker() 144 AsyncCallTracker::~AsyncCallTracker()
147 { 145 {
148 #if !ENABLE(OILPAN)
149 m_debuggerAgent->removeAsyncCallTrackingListener(this);
150 #endif
151 } 146 }
152 147
153 void AsyncCallTracker::asyncCallTrackingStateChanged(bool tracking) 148 void AsyncCallTracker::asyncCallTrackingStateChanged(bool tracking)
154 { 149 {
155 m_instrumentingAgents->setAsyncCallTracker(tracking ? this : nullptr); 150 m_instrumentingAgents->setAsyncCallTracker(tracking ? this : nullptr);
156 } 151 }
157 152
158 void AsyncCallTracker::resetAsyncOperations() 153 void AsyncCallTracker::resetAsyncOperations()
159 { 154 {
160 for (auto& it : m_executionContextDataMap) 155 for (auto& it : m_executionContextDataMap)
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 return data; 422 return data;
428 } 423 }
429 424
430 DEFINE_TRACE(AsyncCallTracker) 425 DEFINE_TRACE(AsyncCallTracker)
431 { 426 {
432 #if ENABLE(OILPAN) 427 #if ENABLE(OILPAN)
433 visitor->trace(m_executionContextDataMap); 428 visitor->trace(m_executionContextDataMap);
434 visitor->trace(m_debuggerAgent); 429 visitor->trace(m_debuggerAgent);
435 visitor->trace(m_instrumentingAgents); 430 visitor->trace(m_instrumentingAgents);
436 #endif 431 #endif
437 V8DebuggerAgent::AsyncCallTrackingListener::trace(visitor);
438 } 432 }
439 433
440 } // namespace blink 434 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698