Chromium Code Reviews| Index: src/inspector/v8-stack-trace-impl.h |
| diff --git a/src/inspector/v8-stack-trace-impl.h b/src/inspector/v8-stack-trace-impl.h |
| index 38722ea2f11324efa71b7bc6b9fe55a3239aced6..f6292f2e4ec4e13606a1d17dcdb773d9875b6b35 100644 |
| --- a/src/inspector/v8-stack-trace-impl.h |
| +++ b/src/inspector/v8-stack-trace-impl.h |
| @@ -20,6 +20,28 @@ class AsyncStackTrace; |
| class V8Debugger; |
| class WasmTranslation; |
| +class StackFrame { |
| + public: |
| + explicit StackFrame(v8::Local<v8::StackFrame> frame); |
| + ~StackFrame() = default; |
| + |
| + void translate(WasmTranslation* wasmTranslation); |
| + |
| + const String16& functionName() const; |
| + const String16& scriptId() const; |
| + const String16& sourceURL() const; |
| + int lineNumber() const; // 0-based. |
| + int columnNumber() const; // 0-based. |
| + std::unique_ptr<protocol::Runtime::CallFrame> buildInspectorObject() const; |
| + |
| + private: |
| + String16 m_functionName; |
| + String16 m_scriptId; |
| + String16 m_sourceURL; |
| + int m_lineNumber; // 0-based. |
| + int m_columnNumber; // 0-based. |
| +}; |
| + |
| class V8StackTraceImpl : public V8StackTrace { |
| public: |
| static void setCaptureStackTraceForUncaughtExceptions(v8::Isolate*, |
| @@ -50,34 +72,13 @@ class V8StackTraceImpl : public V8StackTrace { |
| const override; |
| std::unique_ptr<StringBuffer> toString() const override; |
| - class Frame { |
| - public: |
| - explicit Frame(v8::Local<v8::StackFrame> frame); |
| - ~Frame() = default; |
| - |
| - void translate(WasmTranslation* wasmTranslation); |
| - |
| - const String16& functionName() const; |
| - const String16& scriptId() const; |
| - const String16& sourceURL() const; |
| - int lineNumber() const; // 0-based. |
| - int columnNumber() const; // 0-based. |
| - std::unique_ptr<protocol::Runtime::CallFrame> buildInspectorObject() const; |
| - |
| - private: |
| - String16 m_functionName; |
| - String16 m_scriptId; |
| - String16 m_sourceURL; |
| - int m_lineNumber; // 0-based. |
| - int m_columnNumber; // 0-based. |
| - }; |
| - |
| private: |
| - V8StackTraceImpl(const std::vector<Frame> frames, int maxAsyncDepth, |
| + V8StackTraceImpl(const std::vector<std::shared_ptr<StackFrame>>& frames, |
|
dgozman
2017/04/19 20:29:04
I remember that passing vector by value here and u
kozy
2017/04/20 00:06:49
Done, but I think we should pass vector by referen
|
| + int maxAsyncDepth, |
| std::shared_ptr<AsyncStackTrace> asyncParent, |
| std::shared_ptr<AsyncStackTrace> asyncCreation); |
| - std::vector<Frame> m_frames; |
| + std::vector<std::shared_ptr<StackFrame>> m_frames; |
| int m_maxAsyncDepth; |
| std::weak_ptr<AsyncStackTrace> m_asyncParent; |
| std::weak_ptr<AsyncStackTrace> m_asyncCreation; |
| @@ -102,14 +103,14 @@ class AsyncStackTrace { |
| private: |
| AsyncStackTrace(int contextGroupId, const String16& description, |
| - const std::vector<V8StackTraceImpl::Frame>& frames, |
| + const std::vector<std::shared_ptr<StackFrame>>& frames, |
|
dgozman
2017/04/19 20:29:05
ditto
kozy
2017/04/20 00:06:49
Done.
|
| std::shared_ptr<AsyncStackTrace> asyncParent, |
| std::shared_ptr<AsyncStackTrace> asyncCreation); |
| int m_contextGroupId; |
| String16 m_description; |
| - std::vector<V8StackTraceImpl::Frame> m_frames; |
| + std::vector<std::shared_ptr<StackFrame>> m_frames; |
| std::weak_ptr<AsyncStackTrace> m_asyncParent; |
| std::weak_ptr<AsyncStackTrace> m_asyncCreation; |