Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8StackTraceImpl.cpp

Issue 2145483002: [DevTools] make Runtime.CallFrame 0-based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 { 65 {
66 } 66 }
67 67
68 V8StackTraceImpl::Frame::Frame(const String16& functionName, const String16& scr iptId, const String16& scriptName, int lineNumber, int column) 68 V8StackTraceImpl::Frame::Frame(const String16& functionName, const String16& scr iptId, const String16& scriptName, int lineNumber, int column)
69 : m_functionName(functionName) 69 : m_functionName(functionName)
70 , m_scriptId(scriptId) 70 , m_scriptId(scriptId)
71 , m_scriptName(scriptName) 71 , m_scriptName(scriptName)
72 , m_lineNumber(lineNumber) 72 , m_lineNumber(lineNumber)
73 , m_columnNumber(column) 73 , m_columnNumber(column)
74 { 74 {
75 DCHECK(m_lineNumber != v8::Message::kNoLineNumberInfo);
76 DCHECK(m_columnNumber != v8::Message::kNoColumnInfo);
75 } 77 }
76 78
77 V8StackTraceImpl::Frame::~Frame() 79 V8StackTraceImpl::Frame::~Frame()
78 { 80 {
79 } 81 }
80 82
81 // buildInspectorObject() and SourceLocation's toTracedValue() should set the sa me fields. 83 // buildInspectorObject() and SourceLocation's toTracedValue() should set the sa me fields.
82 // If either of them is modified, the other should be also modified. 84 // If either of them is modified, the other should be also modified.
83 std::unique_ptr<protocol::Runtime::CallFrame> V8StackTraceImpl::Frame::buildInsp ectorObject() const 85 std::unique_ptr<protocol::Runtime::CallFrame> V8StackTraceImpl::Frame::buildInsp ectorObject() const
84 { 86 {
85 return protocol::Runtime::CallFrame::create() 87 return protocol::Runtime::CallFrame::create()
86 .setFunctionName(m_functionName) 88 .setFunctionName(m_functionName)
87 .setScriptId(m_scriptId) 89 .setScriptId(m_scriptId)
88 .setUrl(m_scriptName) 90 .setUrl(m_scriptName)
89 .setLineNumber(m_lineNumber) 91 .setLineNumber(m_lineNumber - 1)
90 .setColumnNumber(m_columnNumber) 92 .setColumnNumber(m_columnNumber - 1)
91 .build(); 93 .build();
92 } 94 }
93 95
94 V8StackTraceImpl::Frame V8StackTraceImpl::Frame::isolatedCopy() const 96 V8StackTraceImpl::Frame V8StackTraceImpl::Frame::isolatedCopy() const
95 { 97 {
96 return Frame(m_functionName.isolatedCopy(), m_scriptId.isolatedCopy(), m_scr iptName.isolatedCopy(), m_lineNumber, m_columnNumber); 98 return Frame(m_functionName.isolatedCopy(), m_scriptId.isolatedCopy(), m_scr iptName.isolatedCopy(), m_lineNumber, m_columnNumber);
97 } 99 }
98 100
99 // static 101 // static
100 void V8StackTraceImpl::setCaptureStackTraceForUncaughtExceptions(v8::Isolate* is olate, bool capture) 102 void V8StackTraceImpl::setCaptureStackTraceForUncaughtExceptions(v8::Isolate* is olate, bool capture)
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 stackTrace.append(':'); 263 stackTrace.append(':');
262 stackTrace.appendNumber(frame.lineNumber()); 264 stackTrace.appendNumber(frame.lineNumber());
263 stackTrace.append(':'); 265 stackTrace.append(':');
264 stackTrace.appendNumber(frame.columnNumber()); 266 stackTrace.appendNumber(frame.columnNumber());
265 stackTrace.append(')'); 267 stackTrace.append(')');
266 } 268 }
267 return stackTrace.toString(); 269 return stackTrace.toString();
268 } 270 }
269 271
270 } // namespace blink 272 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698