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

Side by Side Diff: src/inspector/v8-stack-trace-impl.h

Issue 2868493002: [inspector] use creation stack trace as parent for async call chains (Closed)
Patch Set: Created 3 years, 7 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 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project 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 V8_INSPECTOR_V8STACKTRACEIMPL_H_ 5 #ifndef V8_INSPECTOR_V8STACKTRACEIMPL_H_
6 #define V8_INSPECTOR_V8STACKTRACEIMPL_H_ 6 #define V8_INSPECTOR_V8STACKTRACEIMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObject( 96 std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObject(
97 AsyncStackTrace* asyncCreation, int maxAsyncDepth) const; 97 AsyncStackTrace* asyncCreation, int maxAsyncDepth) const;
98 98
99 int contextGroupId() const; 99 int contextGroupId() const;
100 const String16& description() const; 100 const String16& description() const;
101 std::weak_ptr<AsyncStackTrace> parent() const; 101 std::weak_ptr<AsyncStackTrace> parent() const;
102 std::weak_ptr<AsyncStackTrace> creation() const; 102 std::weak_ptr<AsyncStackTrace> creation() const;
103 bool isEmpty() const; 103 bool isEmpty() const;
104 104
105 void setDescription(const String16& description) {
106 // TODO(kozyatinskiy): implement it without hack.
107 DCHECK(!m_description.length() || m_description == description);
108 m_description = description;
109 }
110
105 private: 111 private:
106 AsyncStackTrace(int contextGroupId, const String16& description, 112 AsyncStackTrace(int contextGroupId, const String16& description,
107 std::vector<std::shared_ptr<StackFrame>> frames, 113 std::vector<std::shared_ptr<StackFrame>> frames,
108 std::shared_ptr<AsyncStackTrace> asyncParent, 114 std::shared_ptr<AsyncStackTrace> asyncParent,
109 std::shared_ptr<AsyncStackTrace> asyncCreation); 115 std::shared_ptr<AsyncStackTrace> asyncCreation);
110 116
111 int m_contextGroupId; 117 int m_contextGroupId;
112 String16 m_description; 118 String16 m_description;
113 119
114 std::vector<std::shared_ptr<StackFrame>> m_frames; 120 std::vector<std::shared_ptr<StackFrame>> m_frames;
115 std::weak_ptr<AsyncStackTrace> m_asyncParent; 121 std::weak_ptr<AsyncStackTrace> m_asyncParent;
116 std::weak_ptr<AsyncStackTrace> m_asyncCreation; 122 std::weak_ptr<AsyncStackTrace> m_asyncCreation;
117 123
118 DISALLOW_COPY_AND_ASSIGN(AsyncStackTrace); 124 DISALLOW_COPY_AND_ASSIGN(AsyncStackTrace);
119 }; 125 };
120 126
121 } // namespace v8_inspector 127 } // namespace v8_inspector
122 128
123 #endif // V8_INSPECTOR_V8STACKTRACEIMPL_H_ 129 #endif // V8_INSPECTOR_V8STACKTRACEIMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698