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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/JavaScriptCallFrame.cpp

Issue 1826623002: [DevTools] Move wrapCallFrames from InjectedScriptSource.js to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-no-scopes
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(callFrame->Get( toV8StringInternalized(m_isolate, name))); 165 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(callFrame->Get( toV8StringInternalized(m_isolate, name)));
166 v8::Local<v8::Array> locations = v8::Local<v8::Array>::Cast(func->Call(m_iso late->GetCurrentContext(), callFrame, 0, nullptr).ToLocalChecked()); 166 v8::Local<v8::Array> locations = v8::Local<v8::Array>::Cast(func->Call(m_iso late->GetCurrentContext(), callFrame, 0, nullptr).ToLocalChecked());
167 return locations->Get(scopeIndex); 167 return locations->Get(scopeIndex);
168 } 168 }
169 169
170 v8::Local<v8::Value> JavaScriptCallFrame::thisObject() const 170 v8::Local<v8::Value> JavaScriptCallFrame::thisObject() const
171 { 171 {
172 return v8::Local<v8::Object>::New(m_isolate, m_callFrame)->Get(toV8StringInt ernalized(m_isolate, "thisObject")); 172 return v8::Local<v8::Object>::New(m_isolate, m_callFrame)->Get(toV8StringInt ernalized(m_isolate, "thisObject"));
173 } 173 }
174 174
175 String16 JavaScriptCallFrame::stepInPositions() const
176 {
177 return callV8FunctionReturnString("stepInPositions");
178 }
179
180 bool JavaScriptCallFrame::isAtReturn() const 175 bool JavaScriptCallFrame::isAtReturn() const
181 { 176 {
182 v8::HandleScope handleScope(m_isolate); 177 v8::HandleScope handleScope(m_isolate);
183 v8::Local<v8::Value> result = v8::Local<v8::Object>::New(m_isolate, m_callFr ame)->Get(toV8StringInternalized(m_isolate, "isAtReturn")); 178 v8::Local<v8::Value> result = v8::Local<v8::Object>::New(m_isolate, m_callFr ame)->Get(toV8StringInternalized(m_isolate, "isAtReturn"));
184 if (result.IsEmpty() || !result->IsBoolean()) 179 if (result.IsEmpty() || !result->IsBoolean())
185 return false; 180 return false;
186 return result->BooleanValue(); 181 return result->BooleanValue();
187 } 182 }
188 183
189 v8::Local<v8::Value> JavaScriptCallFrame::returnValue() const 184 v8::Local<v8::Value> JavaScriptCallFrame::returnValue() const
(...skipping 27 matching lines...) Expand all
217 v8::Local<v8::Function> setVariableValueFunction = v8::Local<v8::Function>:: Cast(callFrame->Get(toV8StringInternalized(m_isolate, "setVariableValue"))); 212 v8::Local<v8::Function> setVariableValueFunction = v8::Local<v8::Function>:: Cast(callFrame->Get(toV8StringInternalized(m_isolate, "setVariableValue")));
218 v8::Local<v8::Value> argv[] = { 213 v8::Local<v8::Value> argv[] = {
219 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), 214 v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)),
220 variableName, 215 variableName,
221 newValue 216 newValue
222 }; 217 };
223 return setVariableValueFunction->Call(m_isolate->GetCurrentContext(), callFr ame, WTF_ARRAY_LENGTH(argv), argv); 218 return setVariableValueFunction->Call(m_isolate->GetCurrentContext(), callFr ame, WTF_ARRAY_LENGTH(argv), argv);
224 } 219 }
225 220
226 } // namespace blink 221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698