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

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

Issue 1622213002: DevTools: make InjectedScript heap-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed protocol tests. 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 799fd5e4cb06e36c4fa117a1561bbfdccdd70089..72568080acb8537096e3e130343ec3b1a2d55af9 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -347,27 +347,27 @@ void InspectorDOMDebuggerAgent::getEventListeners(ErrorString* errorString, cons
*errorString = "Invalid object id";
return;
}
- InjectedScript injectedScript = m_injectedScriptManager->findInjectedScript(remoteId.get());
- if (injectedScript.isEmpty()) {
+ InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript(remoteId.get());
+ if (!injectedScript) {
*errorString = "Inspected frame has gone";
return;
}
- ScriptState* state = injectedScript.scriptState();
+ ScriptState* state = injectedScript->scriptState();
ScriptState::Scope scope(state);
- v8::Local<v8::Value> value = injectedScript.findObject(*remoteId);
+ v8::Local<v8::Value> value = injectedScript->findObject(*remoteId);
if (value.IsEmpty()) {
*errorString = "No object with passed objectId";
return;
}
- String objectGroup = injectedScript.objectIdToObjectGroupName(objectId);
+ String objectGroup = injectedScript->objectIdToObjectGroupName(objectId);
listenersArray = TypeBuilder::Array<TypeBuilder::DOMDebugger::EventListener>::create();
eventListeners(injectedScript, value, objectGroup, listenersArray);
}
-void InspectorDOMDebuggerAgent::eventListeners(InjectedScript& injectedScript, v8::Local<v8::Value> object, const String& objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::DOMDebugger::EventListener>>& listenersArray)
+void InspectorDOMDebuggerAgent::eventListeners(InjectedScript* injectedScript, v8::Local<v8::Value> object, const String& objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::DOMDebugger::EventListener>>& listenersArray)
{
- ScriptState* state = injectedScript.scriptState();
+ ScriptState* state = injectedScript->scriptState();
EventListenerInfoMap eventInformation;
InspectorDOMDebuggerAgent::eventListenersInfoForTarget(state->isolate(), object, eventInformation);
for (const auto& it : eventInformation) {
@@ -388,12 +388,12 @@ void InspectorDOMDebuggerAgent::eventListeners(InjectedScript& injectedScript, v
}
}
-PassRefPtr<TypeBuilder::DOMDebugger::EventListener> InspectorDOMDebuggerAgent::buildObjectForEventListener(InjectedScript& injectedScript, const EventListenerInfo& info, const String& objectGroupId)
+PassRefPtr<TypeBuilder::DOMDebugger::EventListener> InspectorDOMDebuggerAgent::buildObjectForEventListener(InjectedScript* injectedScript, const EventListenerInfo& info, const String& objectGroupId)
{
if (info.handler.IsEmpty())
return nullptr;
- ScriptState* scriptState = injectedScript.scriptState();
+ ScriptState* scriptState = injectedScript->scriptState();
v8::Isolate* isolate = scriptState->isolate();
v8::Local<v8::Function> function = eventListenerEffectiveFunction(isolate, info.handler);
if (function.IsEmpty())
@@ -413,8 +413,8 @@ PassRefPtr<TypeBuilder::DOMDebugger::EventListener> InspectorDOMDebuggerAgent::b
.setUseCapture(info.useCapture)
.setLocation(location);
if (!objectGroupId.isEmpty()) {
- value->setHandler(injectedScript.wrapObject(ScriptValue(scriptState, function), objectGroupId));
- value->setOriginalHandler(injectedScript.wrapObject(ScriptValue(scriptState, info.handler), objectGroupId));
+ value->setHandler(injectedScript->wrapObject(ScriptValue(scriptState, function), objectGroupId));
+ value->setOriginalHandler(injectedScript->wrapObject(ScriptValue(scriptState, info.handler), objectGroupId));
}
return value.release();
}

Powered by Google App Engine
This is Rietveld 408576698