OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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 "platform/v8_inspector/V8StackTraceImpl.h" | 5 #include "platform/v8_inspector/V8StackTraceImpl.h" |
6 | 6 |
7 #include "platform/v8_inspector/V8Debugger.h" | 7 #include "platform/v8_inspector/V8Debugger.h" |
8 #include "platform/v8_inspector/V8StringUtil.h" | 8 #include "platform/v8_inspector/V8StringUtil.h" |
9 | 9 |
10 #include <v8-debug.h> | 10 #include <v8-debug.h> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 .setFunctionName(m_functionName) | 86 .setFunctionName(m_functionName) |
87 .setScriptId(m_scriptId) | 87 .setScriptId(m_scriptId) |
88 .setUrl(m_scriptName) | 88 .setUrl(m_scriptName) |
89 .setLineNumber(m_lineNumber - 1) | 89 .setLineNumber(m_lineNumber - 1) |
90 .setColumnNumber(m_columnNumber - 1) | 90 .setColumnNumber(m_columnNumber - 1) |
91 .build(); | 91 .build(); |
92 } | 92 } |
93 | 93 |
94 V8StackTraceImpl::Frame V8StackTraceImpl::Frame::clone() const | 94 V8StackTraceImpl::Frame V8StackTraceImpl::Frame::clone() const |
95 { | 95 { |
96 return Frame(m_functionName.isolatedCopy(), m_scriptId.isolatedCopy(), m_scr
iptName.isolatedCopy(), m_lineNumber, m_columnNumber); | 96 return Frame(m_functionName, m_scriptId, m_scriptName, m_lineNumber, m_colum
nNumber); |
97 } | 97 } |
98 | 98 |
99 // static | 99 // static |
100 void V8StackTraceImpl::setCaptureStackTraceForUncaughtExceptions(v8::Isolate* is
olate, bool capture) | 100 void V8StackTraceImpl::setCaptureStackTraceForUncaughtExceptions(v8::Isolate* is
olate, bool capture) |
101 { | 101 { |
102 isolate->SetCaptureStackTraceForUncaughtExceptions(capture, V8StackTraceImpl
::maxCallStackSizeToCapture, stackTraceOptions); | 102 isolate->SetCaptureStackTraceForUncaughtExceptions(capture, V8StackTraceImpl
::maxCallStackSizeToCapture, stackTraceOptions); |
103 } | 103 } |
104 | 104 |
105 // static | 105 // static |
106 std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create(V8Debugger* debugger,
int contextGroupId, v8::Local<v8::StackTrace> stackTrace, size_t maxStackSize,
const String16& description) | 106 std::unique_ptr<V8StackTraceImpl> V8StackTraceImpl::create(V8Debugger* debugger,
int contextGroupId, v8::Local<v8::StackTrace> stackTrace, size_t maxStackSize,
const String16& description) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 { | 163 { |
164 std::vector<Frame> framesCopy(m_frames); | 164 std::vector<Frame> framesCopy(m_frames); |
165 return wrapUnique(new V8StackTraceImpl(m_contextGroupId, m_description, fram
esCopy, m_parent ? m_parent->cloneImpl() : nullptr)); | 165 return wrapUnique(new V8StackTraceImpl(m_contextGroupId, m_description, fram
esCopy, m_parent ? m_parent->cloneImpl() : nullptr)); |
166 } | 166 } |
167 | 167 |
168 std::unique_ptr<V8StackTrace> V8StackTraceImpl::clone() | 168 std::unique_ptr<V8StackTrace> V8StackTraceImpl::clone() |
169 { | 169 { |
170 std::vector<Frame> frames; | 170 std::vector<Frame> frames; |
171 for (size_t i = 0; i < m_frames.size(); i++) | 171 for (size_t i = 0; i < m_frames.size(); i++) |
172 frames.push_back(m_frames.at(i).clone()); | 172 frames.push_back(m_frames.at(i).clone()); |
173 return wrapUnique(new V8StackTraceImpl(m_contextGroupId, m_description.isola
tedCopy(), frames, nullptr)); | 173 return wrapUnique(new V8StackTraceImpl(m_contextGroupId, m_description, fram
es, nullptr)); |
174 } | 174 } |
175 | 175 |
176 V8StackTraceImpl::V8StackTraceImpl(int contextGroupId, const String16& descripti
on, std::vector<Frame>& frames, std::unique_ptr<V8StackTraceImpl> parent) | 176 V8StackTraceImpl::V8StackTraceImpl(int contextGroupId, const String16& descripti
on, std::vector<Frame>& frames, std::unique_ptr<V8StackTraceImpl> parent) |
177 : m_contextGroupId(contextGroupId) | 177 : m_contextGroupId(contextGroupId) |
178 , m_description(description) | 178 , m_description(description) |
179 , m_parent(std::move(parent)) | 179 , m_parent(std::move(parent)) |
180 { | 180 { |
181 m_frames.swap(frames); | 181 m_frames.swap(frames); |
182 } | 182 } |
183 | 183 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 stackTrace.append(':'); | 256 stackTrace.append(':'); |
257 stackTrace.append(String16::fromInteger(frame.lineNumber())); | 257 stackTrace.append(String16::fromInteger(frame.lineNumber())); |
258 stackTrace.append(':'); | 258 stackTrace.append(':'); |
259 stackTrace.append(String16::fromInteger(frame.columnNumber())); | 259 stackTrace.append(String16::fromInteger(frame.columnNumber())); |
260 stackTrace.append(')'); | 260 stackTrace.append(')'); |
261 } | 261 } |
262 return stackTrace.toString(); | 262 return stackTrace.toString(); |
263 } | 263 } |
264 | 264 |
265 } // namespace v8_inspector | 265 } // namespace v8_inspector |
OLD | NEW |