| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 StringView topSourceURL() const override; | 67 StringView topSourceURL() const override; |
| 68 int topLineNumber() const override; // 1-based. | 68 int topLineNumber() const override; // 1-based. |
| 69 int topColumnNumber() const override; // 1-based. | 69 int topColumnNumber() const override; // 1-based. |
| 70 StringView topScriptId() const override; | 70 StringView topScriptId() const override; |
| 71 StringView topFunctionName() const override; | 71 StringView topFunctionName() const override; |
| 72 std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject() | 72 std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject() |
| 73 const override; | 73 const override; |
| 74 std::unique_ptr<StringBuffer> toString() const override; | 74 std::unique_ptr<StringBuffer> toString() const override; |
| 75 | 75 |
| 76 bool isEqualIgnoringTopFrame(V8StackTraceImpl* stackTrace) const; | 76 bool isEqualIgnoringTopFrame(V8StackTraceImpl* stackTrace) const; |
| 77 bool isPrefix(V8StackTraceImpl* stackTrace) const; |
| 77 | 78 |
| 78 private: | 79 private: |
| 79 V8StackTraceImpl(std::vector<std::shared_ptr<StackFrame>> frames, | 80 V8StackTraceImpl(std::vector<std::shared_ptr<StackFrame>> frames, |
| 80 int maxAsyncDepth, | 81 int maxAsyncDepth, |
| 81 std::shared_ptr<AsyncStackTrace> asyncParent, | 82 std::shared_ptr<AsyncStackTrace> asyncParent, |
| 82 std::shared_ptr<AsyncStackTrace> asyncCreation); | 83 std::shared_ptr<AsyncStackTrace> asyncCreation); |
| 83 | 84 |
| 84 class StackFrameIterator { | 85 class StackFrameIterator { |
| 85 public: | 86 public: |
| 86 explicit StackFrameIterator(const V8StackTraceImpl* stackTrace); | 87 explicit StackFrameIterator(const V8StackTraceImpl* stackTrace); |
| 87 | 88 |
| 88 void next(); | 89 void next(); |
| 89 StackFrame* frame(); | 90 StackFrame* frame(); |
| 90 bool done(); | 91 bool done(); |
| 91 | 92 |
| 92 private: | 93 private: |
| 93 std::vector<std::shared_ptr<StackFrame>>::const_iterator m_currentIt; | 94 std::vector<std::shared_ptr<StackFrame>>::const_iterator m_currentIt; |
| 94 std::vector<std::shared_ptr<StackFrame>>::const_iterator m_currentEnd; | 95 std::vector<std::shared_ptr<StackFrame>>::const_iterator m_currentEnd; |
| 95 AsyncStackTrace* m_parent; | 96 AsyncStackTrace* m_parent; |
| 96 }; | 97 }; |
| 98 void allFrames(std::vector<StackFrame*>* frames) const; |
| 97 | 99 |
| 98 std::vector<std::shared_ptr<StackFrame>> m_frames; | 100 std::vector<std::shared_ptr<StackFrame>> m_frames; |
| 99 int m_maxAsyncDepth; | 101 int m_maxAsyncDepth; |
| 100 std::weak_ptr<AsyncStackTrace> m_asyncParent; | 102 std::weak_ptr<AsyncStackTrace> m_asyncParent; |
| 101 std::weak_ptr<AsyncStackTrace> m_asyncCreation; | 103 std::weak_ptr<AsyncStackTrace> m_asyncCreation; |
| 102 | 104 |
| 103 DISALLOW_COPY_AND_ASSIGN(V8StackTraceImpl); | 105 DISALLOW_COPY_AND_ASSIGN(V8StackTraceImpl); |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 class AsyncStackTrace { | 108 class AsyncStackTrace { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 std::vector<std::shared_ptr<StackFrame>> m_frames; | 141 std::vector<std::shared_ptr<StackFrame>> m_frames; |
| 140 std::weak_ptr<AsyncStackTrace> m_asyncParent; | 142 std::weak_ptr<AsyncStackTrace> m_asyncParent; |
| 141 std::weak_ptr<AsyncStackTrace> m_asyncCreation; | 143 std::weak_ptr<AsyncStackTrace> m_asyncCreation; |
| 142 | 144 |
| 143 DISALLOW_COPY_AND_ASSIGN(AsyncStackTrace); | 145 DISALLOW_COPY_AND_ASSIGN(AsyncStackTrace); |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 } // namespace v8_inspector | 148 } // namespace v8_inspector |
| 147 | 149 |
| 148 #endif // V8_INSPECTOR_V8STACKTRACEIMPL_H_ | 150 #endif // V8_INSPECTOR_V8STACKTRACEIMPL_H_ |
| OLD | NEW |