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 #include "src/inspector/v8-stack-trace-impl.h" | 5 #include "src/inspector/v8-stack-trace-impl.h" |
6 | 6 |
7 #include "src/inspector/string-util.h" | 7 #include "src/inspector/string-util.h" |
8 #include "src/inspector/v8-debugger-agent-impl.h" | 8 #include "src/inspector/v8-debugger-agent-impl.h" |
9 #include "src/inspector/v8-debugger.h" | 9 #include "src/inspector/v8-debugger.h" |
10 #include "src/inspector/v8-inspector-impl.h" | 10 #include "src/inspector/v8-inspector-impl.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (isolate->InContext()) { | 173 if (isolate->InContext()) { |
174 stackTrace = v8::StackTrace::CurrentStackTrace( | 174 stackTrace = v8::StackTrace::CurrentStackTrace( |
175 isolate, static_cast<int>(maxStackSize), stackTraceOptions); | 175 isolate, static_cast<int>(maxStackSize), stackTraceOptions); |
176 } | 176 } |
177 return V8StackTraceImpl::create(debugger, contextGroupId, stackTrace, | 177 return V8StackTraceImpl::create(debugger, contextGroupId, stackTrace, |
178 maxStackSize, description); | 178 maxStackSize, description); |
179 } | 179 } |
180 | 180 |
181 std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::cloneImpl() { | 181 std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::cloneImpl() { |
182 std::vector<Frame> framesCopy(m_frames); | 182 std::vector<Frame> framesCopy(m_frames); |
183 return wrapUnique( | 183 return std::unique_ptr<V8StackTraceImpl>( |
184 new V8StackTraceImpl(m_contextGroupId, m_description, framesCopy, | 184 new V8StackTraceImpl(m_contextGroupId, m_description, framesCopy, |
185 m_parent ? m_parent->cloneImpl() : nullptr)); | 185 m_parent ? m_parent->cloneImpl() : nullptr)); |
186 } | 186 } |
187 | 187 |
188 std::unique_ptr<V8StackTrace> V8StackTraceImpl::clone() { | 188 std::unique_ptr<V8StackTrace> V8StackTraceImpl::clone() { |
189 std::vector<Frame> frames; | 189 std::vector<Frame> frames; |
190 for (size_t i = 0; i < m_frames.size(); i++) | 190 for (size_t i = 0; i < m_frames.size(); i++) |
191 frames.push_back(m_frames.at(i).clone()); | 191 frames.push_back(m_frames.at(i).clone()); |
192 return wrapUnique( | 192 return std::unique_ptr<V8StackTraceImpl>( |
193 new V8StackTraceImpl(m_contextGroupId, m_description, frames, nullptr)); | 193 new V8StackTraceImpl(m_contextGroupId, m_description, frames, nullptr)); |
194 } | 194 } |
195 | 195 |
196 V8StackTraceImpl::V8StackTraceImpl(int contextGroupId, | 196 V8StackTraceImpl::V8StackTraceImpl(int contextGroupId, |
197 const String16& description, | 197 const String16& description, |
198 std::vector<Frame>& frames, | 198 std::vector<Frame>& frames, |
199 std::unique_ptr<V8StackTraceImpl> parent) | 199 std::unique_ptr<V8StackTraceImpl> parent) |
200 : m_contextGroupId(contextGroupId), | 200 : m_contextGroupId(contextGroupId), |
201 m_description(description), | 201 m_description(description), |
202 m_parent(std::move(parent)) { | 202 m_parent(std::move(parent)) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 stackTrace.append(String16::fromInteger(frame.lineNumber())); | 276 stackTrace.append(String16::fromInteger(frame.lineNumber())); |
277 stackTrace.append(':'); | 277 stackTrace.append(':'); |
278 stackTrace.append(String16::fromInteger(frame.columnNumber())); | 278 stackTrace.append(String16::fromInteger(frame.columnNumber())); |
279 stackTrace.append(')'); | 279 stackTrace.append(')'); |
280 } | 280 } |
281 String16 string = stackTrace.toString(); | 281 String16 string = stackTrace.toString(); |
282 return StringBufferImpl::adopt(string); | 282 return StringBufferImpl::adopt(string); |
283 } | 283 } |
284 | 284 |
285 } // namespace v8_inspector | 285 } // namespace v8_inspector |
OLD | NEW |