OLD | NEW |
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 String16 m_scriptId; | 49 String16 m_scriptId; |
50 String16 m_scriptName; | 50 String16 m_scriptName; |
51 int m_lineNumber; | 51 int m_lineNumber; |
52 int m_columnNumber; | 52 int m_columnNumber; |
53 }; | 53 }; |
54 | 54 |
55 static void setCaptureStackTraceForUncaughtExceptions(v8::Isolate*, | 55 static void setCaptureStackTraceForUncaughtExceptions(v8::Isolate*, |
56 bool capture); | 56 bool capture); |
57 static std::unique_ptr<V8StackTraceImpl> create( | 57 static std::unique_ptr<V8StackTraceImpl> create( |
58 V8Debugger*, int contextGroupId, v8::Local<v8::StackTrace>, | 58 V8Debugger*, int contextGroupId, v8::Local<v8::StackTrace>, |
59 size_t maxStackSize, const String16& description = String16()); | 59 size_t maxStackSize, const String16& description = String16(), |
| 60 std::unique_ptr<V8StackTraceImpl> creationStackTrace = nullptr); |
60 static std::unique_ptr<V8StackTraceImpl> capture( | 61 static std::unique_ptr<V8StackTraceImpl> capture( |
61 V8Debugger*, int contextGroupId, size_t maxStackSize, | 62 V8Debugger*, int contextGroupId, size_t maxStackSize, |
62 const String16& description = String16()); | 63 const String16& description = String16(), |
| 64 std::unique_ptr<V8StackTraceImpl> creationStackTrace = nullptr); |
63 | 65 |
64 // This method drops the async chain. Use cloneImpl() instead. | 66 // This method drops the async chain. Use cloneImpl() instead. |
65 std::unique_ptr<V8StackTrace> clone() override; | 67 std::unique_ptr<V8StackTrace> clone() override; |
66 std::unique_ptr<V8StackTraceImpl> cloneImpl(); | 68 std::unique_ptr<V8StackTraceImpl> cloneImpl(); |
67 std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObjectForTail( | 69 std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObjectForTail( |
68 V8Debugger*) const; | 70 V8Debugger*) const; |
69 std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObjectImpl() | 71 std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObjectImpl() |
70 const; | 72 const; |
71 ~V8StackTraceImpl() override; | 73 ~V8StackTraceImpl() override; |
72 | 74 |
73 // V8StackTrace implementation. | 75 // V8StackTrace implementation. |
74 bool isEmpty() const override { return !m_frames.size(); }; | 76 bool isEmpty() const override { return !m_frames.size(); }; |
75 StringView topSourceURL() const override; | 77 StringView topSourceURL() const override; |
76 int topLineNumber() const override; | 78 int topLineNumber() const override; |
77 int topColumnNumber() const override; | 79 int topColumnNumber() const override; |
78 StringView topScriptId() const override; | 80 StringView topScriptId() const override; |
79 StringView topFunctionName() const override; | 81 StringView topFunctionName() const override; |
80 std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject() | 82 std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject() |
81 const override; | 83 const override; |
82 std::unique_ptr<StringBuffer> toString() const override; | 84 std::unique_ptr<StringBuffer> toString() const override; |
83 | 85 |
84 private: | 86 private: |
85 V8StackTraceImpl(int contextGroupId, const String16& description, | 87 V8StackTraceImpl(int contextGroupId, const String16& description, |
86 std::vector<Frame>& frames, | 88 std::vector<Frame>& frames, |
87 std::unique_ptr<V8StackTraceImpl> parent); | 89 std::unique_ptr<V8StackTraceImpl> parent, |
| 90 std::unique_ptr<V8StackTraceImpl> creation); |
88 | 91 |
89 int m_contextGroupId; | 92 int m_contextGroupId; |
90 String16 m_description; | 93 String16 m_description; |
91 std::vector<Frame> m_frames; | 94 std::vector<Frame> m_frames; |
92 std::unique_ptr<V8StackTraceImpl> m_parent; | 95 std::unique_ptr<V8StackTraceImpl> m_parent; |
| 96 std::unique_ptr<V8StackTraceImpl> m_creation; |
93 | 97 |
94 DISALLOW_COPY_AND_ASSIGN(V8StackTraceImpl); | 98 DISALLOW_COPY_AND_ASSIGN(V8StackTraceImpl); |
95 }; | 99 }; |
96 | 100 |
97 } // namespace v8_inspector | 101 } // namespace v8_inspector |
98 | 102 |
99 #endif // V8_INSPECTOR_V8STACKTRACEIMPL_H_ | 103 #endif // V8_INSPECTOR_V8STACKTRACEIMPL_H_ |
OLD | NEW |