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 "core/inspector/ThreadDebugger.h" | 5 #include "core/inspector/ThreadDebugger.h" |
6 | 6 |
7 #include "bindings/core/v8/V8Binding.h" | 7 #include "bindings/core/v8/V8Binding.h" |
| 8 #include "bindings/core/v8/V8DOMException.h" |
| 9 #include "bindings/core/v8/V8DOMTokenList.h" |
| 10 #include "bindings/core/v8/V8HTMLAllCollection.h" |
| 11 #include "bindings/core/v8/V8HTMLCollection.h" |
| 12 #include "bindings/core/v8/V8Node.h" |
| 13 #include "bindings/core/v8/V8NodeList.h" |
8 #include "bindings/core/v8/V8ScriptRunner.h" | 14 #include "bindings/core/v8/V8ScriptRunner.h" |
9 #include "core/inspector/InspectorDOMDebuggerAgent.h" | 15 #include "core/inspector/InspectorDOMDebuggerAgent.h" |
10 | 16 |
11 namespace blink { | 17 namespace blink { |
12 | 18 |
13 ThreadDebugger::ThreadDebugger(v8::Isolate* isolate) | 19 ThreadDebugger::ThreadDebugger(v8::Isolate* isolate) |
14 : m_isolate(isolate) | 20 : m_isolate(isolate) |
15 , m_debugger(V8Debugger::create(isolate, this)) | 21 , m_debugger(V8Debugger::create(isolate, this)) |
16 { | 22 { |
17 } | 23 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 v8::MaybeLocal<v8::Value> ThreadDebugger::callFunction(v8::Local<v8::Function> f
unction, v8::Local<v8::Context> context, v8::Local<v8::Value> receiver, int argc
, v8::Local<v8::Value> info[]) | 55 v8::MaybeLocal<v8::Value> ThreadDebugger::callFunction(v8::Local<v8::Function> f
unction, v8::Local<v8::Context> context, v8::Local<v8::Value> receiver, int argc
, v8::Local<v8::Value> info[]) |
50 { | 56 { |
51 return V8ScriptRunner::callFunction(function, toExecutionContext(context), r
eceiver, argc, info, m_isolate); | 57 return V8ScriptRunner::callFunction(function, toExecutionContext(context), r
eceiver, argc, info, m_isolate); |
52 } | 58 } |
53 | 59 |
54 v8::MaybeLocal<v8::Value> ThreadDebugger::callInternalFunction(v8::Local<v8::Fun
ction> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> i
nfo[]) | 60 v8::MaybeLocal<v8::Value> ThreadDebugger::callInternalFunction(v8::Local<v8::Fun
ction> function, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> i
nfo[]) |
55 { | 61 { |
56 return V8ScriptRunner::callInternalFunction(function, receiver, argc, info,
m_isolate); | 62 return V8ScriptRunner::callInternalFunction(function, receiver, argc, info,
m_isolate); |
57 } | 63 } |
58 | 64 |
| 65 String ThreadDebugger::valueSubtype(v8::Local<v8::Value> value) |
| 66 { |
| 67 if (V8Node::hasInstance(value, m_isolate)) |
| 68 return "node"; |
| 69 if (V8NodeList::hasInstance(value, m_isolate) |
| 70 || V8DOMTokenList::hasInstance(value, m_isolate) |
| 71 || V8HTMLCollection::hasInstance(value, m_isolate) |
| 72 || V8HTMLAllCollection::hasInstance(value, m_isolate)) { |
| 73 return "array"; |
| 74 } |
| 75 if (V8DOMException::hasInstance(value, m_isolate)) |
| 76 return "error"; |
| 77 return String(); |
| 78 } |
| 79 |
| 80 bool ThreadDebugger::formatAccessorsAsProperties(v8::Local<v8::Value> value) |
| 81 { |
| 82 return V8DOMWrapper::isWrapper(m_isolate, value); |
| 83 } |
| 84 |
59 } // namespace blink | 85 } // namespace blink |
OLD | NEW |