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

Side by Side Diff: Source/core/inspector/AsyncCallStackTracker.h

Issue 422273002: Oilpan: Prepare moving AsyncCallStackTracker to Oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged 413113003 Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/inspector/AsyncCallStackTracker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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> {
aandrey 2014/08/11 11:11:04 FINAL
keishi 2014/08/11 13:01:45 Done.
53 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker); 53 WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker);
54 public: 54 public:
55 class AsyncCallStack : public RefCounted<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 String description() const { return m_description; } 60 String description() const { return m_description; }
60 ScriptValue callFrames() const { return m_callFrames; } 61 ScriptValue callFrames() const { return m_callFrames; }
61 private: 62 private:
62 String m_description; 63 String m_description;
63 ScriptValue m_callFrames; 64 ScriptValue m_callFrames;
64 }; 65 };
65 66
66 typedef Deque<RefPtr<AsyncCallStack>, 4> AsyncCallStackVector; 67 typedef WillBeHeapDeque<RefPtrWillBeMember<AsyncCallStack>, 4> AsyncCallStac kVector;
67 68
68 class AsyncCallChain : public RefCounted<AsyncCallChain> { 69 class AsyncCallChain : public RefCountedWillBeGarbageCollected<AsyncCallChai n> {
aandrey 2014/08/11 11:11:04 FINAL, RefCountedWillBeGarbageCollectedFinalized
keishi 2014/08/11 13:01:45 Added FINAL. AsyncCallChain doesn't seem to requir
69 public: 70 public:
70 AsyncCallChain() { } 71 AsyncCallChain() { }
71 AsyncCallChain(const AsyncCallChain& t) : m_callStacks(t.m_callStacks) { } 72 AsyncCallChain(const AsyncCallChain& t) : m_callStacks(t.m_callStacks) { }
72 AsyncCallStackVector callStacks() const { return m_callStacks; } 73 AsyncCallStackVector callStacks() const { return m_callStacks; }
74 void trace(Visitor*);
73 private: 75 private:
74 friend class AsyncCallStackTracker; 76 friend class AsyncCallStackTracker;
75 AsyncCallStackVector m_callStacks; 77 AsyncCallStackVector m_callStacks;
76 }; 78 };
77 79
78 AsyncCallStackTracker(); 80 AsyncCallStackTracker();
79 81
80 bool isEnabled() const { return m_maxAsyncCallStackDepth; } 82 bool isEnabled() const { return m_maxAsyncCallStackDepth; }
81 void setAsyncCallStackDepth(int); 83 void setAsyncCallStackDepth(int);
82 const AsyncCallChain* currentAsyncCallChain() const; 84 const AsyncCallChain* currentAsyncCallChain() const;
(...skipping 25 matching lines...) Expand all
108 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);
109 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i d); 111 void willHandleV8AsyncTask(ExecutionContext*, const String& eventName, int i d);
110 112
111 int traceAsyncOperationStarting(ExecutionContext*, const String& operationNa me, const ScriptValue& callFrames); 113 int traceAsyncOperationStarting(ExecutionContext*, const String& operationNa me, const ScriptValue& callFrames);
112 void traceAsyncOperationCompleted(ExecutionContext*, int operationId); 114 void traceAsyncOperationCompleted(ExecutionContext*, int operationId);
113 void traceAsyncCallbackStarting(ExecutionContext*, int operationId); 115 void traceAsyncCallbackStarting(ExecutionContext*, int operationId);
114 116
115 void didFireAsyncCall(); 117 void didFireAsyncCall();
116 void clear(); 118 void clear();
117 119
120 void trace(Visitor*);
121
118 private: 122 private:
119 void willHandleXHREvent(XMLHttpRequest*, Event*); 123 void willHandleXHREvent(XMLHttpRequest*, Event*);
120 124
121 PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, c onst ScriptValue& callFrames); 125 PassRefPtrWillBeRawPtr<AsyncCallChain> createAsyncCallChain(const String& de scription, const ScriptValue& callFrames);
122 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtr<AsyncCallChain>) ; 126 void setCurrentAsyncCallChain(ExecutionContext*, PassRefPtrWillBeRawPtr<Asyn cCallChain>);
123 void clearCurrentAsyncCallChain(); 127 void clearCurrentAsyncCallChain();
124 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned); 128 static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned);
125 bool validateCallFrames(const ScriptValue& callFrames); 129 bool validateCallFrames(const ScriptValue& callFrames);
126 130
127 class ExecutionContextData; 131 class ExecutionContextData;
128 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*); 132 ExecutionContextData* createContextDataIfNeeded(ExecutionContext*);
129 133
130 unsigned m_maxAsyncCallStackDepth; 134 unsigned m_maxAsyncCallStackDepth;
131 RefPtr<AsyncCallChain> m_currentAsyncCallChain; 135 RefPtrWillBeMember<AsyncCallChain> m_currentAsyncCallChain;
132 unsigned m_nestedAsyncCallCount; 136 unsigned m_nestedAsyncCallCount;
133 typedef HashMap<ExecutionContext*, ExecutionContextData*> ExecutionContextDa taMap; 137 typedef WillBeHeapHashMap<ExecutionContext*, OwnPtrWillBeMember<ExecutionCon textData> > ExecutionContextDataMap;
134 ExecutionContextDataMap m_executionContextDataMap; 138 ExecutionContextDataMap m_executionContextDataMap;
135 }; 139 };
136 140
137 } // namespace blink 141 } // namespace blink
138 142
139 #endif // !defined(AsyncCallStackTracker_h) 143 #endif // !defined(AsyncCallStackTracker_h)
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/AsyncCallStackTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698