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

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

Issue 1622213002: DevTools: make InjectedScript heap-allocated. (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/InspectorConsoleAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
index de46f84c29315839db5b7a90e4b778529ab1e647..44094e781499745aa3e2bb670baa396aa1f2a63c 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp
@@ -192,18 +192,18 @@ void InspectorConsoleAgent::sendConsoleMessageToFrontend(ConsoleMessage* console
jsonObj->setUrl(consoleMessage->url());
ScriptState* scriptState = consoleMessage->scriptState();
if (scriptState)
- jsonObj->setExecutionContextId(m_injectedScriptManager->injectedScriptFor(scriptState).contextId());
+ jsonObj->setExecutionContextId(scriptState->contextIdInDebugger());
pfeldman 2016/01/24 07:34:19 This is a change to the semantics - injected scrip
if (consoleMessage->source() == NetworkMessageSource && consoleMessage->requestIdentifier())
jsonObj->setNetworkRequestId(IdentifiersFactory::requestId(consoleMessage->requestIdentifier()));
RefPtrWillBeRawPtr<ScriptArguments> arguments = consoleMessage->scriptArguments();
if (arguments && arguments->argumentCount()) {
- InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(arguments->scriptState());
- if (!injectedScript.isEmpty()) {
+ InjectedScript* injectedScript = m_injectedScriptManager->injectedScriptFor(arguments->scriptState());
+ if (injectedScript) {
RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::RemoteObject> > jsonArgs = TypeBuilder::Array<TypeBuilder::Runtime::RemoteObject>::create();
if (consoleMessage->type() == TableMessageType && generatePreview && arguments->argumentCount()) {
ScriptValue table = arguments->argumentAt(0);
ScriptValue columns = arguments->argumentCount() > 1 ? arguments->argumentAt(1) : ScriptValue();
- RefPtr<TypeBuilder::Runtime::RemoteObject> inspectorValue = injectedScript.wrapTable(table, columns);
+ RefPtr<TypeBuilder::Runtime::RemoteObject> inspectorValue = injectedScript->wrapTable(table, columns);
if (!inspectorValue) {
ASSERT_NOT_REACHED();
return;
@@ -211,7 +211,7 @@ void InspectorConsoleAgent::sendConsoleMessageToFrontend(ConsoleMessage* console
jsonArgs->addItem(inspectorValue);
} else {
for (unsigned i = 0; i < arguments->argumentCount(); ++i) {
- RefPtr<TypeBuilder::Runtime::RemoteObject> inspectorValue = injectedScript.wrapObject(arguments->argumentAt(i), "console", generatePreview);
+ RefPtr<TypeBuilder::Runtime::RemoteObject> inspectorValue = injectedScript->wrapObject(arguments->argumentAt(i), "console", generatePreview);
if (!inspectorValue) {
ASSERT_NOT_REACHED();
return;

Powered by Google App Engine
This is Rietveld 408576698