Chromium Code Reviews| 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/inspector_protocol/Platform.h" | 7 #include "platform/inspector_protocol/Platform.h" |
| 8 #include "platform/inspector_protocol/String16.h" | 8 #include "platform/inspector_protocol/String16.h" |
| 9 #include "platform/v8_inspector/V8DebuggerImpl.h" | 9 #include "platform/v8_inspector/V8DebuggerImpl.h" |
| 10 #include "platform/v8_inspector/V8StringUtil.h" | 10 #include "platform/v8_inspector/V8StringUtil.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 } | 79 } |
| 80 | 80 |
| 81 // buildInspectorObject() and SourceLocation's toTracedValue() should set the sa me fields. | 81 // buildInspectorObject() and SourceLocation's toTracedValue() should set the sa me fields. |
| 82 // If either of them is modified, the other should be also modified. | 82 // If either of them is modified, the other should be also modified. |
| 83 std::unique_ptr<protocol::Runtime::CallFrame> V8StackTraceImpl::Frame::buildInsp ectorObject() const | 83 std::unique_ptr<protocol::Runtime::CallFrame> V8StackTraceImpl::Frame::buildInsp ectorObject() const |
| 84 { | 84 { |
| 85 return protocol::Runtime::CallFrame::create() | 85 return protocol::Runtime::CallFrame::create() |
| 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) | 89 .setLineNumber(m_lineNumber - 1) |
|
dgozman
2016/07/12 18:34:00
Not sure whether m_lineNumber can be zero. Could y
kozy
2016/07/12 19:14:57
It's 1-based but it could be omitted when we don't
| |
| 90 .setColumnNumber(m_columnNumber) | 90 .setColumnNumber(m_columnNumber - 1) |
| 91 .build(); | 91 .build(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 V8StackTraceImpl::Frame V8StackTraceImpl::Frame::isolatedCopy() const | 94 V8StackTraceImpl::Frame V8StackTraceImpl::Frame::isolatedCopy() 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.isolatedCopy(), m_scriptId.isolatedCopy(), m_scr iptName.isolatedCopy(), m_lineNumber, m_columnNumber); |
| 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) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 stackTrace.append(':'); | 261 stackTrace.append(':'); |
| 262 stackTrace.appendNumber(frame.lineNumber()); | 262 stackTrace.appendNumber(frame.lineNumber()); |
| 263 stackTrace.append(':'); | 263 stackTrace.append(':'); |
| 264 stackTrace.appendNumber(frame.columnNumber()); | 264 stackTrace.appendNumber(frame.columnNumber()); |
| 265 stackTrace.append(')'); | 265 stackTrace.append(')'); |
| 266 } | 266 } |
| 267 return stackTrace.toString(); | 267 return stackTrace.toString(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace blink | 270 } // namespace blink |
| OLD | NEW |