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/V8Debugger.h" |
10 #include "platform/v8_inspector/V8InspectorImpl.h" | 11 #include "platform/v8_inspector/V8InspectorImpl.h" |
11 #include "platform/v8_inspector/V8InternalValueType.h" | 12 #include "platform/v8_inspector/V8InternalValueType.h" |
12 #include "platform/v8_inspector/V8StringUtil.h" | 13 #include "platform/v8_inspector/V8StringUtil.h" |
13 #include "platform/v8_inspector/public/V8InspectorClient.h" | 14 #include "platform/v8_inspector/public/V8InspectorClient.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 void setFunctionProperty(v8::Local<v8::Context> context, v8::Local<v8::Object> o
bj, const char* name, v8::FunctionCallback callback, v8::Local<v8::External> ext
ernal) | 20 void setFunctionProperty(v8::Local<v8::Context> context, v8::Local<v8::Object> o
bj, const char* name, v8::FunctionCallback callback, v8::Local<v8::External> ext
ernal) |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 info.GetReturnValue().Set(toV8String(isolate, subtype)); | 140 info.GetReturnValue().Set(toV8String(isolate, subtype)); |
140 return; | 141 return; |
141 } | 142 } |
142 } | 143 } |
143 | 144 |
144 void V8InjectedScriptHost::getInternalPropertiesCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 145 void V8InjectedScriptHost::getInternalPropertiesCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
145 { | 146 { |
146 if (info.Length() < 1) | 147 if (info.Length() < 1) |
147 return; | 148 return; |
148 v8::Local<v8::Array> properties; | 149 v8::Local<v8::Array> properties; |
149 if (unwrapInspector(info)->internalProperties(info.GetIsolate()->GetCurrentC
ontext(), info[0]).ToLocal(&properties)) | 150 if (unwrapInspector(info)->debugger()->internalProperties(info.GetIsolate()-
>GetCurrentContext(), info[0]).ToLocal(&properties)) |
150 info.GetReturnValue().Set(properties); | 151 info.GetReturnValue().Set(properties); |
151 } | 152 } |
152 | 153 |
153 void V8InjectedScriptHost::objectHasOwnPropertyCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 154 void V8InjectedScriptHost::objectHasOwnPropertyCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
154 { | 155 { |
155 if (info.Length() < 2 || !info[0]->IsObject() || !info[1]->IsString()) | 156 if (info.Length() < 2 || !info[0]->IsObject() || !info[1]->IsString()) |
156 return; | 157 return; |
157 bool result = info[0].As<v8::Object>()->HasOwnProperty(info.GetIsolate()->Ge
tCurrentContext(), v8::Local<v8::String>::Cast(info[1])).FromMaybe(false); | 158 bool result = info[0].As<v8::Object>()->HasOwnProperty(info.GetIsolate()->Ge
tCurrentContext(), v8::Local<v8::String>::Cast(info[1])).FromMaybe(false); |
158 info.GetReturnValue().Set(v8::Boolean::New(info.GetIsolate(), result)); | 159 info.GetReturnValue().Set(v8::Boolean::New(info.GetIsolate(), result)); |
159 } | 160 } |
(...skipping 24 matching lines...) Expand all Loading... |
184 info.GetReturnValue().Set(target); | 185 info.GetReturnValue().Set(target); |
185 } | 186 } |
186 | 187 |
187 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 188 void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
188 { | 189 { |
189 DCHECK(info.Length() > 0 && info[0]->IsObject()); | 190 DCHECK(info.Length() > 0 && info[0]->IsObject()); |
190 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); | 191 info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype()); |
191 } | 192 } |
192 | 193 |
193 } // namespace blink | 194 } // namespace blink |
OLD | NEW |