Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8JavaScriptCallFrame.cpp

Issue 1653053002: Devtools: parse variables scopes and sourcemap them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/v8_inspector/V8JavaScriptCallFrame.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8JavaScriptCallFrame.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8JavaScriptCallFrame.cpp
index 6d831c8dd2ea8e0d28cac6504b377fc6e19f11b2..5d1be8e1a04818c4ee7f8cdf9cdff788182fe71a 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8JavaScriptCallFrame.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8JavaScriptCallFrame.cpp
@@ -143,6 +143,26 @@ void scopeNameMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
info.GetReturnValue().Set(impl->scopeName(scopeIndex));
}
+void scopeStartLocationMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()->GetCurrentContext(), info.Holder());
+ v8::Maybe<int32_t> maybeScopeIndex = info[0]->Int32Value(info.GetIsolate()->GetCurrentContext());
+ if (maybeScopeIndex.IsNothing())
+ return;
+ int scopeIndex = maybeScopeIndex.FromJust();
+ info.GetReturnValue().Set(impl->scopeStartLocation(scopeIndex));
+}
+
+void scopeEndLocationMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ JavaScriptCallFrame* impl = V8JavaScriptCallFrame::unwrap(info.GetIsolate()->GetCurrentContext(), info.Holder());
+ v8::Maybe<int32_t> maybeScopeIndex = info[0]->Int32Value(info.GetIsolate()->GetCurrentContext());
+ if (maybeScopeIndex.IsNothing())
+ return;
+ int scopeIndex = maybeScopeIndex.FromJust();
+ info.GetReturnValue().Set(impl->scopeEndLocation(scopeIndex));
+}
+
char hiddenPropertyName[] = "v8inspector::JavaScriptCallFrame";
char className[] = "V8JavaScriptCallFrame";
using JavaScriptCallFrameWrapper = InspectorWrapper<JavaScriptCallFrame, hiddenPropertyName, className>;
@@ -168,7 +188,9 @@ const JavaScriptCallFrameWrapper::V8MethodConfiguration V8JavaScriptCallFrameMet
{"restart", restartMethodCallback},
{"setVariableValue", setVariableValueMethodCallback},
{"scopeType", scopeTypeMethodCallback},
- {"scopeName", scopeNameMethodCallback}
+ {"scopeName", scopeNameMethodCallback},
+ {"scopeStartLocation", scopeStartLocationMethodCallback},
+ {"scopeEndLocation", scopeEndLocationMethodCallback},
};
} // namespace

Powered by Google App Engine
This is Rietveld 408576698