Chromium Code Reviews| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 class Event; | 44 class Event; |
| 45 class EventListener; | 45 class EventListener; |
| 46 class EventTarget; | 46 class EventTarget; |
| 47 class ExecutionContext; | 47 class ExecutionContext; |
| 48 class ExecutionContextTask; | 48 class ExecutionContextTask; |
| 49 class MutationObserver; | 49 class MutationObserver; |
| 50 class XMLHttpRequest; | 50 class XMLHttpRequest; |
| 51 | 51 |
| 52 class AsyncCallStackTracker { | 52 class AsyncCallStackTracker : public NoBaseWillBeGarbageCollectedFinalized<Async CallStackTracker> { |
| 53 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker); | 53 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker); |
| 54 public: | 54 public: |
| 55 class AsyncCallStack FINAL : public RefCountedWillBeGarbageCollectedFinalize d<AsyncCallStack> { | 55 class AsyncCallStack FINAL : public RefCountedWillBeGarbageCollectedFinalize d<AsyncCallStack> { |
| 56 public: | 56 public: |
| 57 AsyncCallStack(const String&, const ScriptValue&); | 57 AsyncCallStack(const String&, const ScriptValue&); |
| 58 ~AsyncCallStack(); | 58 ~AsyncCallStack(); |
| 59 void trace(Visitor*) { } | 59 void trace(Visitor*) { } |
| 60 String description() const { return m_description; } | 60 String description() const { return m_description; } |
| 61 ScriptValue callFrames() const { return m_callFrames; } | 61 ScriptValue callFrames() const { return m_callFrames; } |
| 62 private: | 62 private: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 void didEnqueueV8AsyncTask(ExecutionContext*, const String& eventName, int i d, const ScriptValue& callFrames); | 110 void didEnqueueV8AsyncTask(ExecutionContext*, const String& eventName, int i d, const ScriptValue& callFrames); |
| 111 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i d); | 111 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i d); |
| 112 | 112 |
| 113 int traceAsyncOperationStarting(ExecutionContext*, const String& operationNa me, const ScriptValue& callFrames); | 113 int traceAsyncOperationStarting(ExecutionContext*, const String& operationNa me, const ScriptValue& callFrames); |
| 114 void traceAsyncOperationCompleted(ExecutionContext*, int operationId); | 114 void traceAsyncOperationCompleted(ExecutionContext*, int operationId); |
| 115 void traceAsyncCallbackStarting(ExecutionContext*, int operationId); | 115 void traceAsyncCallbackStarting(ExecutionContext*, int operationId); |
| 116 | 116 |
| 117 void didFireAsyncCall(); | 117 void didFireAsyncCall(); |
| 118 void clear(); | 118 void clear(); |
| 119 | 119 |
| 120 void trace(Visitor*); | |
| 121 | |
| 120 private: | 122 private: |
| 121 void willHandleXHREvent(XMLHttpRequest*, Event*); | 123 void willHandleXHREvent(XMLHttpRequest*, Event*); |
| 122 | 124 |
| 123 PassRefPtrWillBeRawPtr<AsyncCallChain> createAsyncCallChain(const String& de scription, const ScriptValue& callFrames); | 125 PassRefPtrWillBeRawPtr<AsyncCallChain> createAsyncCallChain(const String& de scription, const ScriptValue& callFrames); |
| 124 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtrWillBeRawPtr<Asyn cCallChain>); | 126 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtrWillBeRawPtr<Asyn cCallChain>); |
| 125 void clearCurrentAsyncCallChain(); | 127 void clearCurrentAsyncCallChain(); |
| 126 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); | 128 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); |
| 127 bool validateCallFrames(const ScriptValue& callFrames); | 129 bool validateCallFrames(const ScriptValue& callFrames); |
| 128 | 130 |
| 129 class ExecutionContextData; | 131 class ExecutionContextData; |
| 130 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); | 132 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); |
| 131 | 133 |
| 132 unsigned m_maxAsyncCallStackDepth; | 134 unsigned m_maxAsyncCallStackDepth; |
| 133 RefPtrWillBePersistent<AsyncCallChain> m_currentAsyncCallChain; | 135 RefPtrWillBeMember<AsyncCallChain> m_currentAsyncCallChain; |
| 134 unsigned m_nestedAsyncCallCount; | 136 unsigned m_nestedAsyncCallCount; |
| 135 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa taMap; | 137 typedef WillBeHeapHashMap<ExecutionContext*, OwnPtrWillBeMember<ExecutionCon textData> > ExecutionContextDataMap; |
|
haraken
2014/08/11 10:59:59
ExecutionContext is on-heap, so you can use a Memb
keishi
2014/08/11 13:01:45
Done.
| |
| 136 ExecutionContextDataMap m_executionContextDataMap; | 138 ExecutionContextDataMap m_executionContextDataMap; |
| 137 }; | 139 }; |
| 138 | 140 |
| 139 } // namespace blink | 141 } // namespace blink |
| 140 | 142 |
| 141 #endif // !defined(AsyncCallStackTracker_h) | 143 #endif // !defined(AsyncCallStackTracker_h) |
| OLD | NEW |