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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp

Issue 1648463002: DevTools: migrate injectedscript from ScriptValue to v8::Global. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/core/inspector/InspectorDOMDebuggerAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
index 2743613ba37c1ec00ed3c704c6e2ece0105c8c67..7826bcb79edb680394d28782c386eded9d6cf371 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -367,7 +367,12 @@ void InspectorDOMDebuggerAgent::getEventListeners(ErrorString* errorString, cons
*errorString = "Inspected frame has gone";
return;
}
- ScriptState* state = injectedScript->scriptState();
+ v8::HandleScope handles(injectedScript->isolate());
+ ScriptState* state = ScriptState::from(injectedScript->context());
+ if (!state) {
+ *errorString = "Inspected frame has gone";
+ return;
+ }
ScriptState::Scope scope(state);
v8::Local<v8::Value> value = injectedScript->findObject(*remoteId);
if (value.IsEmpty()) {
@@ -382,9 +387,8 @@ void InspectorDOMDebuggerAgent::getEventListeners(ErrorString* errorString, cons
void InspectorDOMDebuggerAgent::eventListeners(InjectedScript* injectedScript, v8::Local<v8::Value> object, const String& objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::DOMDebugger::EventListener>>& listenersArray)
{
- ScriptState* state = injectedScript->scriptState();
EventListenerInfoMap eventInformation;
- InspectorDOMDebuggerAgent::eventListenersInfoForTarget(state->isolate(), object, eventInformation);
+ InspectorDOMDebuggerAgent::eventListenersInfoForTarget(injectedScript->isolate(), object, eventInformation);
for (const auto& it : eventInformation) {
for (const auto& it2 : *it.value) {
if (!it2.useCapture)
@@ -408,8 +412,7 @@ PassRefPtr<TypeBuilder::DOMDebugger::EventListener> InspectorDOMDebuggerAgent::b
if (info.handler.IsEmpty())
return nullptr;
- ScriptState* scriptState = injectedScript->scriptState();
- v8::Isolate* isolate = scriptState->isolate();
+ v8::Isolate* isolate = injectedScript->isolate();
v8::Local<v8::Function> function = eventListenerEffectiveFunction(isolate, info.handler);
if (function.IsEmpty())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698