| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef V8AsyncCallTracker_h | |
| 6 #define V8AsyncCallTracker_h | |
| 7 | |
| 8 #include "platform/inspector_protocol/Allocator.h" | |
| 9 #include "platform/inspector_protocol/Collections.h" | |
| 10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | |
| 11 | |
| 12 #include <v8.h> | |
| 13 | |
| 14 namespace blink { | |
| 15 | |
| 16 class V8AsyncCallTracker final { | |
| 17 PROTOCOL_DISALLOW_COPY(V8AsyncCallTracker); | |
| 18 public: | |
| 19 static PassOwnPtr<V8AsyncCallTracker> create(V8DebuggerAgentImpl* debuggerAg
ent) | |
| 20 { | |
| 21 return adoptPtr(new V8AsyncCallTracker(debuggerAgent)); | |
| 22 } | |
| 23 | |
| 24 ~V8AsyncCallTracker(); | |
| 25 | |
| 26 void asyncCallTrackingStateChanged(bool tracking); | |
| 27 void resetAsyncOperations(); | |
| 28 | |
| 29 void didReceiveV8AsyncTaskEvent(v8::Local<v8::Context>, const String16& even
tType, const String16& eventName, int id); | |
| 30 | |
| 31 void contextDisposed(int contextId); | |
| 32 | |
| 33 private: | |
| 34 struct Operations { | |
| 35 protocol::HashMap<String16, int> map; | |
| 36 int contextId; | |
| 37 V8AsyncCallTracker* target; | |
| 38 v8::Global<v8::Context> context; | |
| 39 }; | |
| 40 | |
| 41 static void weakCallback(const v8::WeakCallbackInfo<Operations>& data); | |
| 42 | |
| 43 explicit V8AsyncCallTracker(V8DebuggerAgentImpl*); | |
| 44 | |
| 45 void didEnqueueV8AsyncTask(v8::Local<v8::Context>, const String16& eventName
, int id); | |
| 46 void willHandleV8AsyncTask(v8::Local<v8::Context>, const String16& eventName
, int id); | |
| 47 void completeOperations(const protocol::HashMap<String16, int>& contextCallC
hains); | |
| 48 | |
| 49 V8DebuggerAgentImpl* m_debuggerAgent; | |
| 50 protocol::HashMap<int, OwnPtr<Operations>> m_idToOperations; | |
| 51 }; | |
| 52 | |
| 53 } // namespace blink | |
| 54 | |
| 55 #endif // V8AsyncCallTracker_h | |
| OLD | NEW |