| 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/V8JavaScriptCallFrame.h" | 5 #include "platform/v8_inspector/V8JavaScriptCallFrame.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/InspectorWrapper.h" | 7 #include "platform/v8_inspector/InspectorWrapper.h" |
| 8 #include "platform/v8_inspector/JavaScriptCallFrame.h" | 8 #include "platform/v8_inspector/JavaScriptCallFrame.h" |
| 9 #include "platform/v8_inspector/V8StringUtil.h" | 9 #include "platform/v8_inspector/V8StringUtil.h" |
| 10 #include "wtf/PassOwnPtr.h" | 10 #include "wtf/PassOwnPtr.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()-
>GetCurrentContext(), info.Holder()); | 86 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()-
>GetCurrentContext(), info.Holder()); |
| 87 info.GetReturnValue().Set(impl->isAtReturn()); | 87 info.GetReturnValue().Set(impl->isAtReturn()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void returnValueAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyC
allbackInfo<v8::Value>& info) | 90 void returnValueAttributeGetterCallback(v8::Local<v8::Name>, const v8::PropertyC
allbackInfo<v8::Value>& info) |
| 91 { | 91 { |
| 92 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()-
>GetCurrentContext(), info.Holder()); | 92 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()-
>GetCurrentContext(), info.Holder()); |
| 93 info.GetReturnValue().Set(impl->returnValue()); | 93 info.GetReturnValue().Set(impl->returnValue()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void evaluateWithExceptionDetailsMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | |
| 97 { | |
| 98 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()-
>GetCurrentContext(), info.Holder()); | |
| 99 info.GetReturnValue().Set(impl->evaluateWithExceptionDetails(info[0], info[1
])); | |
| 100 } | |
| 101 | |
| 102 void scopeTypeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 96 void scopeTypeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 103 { | 97 { |
| 104 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()-
>GetCurrentContext(), info.Holder()); | 98 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()-
>GetCurrentContext(), info.Holder()); |
| 105 v8::Maybe<int32_t> maybeScopeIndex = info[0]->Int32Value(info.GetIsolate()->
GetCurrentContext()); | 99 v8::Maybe<int32_t> maybeScopeIndex = info[0]->Int32Value(info.GetIsolate()->
GetCurrentContext()); |
| 106 if (maybeScopeIndex.IsNothing()) | 100 if (maybeScopeIndex.IsNothing()) |
| 107 return; | 101 return; |
| 108 int scopeIndex = maybeScopeIndex.FromJust(); | 102 int scopeIndex = maybeScopeIndex.FromJust(); |
| 109 info.GetReturnValue().Set(impl->scopeType(scopeIndex)); | 103 info.GetReturnValue().Set(impl->scopeType(scopeIndex)); |
| 110 } | 104 } |
| 111 | 105 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 {"line", lineAttributeGetterCallback}, | 147 {"line", lineAttributeGetterCallback}, |
| 154 {"column", columnAttributeGetterCallback}, | 148 {"column", columnAttributeGetterCallback}, |
| 155 {"stepInPositions", stepInPositionsAttributeGetterCallback}, | 149 {"stepInPositions", stepInPositionsAttributeGetterCallback}, |
| 156 {"functionName", functionNameAttributeGetterCallback}, | 150 {"functionName", functionNameAttributeGetterCallback}, |
| 157 {"functionLine", functionLineAttributeGetterCallback}, | 151 {"functionLine", functionLineAttributeGetterCallback}, |
| 158 {"functionColumn", functionColumnAttributeGetterCallback}, | 152 {"functionColumn", functionColumnAttributeGetterCallback}, |
| 159 {"isAtReturn", isAtReturnAttributeGetterCallback}, | 153 {"isAtReturn", isAtReturnAttributeGetterCallback}, |
| 160 }; | 154 }; |
| 161 | 155 |
| 162 const JavaScriptCallFrameWrapper::V8MethodConfiguration V8JavaScriptCallFrameMet
hods[] = { | 156 const JavaScriptCallFrameWrapper::V8MethodConfiguration V8JavaScriptCallFrameMet
hods[] = { |
| 163 {"evaluateWithExceptionDetails", evaluateWithExceptionDetailsMethodCallback}
, | |
| 164 {"scopeType", scopeTypeMethodCallback}, | 157 {"scopeType", scopeTypeMethodCallback}, |
| 165 {"scopeName", scopeNameMethodCallback}, | 158 {"scopeName", scopeNameMethodCallback}, |
| 166 {"scopeStartLocation", scopeStartLocationMethodCallback}, | 159 {"scopeStartLocation", scopeStartLocationMethodCallback}, |
| 167 {"scopeEndLocation", scopeEndLocationMethodCallback}, | 160 {"scopeEndLocation", scopeEndLocationMethodCallback}, |
| 168 }; | 161 }; |
| 169 | 162 |
| 170 } // namespace | 163 } // namespace |
| 171 | 164 |
| 172 v8::Local<v8::FunctionTemplate> V8JavaScriptCallFrame::createWrapperTemplate(v8:
:Isolate* isolate) | 165 v8::Local<v8::FunctionTemplate> V8JavaScriptCallFrame::createWrapperTemplate(v8:
:Isolate* isolate) |
| 173 { | 166 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 184 frame->setWrapperTemplate(constructorTemplate, context->GetIsolate()); | 177 frame->setWrapperTemplate(constructorTemplate, context->GetIsolate()); |
| 185 return JavaScriptCallFrameWrapper::wrap(constructorTemplate, context, frame)
; | 178 return JavaScriptCallFrameWrapper::wrap(constructorTemplate, context, frame)
; |
| 186 } | 179 } |
| 187 | 180 |
| 188 JavaScriptCallFrame* V8JavaScriptCallFrame::unwrap(v8::Local<v8::Context> contex
t, v8::Local<v8::Object> object) | 181 JavaScriptCallFrame* V8JavaScriptCallFrame::unwrap(v8::Local<v8::Context> contex
t, v8::Local<v8::Object> object) |
| 189 { | 182 { |
| 190 return JavaScriptCallFrameWrapper::unwrap(context, object); | 183 return JavaScriptCallFrameWrapper::unwrap(context, object); |
| 191 } | 184 } |
| 192 | 185 |
| 193 } // namespace blink | 186 } // namespace blink |
| OLD | NEW |