| 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 #ifndef PromiseTracker_h | 5 #ifndef PromiseTracker_h |
| 6 #define PromiseTracker_h | 6 #define PromiseTracker_h |
| 7 | 7 |
| 8 #include "core/InspectorTypeBuilder.h" | 8 #include "core/InspectorTypeBuilder.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/HashMap.h" | 10 #include "wtf/HashMap.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 static PassOwnPtrWillBeRawPtr<PromiseTracker> create() | 25 static PassOwnPtrWillBeRawPtr<PromiseTracker> create() |
| 26 { | 26 { |
| 27 return adoptPtrWillBeNoop(new PromiseTracker()); | 27 return adoptPtrWillBeNoop(new PromiseTracker()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool isEnabled() const { return m_isEnabled; } | 30 bool isEnabled() const { return m_isEnabled; } |
| 31 void setEnabled(bool); | 31 void setEnabled(bool); |
| 32 | 32 |
| 33 void clear(); | 33 void clear(); |
| 34 | 34 |
| 35 void didReceiveV8PromiseEvent(ScriptState*, v8::Handle<v8::Object> promise,
v8::Handle<v8::Value> parentPromise, int status); | 35 void didReceiveV8PromiseEvent(ScriptState*, v8::Local<v8::Object> promise, v
8::Local<v8::Value> parentPromise, int status); |
| 36 | 36 |
| 37 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::PromiseDetails> > promi
ses(); | 37 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::PromiseDetails> > promi
ses(); |
| 38 ScriptValue promiseById(int promiseId) const; | 38 ScriptValue promiseById(int promiseId) const; |
| 39 | 39 |
| 40 class PromiseData; | 40 class PromiseData; |
| 41 | 41 |
| 42 typedef WillBeHeapVector<RefPtrWillBeMember<PromiseData> > PromiseDataVector
; | 42 typedef WillBeHeapVector<RefPtrWillBeMember<PromiseData> > PromiseDataVector
; |
| 43 typedef WillBeHeapHashMap<int, PromiseDataVector> PromiseDataMap; | 43 typedef WillBeHeapHashMap<int, PromiseDataVector> PromiseDataMap; |
| 44 typedef WillBeHeapHashMap<int, RefPtrWillBeMember<PromiseData> > PromiseIdTo
DataMap; | 44 typedef WillBeHeapHashMap<int, RefPtrWillBeMember<PromiseData> > PromiseIdTo
DataMap; |
| 45 | 45 |
| 46 void trace(Visitor*); | 46 void trace(Visitor*); |
| 47 | 47 |
| 48 PromiseDataMap& promiseDataMap() { return m_promiseDataMap; } | 48 PromiseDataMap& promiseDataMap() { return m_promiseDataMap; } |
| 49 PromiseIdToDataMap& promiseIdToDataMap() { return m_promiseIdToDataMap; } | 49 PromiseIdToDataMap& promiseIdToDataMap() { return m_promiseIdToDataMap; } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 PromiseTracker(); | 52 PromiseTracker(); |
| 53 | 53 |
| 54 int circularSequentialId(); | 54 int circularSequentialId(); |
| 55 PassRefPtrWillBeRawPtr<PromiseData> createPromiseDataIfNeeded(ScriptState*,
v8::Handle<v8::Object> promise); | 55 PassRefPtrWillBeRawPtr<PromiseData> createPromiseDataIfNeeded(ScriptState*,
v8::Local<v8::Object> promise); |
| 56 | 56 |
| 57 int m_circularSequentialId; | 57 int m_circularSequentialId; |
| 58 PromiseDataMap m_promiseDataMap; | 58 PromiseDataMap m_promiseDataMap; |
| 59 bool m_isEnabled; | 59 bool m_isEnabled; |
| 60 PromiseIdToDataMap m_promiseIdToDataMap; | 60 PromiseIdToDataMap m_promiseIdToDataMap; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace blink | 63 } // namespace blink |
| 64 | 64 |
| 65 #endif // !defined(PromiseTracker_h) | 65 #endif // !defined(PromiseTracker_h) |
| OLD | NEW |