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

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

Issue 1950303004: [DevTools] Add additional accessor check in InjectedScriptSource.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/V8InjectedScriptHost.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
index b15db44c21703288b4e6047b7c00da5fb2eee47f..7978530e290071d006e312a2e71c801ebd71762d 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
@@ -44,7 +44,6 @@ v8::Local<v8::Object> V8InjectedScriptHost::create(v8::Local<v8::Context> contex
v8::Local<v8::Object> injectedScriptHost = v8::Object::New(isolate);
v8::Local<v8::External> debuggerExternal = v8::External::New(isolate, debugger);
setFunctionProperty(context, injectedScriptHost, "internalConstructorName", V8InjectedScriptHost::internalConstructorNameCallback, debuggerExternal);
- setFunctionProperty(context, injectedScriptHost, "formatAccessorsAsProperties", V8InjectedScriptHost::formatAccessorsAsProperties, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "subtype", V8InjectedScriptHost::subtypeCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "collectionEntries", V8InjectedScriptHost::collectionEntriesCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "getInternalProperties", V8InjectedScriptHost::getInternalPropertiesCallback, debuggerExternal);
@@ -55,6 +54,7 @@ v8::Local<v8::Object> V8InjectedScriptHost::create(v8::Local<v8::Context> contex
setFunctionProperty(context, injectedScriptHost, "proxyTargetValue", V8InjectedScriptHost::proxyTargetValueCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "ownPropertyNames", V8InjectedScriptHost::ownPropertyNamesCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "prototype", V8InjectedScriptHost::prototypeCallback, debuggerExternal);
+ setFunctionProperty(context, injectedScriptHost, "hasFunctionSource", V8InjectedScriptHost::hasFunctionSourceCallback, debuggerExternal);
return injectedScriptHost;
}
@@ -67,14 +67,6 @@ void V8InjectedScriptHost::internalConstructorNameCallback(const v8::FunctionCal
info.GetReturnValue().Set(object->GetConstructorName());
}
-void V8InjectedScriptHost::formatAccessorsAsProperties(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- if (info.Length() < 1)
- return;
-
- info.GetReturnValue().Set(unwrapDebugger(info)->client()->formatAccessorsAsProperties(info[0]));
-}
-
void V8InjectedScriptHost::subtypeCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1)
@@ -328,6 +320,23 @@ void V8InjectedScriptHost::prototypeCallback(const v8::FunctionCallbackInfo<v8::
info.GetReturnValue().Set(info[0].As<v8::Object>()->GetPrototype());
}
+void V8InjectedScriptHost::hasFunctionSourceCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ ASSERT(info.Length() > 0 && info[0]->IsFunction());
+ v8::Local<v8::Function> function = info[0].As<v8::Function>();
+ if (function->ScriptId() == v8::UnboundScript::kNoScriptId) {
+ info.GetReturnValue().Set(false);
+ return;
+ }
+ int lineNumber = function->GetScriptLineNumber();
+ int columnNumber = function->GetScriptColumnNumber();
+ if (lineNumber == v8::Function::kLineOffsetNotFound || columnNumber == v8::Function::kLineOffsetNotFound) {
+ info.GetReturnValue().Set(false);
+ return;
+ }
+ info.GetReturnValue().Set(true);
+}
+
v8::Local<v8::Private> V8Debugger::scopeExtensionPrivate(v8::Isolate* isolate)
{
return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8Debugger#scopeExtension"));

Powered by Google App Engine
This is Rietveld 408576698