| 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-console.h" | 5 #include "src/inspector/v8-console.h" |
| 6 | 6 |
| 7 #include "src/base/macros.h" | 7 #include "src/base/macros.h" |
| 8 #include "src/inspector/injected-script.h" | 8 #include "src/inspector/injected-script.h" |
| 9 #include "src/inspector/inspected-context.h" | 9 #include "src/inspector/inspected-context.h" |
| 10 #include "src/inspector/string-util.h" | 10 #include "src/inspector/string-util.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 helper.reportCallWithDefaultArgument(ConsoleAPIType::kClear, | 254 helper.reportCallWithDefaultArgument(ConsoleAPIType::kClear, |
| 255 String16("console.clear")); | 255 String16("console.clear")); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { | 258 void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 259 ConsoleHelper helper(info); | 259 ConsoleHelper helper(info); |
| 260 String16 title = helper.firstArgToString(String16()); | 260 String16 title = helper.firstArgToString(String16()); |
| 261 String16 identifier; | 261 String16 identifier; |
| 262 if (title.isEmpty()) { | 262 if (title.isEmpty()) { |
| 263 std::unique_ptr<V8StackTraceImpl> stackTrace = | 263 std::unique_ptr<V8StackTraceImpl> stackTrace = |
| 264 V8StackTraceImpl::capture(nullptr, 0, 1); | 264 V8StackTraceImpl::capture(helper.inspector()->debugger(), 0, 1); |
| 265 if (stackTrace && !stackTrace->isEmpty()) { | 265 if (stackTrace && !stackTrace->isEmpty()) { |
| 266 identifier = toString16(stackTrace->topSourceURL()) + ":" + | 266 identifier = toString16(stackTrace->topSourceURL()) + ":" + |
| 267 String16::fromInteger(stackTrace->topLineNumber()); | 267 String16::fromInteger(stackTrace->topLineNumber()); |
| 268 } | 268 } |
| 269 } else { | 269 } else { |
| 270 identifier = title + "@"; | 270 identifier = title + "@"; |
| 271 } | 271 } |
| 272 | 272 |
| 273 int count = | 273 int count = |
| 274 helper.consoleMessageStorage()->count(helper.contextId(), identifier); | 274 helper.consoleMessageStorage()->count(helper.contextId(), identifier); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 ->GetOwnPropertyDescriptor( | 813 ->GetOwnPropertyDescriptor( |
| 814 m_context, v8::Local<v8::String>::Cast(name)) | 814 m_context, v8::Local<v8::String>::Cast(name)) |
| 815 .ToLocal(&descriptor); | 815 .ToLocal(&descriptor); |
| 816 DCHECK(success); | 816 DCHECK(success); |
| 817 USE(success); | 817 USE(success); |
| 818 } | 818 } |
| 819 } | 819 } |
| 820 } | 820 } |
| 821 | 821 |
| 822 } // namespace v8_inspector | 822 } // namespace v8_inspector |
| OLD | NEW |