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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorRuntimeAgent.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/InspectorRuntimeAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorRuntimeAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorRuntimeAgent.cpp
index 133c086906267601c25cf8e1f172af0d5540d6d7..49512c025568019aa5c60fc0b1e50d8f1149bd6b 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorRuntimeAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorRuntimeAgent.cpp
@@ -90,7 +90,14 @@ void InspectorRuntimeAgent::restore()
void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* optExecutionContextId, const bool* const returnByValue, const bool* generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& exceptionDetails)
{
- int executionContextId = optExecutionContextId ? *optExecutionContextId : m_injectedScriptManager->injectedScriptFor(defaultScriptState()).contextId();
+ int executionContextId;
+ if (optExecutionContextId) {
+ executionContextId = *optExecutionContextId;
+ } else {
+ InjectedScript* injectedScript = m_injectedScriptManager->injectedScriptFor(defaultScriptState());
+ ASSERT(injectedScript);
+ executionContextId = injectedScript->contextId();
+ }
MuteConsoleScope<InspectorRuntimeAgent> muteScope;
if (asBool(doNotPauseOnExceptionsAndMuteConsole))
muteScope.enter(this);

Powered by Google App Engine
This is Rietveld 408576698