| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/V8InjectedScriptHost.h" | 5 #include "platform/v8_inspector/V8InjectedScriptHost.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/v8_inspector/InjectedScriptNative.h" | 8 #include "platform/v8_inspector/InjectedScriptNative.h" |
| 9 #include "platform/v8_inspector/V8Compat.h" | 9 #include "platform/v8_inspector/V8Compat.h" |
| 10 #include "platform/v8_inspector/V8DebuggerImpl.h" | 10 #include "platform/v8_inspector/V8DebuggerImpl.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 { | 60 { |
| 61 if (info.Length() < 1 || !info[0]->IsObject()) | 61 if (info.Length() < 1 || !info[0]->IsObject()) |
| 62 return; | 62 return; |
| 63 | 63 |
| 64 v8::Local<v8::Object> object = info[0].As<v8::Object>(); | 64 v8::Local<v8::Object> object = info[0].As<v8::Object>(); |
| 65 info.GetReturnValue().Set(object->GetConstructorName()); | 65 info.GetReturnValue().Set(object->GetConstructorName()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void V8InjectedScriptHost::formatAccessorsAsProperties(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 68 void V8InjectedScriptHost::formatAccessorsAsProperties(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
| 69 { | 69 { |
| 70 if (info.Length() < 1) | 70 DCHECK_EQ(info.Length(), 2); |
| 71 info.GetReturnValue().Set(false); |
| 72 if (!info[1]->IsFunction()) |
| 71 return; | 73 return; |
| 72 | 74 // Check that function is user-defined. |
| 75 if (info[1].As<v8::Function>()->ScriptId() != v8::UnboundScript::kNoScriptId
) |
| 76 return; |
| 73 info.GetReturnValue().Set(unwrapDebugger(info)->client()->formatAccessorsAsP
roperties(info[0])); | 77 info.GetReturnValue().Set(unwrapDebugger(info)->client()->formatAccessorsAsP
roperties(info[0])); |
| 74 } | 78 } |
| 75 | 79 |
| 76 void V8InjectedScriptHost::isTypedArrayCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 80 void V8InjectedScriptHost::isTypedArrayCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 77 { | 81 { |
| 78 if (info.Length() < 1) | 82 if (info.Length() < 1) |
| 79 return; | 83 return; |
| 80 | 84 |
| 81 info.GetReturnValue().Set(info[0]->IsTypedArray()); | 85 info.GetReturnValue().Set(info[0]->IsTypedArray()); |
| 82 } | 86 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 DCHECK(info.Length() > 0 && info[0]->IsObject()); | 236 DCHECK(info.Length() > 0 && info[0]->IsObject()); |
| 233 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); | 237 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); |
| 234 } | 238 } |
| 235 | 239 |
| 236 v8::Local<v8::Private> V8Debugger::scopeExtensionPrivate(v8::Isolate* isolate) | 240 v8::Local<v8::Private> V8Debugger::scopeExtensionPrivate(v8::Isolate* isolate) |
| 237 { | 241 { |
| 238 return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8Debug
ger#scopeExtension")); | 242 return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8Debug
ger#scopeExtension")); |
| 239 } | 243 } |
| 240 | 244 |
| 241 } // namespace blink | 245 } // namespace blink |
| OLD | NEW |