| 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" |
| 11 | 11 |
| 12 #include <v8-debug.h> | 12 #include <v8-debug.h> |
| 13 #include <v8-profiler.h> | 13 #include <v8-profiler.h> |
| 14 #include <v8-version.h> | 14 #include <v8-version.h> |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 static const v8::StackTrace::StackTraceOptions stackTraceOptions = static_cast<v
8::StackTrace::StackTraceOptions>( | 20 static const v8::StackTrace::StackTraceOptions stackTraceOptions = static_cast<v
8::StackTrace::StackTraceOptions>( |
| 21 v8::StackTrace::kLineNumber | | 21 v8::StackTrace::kLineNumber | |
| 22 v8::StackTrace::kColumnOffset | | 22 v8::StackTrace::kColumnOffset | |
| 23 v8::StackTrace::kScriptId | | 23 v8::StackTrace::kScriptId | |
| 24 v8::StackTrace::kScriptNameOrSourceURL | | 24 v8::StackTrace::kScriptNameOrSourceURL | |
| 25 v8::StackTrace::kFunctionName); | 25 v8::StackTrace::kFunctionName); |
| 26 | 26 |
| 27 V8StackTraceImpl::Frame toFrame(v8::Local<v8::StackFrame> frame) | 27 V8StackTraceImpl::Frame toFrame(v8::Local<v8::StackFrame> frame) |
| 28 { | 28 { |
| 29 String16 scriptId = String16::number(frame->GetScriptId()); | 29 String16 scriptId = String16::fromInteger(frame->GetScriptId()); |
| 30 String16 sourceName; | 30 String16 sourceName; |
| 31 v8::Local<v8::String> sourceNameValue(frame->GetScriptNameOrSourceURL()); | 31 v8::Local<v8::String> sourceNameValue(frame->GetScriptNameOrSourceURL()); |
| 32 if (!sourceNameValue.IsEmpty()) | 32 if (!sourceNameValue.IsEmpty()) |
| 33 sourceName = toProtocolString(sourceNameValue); | 33 sourceName = toProtocolString(sourceNameValue); |
| 34 | 34 |
| 35 String16 functionName; | 35 String16 functionName; |
| 36 v8::Local<v8::String> functionNameValue(frame->GetFunctionName()); | 36 v8::Local<v8::String> functionNameValue(frame->GetFunctionName()); |
| 37 if (!functionNameValue.IsEmpty()) | 37 if (!functionNameValue.IsEmpty()) |
| 38 functionName = toProtocolString(functionNameValue); | 38 functionName = toProtocolString(functionNameValue); |
| 39 | 39 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 stackTrace.append(':'); | 263 stackTrace.append(':'); |
| 264 stackTrace.appendNumber(frame.lineNumber()); | 264 stackTrace.appendNumber(frame.lineNumber()); |
| 265 stackTrace.append(':'); | 265 stackTrace.append(':'); |
| 266 stackTrace.appendNumber(frame.columnNumber()); | 266 stackTrace.appendNumber(frame.columnNumber()); |
| 267 stackTrace.append(')'); | 267 stackTrace.append(')'); |
| 268 } | 268 } |
| 269 return stackTrace.toString(); | 269 return stackTrace.toString(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace blink | 272 } // namespace blink |
| OLD | NEW |