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

Unified Diff: third_party/WebKit/Source/core/inspector/v8/V8RuntimeAgentImpl.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
« no previous file with comments | « third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/inspector/v8/V8RuntimeAgentImpl.cpp
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/core/inspector/v8/V8RuntimeAgentImpl.cpp
index 00eac3118350154ea1e2049eb2ec05eb92006107..fbccefcce7f765481d537dc77e7826adfbf7bcc1 100644
--- a/third_party/WebKit/Source/core/inspector/v8/V8RuntimeAgentImpl.cpp
+++ b/third_party/WebKit/Source/core/inspector/v8/V8RuntimeAgentImpl.cpp
@@ -73,15 +73,15 @@ void V8RuntimeAgentImpl::evaluate(ErrorString* errorString, const String& expres
*errorString = "Cannot find default execution context";
return;
}
- InjectedScript injectedScript = m_injectedScriptManager->findInjectedScript(*executionContextId);
- if (injectedScript.isEmpty()) {
+ InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript(*executionContextId);
+ if (!injectedScript) {
*errorString = "Cannot find execution context with given id";
return;
}
Optional<IgnoreExceptionsScope> ignoreExceptionsScope;
if (asBool(doNotPauseOnExceptionsAndMuteConsole))
ignoreExceptionsScope.emplace(m_debugger);
- injectedScript.evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), asBool(generatePreview), &result, wasThrown, &exceptionDetails);
+ injectedScript->evaluate(errorString, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), asBool(generatePreview), &result, wasThrown, &exceptionDetails);
}
void V8RuntimeAgentImpl::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<JSONArray>* const optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown)
@@ -91,8 +91,8 @@ void V8RuntimeAgentImpl::callFunctionOn(ErrorString* errorString, const String&
*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;
}
@@ -103,7 +103,7 @@ void V8RuntimeAgentImpl::callFunctionOn(ErrorString* errorString, const String&
Optional<IgnoreExceptionsScope> ignoreExceptionsScope;
if (asBool(doNotPauseOnExceptionsAndMuteConsole))
ignoreExceptionsScope.emplace(m_debugger);
- injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
+ injectedScript->callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
}
void V8RuntimeAgentImpl::getProperties(ErrorString* errorString, const String& objectId, const bool* ownProperties, const bool* accessorPropertiesOnly, const bool* generatePreview, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& exceptionDetails)
@@ -113,18 +113,18 @@ void V8RuntimeAgentImpl::getProperties(ErrorString* errorString, const String& o
*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;
}
IgnoreExceptionsScope ignoreExceptionsScope(m_debugger);
- injectedScript.getProperties(errorString, objectId, asBool(ownProperties), asBool(accessorPropertiesOnly), asBool(generatePreview), &result, &exceptionDetails);
+ injectedScript->getProperties(errorString, objectId, asBool(ownProperties), asBool(accessorPropertiesOnly), asBool(generatePreview), &result, &exceptionDetails);
if (!exceptionDetails && !asBool(accessorPropertiesOnly))
- injectedScript.getInternalProperties(errorString, objectId, &internalProperties, &exceptionDetails);
+ injectedScript->getInternalProperties(errorString, objectId, &internalProperties, &exceptionDetails);
}
void V8RuntimeAgentImpl::releaseObject(ErrorString* errorString, const String& objectId)
@@ -134,13 +134,13 @@ void V8RuntimeAgentImpl::releaseObject(ErrorString* errorString, const String& o
*errorString = "Invalid object id";
return;
}
- InjectedScript injectedScript = m_injectedScriptManager->findInjectedScript(remoteId.get());
- if (injectedScript.isEmpty())
+ InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript(remoteId.get());
+ if (!injectedScript)
return;
bool pausingOnNextStatement = m_debugger->pausingOnNextStatement();
if (pausingOnNextStatement)
m_debugger->setPauseOnNextStatement(false);
- injectedScript.releaseObject(objectId);
+ injectedScript->releaseObject(objectId);
if (pausingOnNextStatement)
m_debugger->setPauseOnNextStatement(true);
}
@@ -212,9 +212,9 @@ void V8RuntimeAgentImpl::reportExecutionContextCreated(ScriptState* scriptState,
{
if (!m_enabled)
return;
- InjectedScript injectedScript = injectedScriptManager()->injectedScriptFor(scriptState);
+ InjectedScript* injectedScript = injectedScriptManager()->injectedScriptFor(scriptState);
RefPtr<ExecutionContextDescription> description = ExecutionContextDescription::create()
- .setId(injectedScript.contextId())
+ .setId(injectedScript->contextId())
.setName(humanReadableName)
.setOrigin(origin)
.setFrameId(frameId);
« no previous file with comments | « third_party/WebKit/Source/core/inspector/v8/V8DebuggerAgentImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698